virtual-cursor
virtual-cursor adds human-like cursor animations to your browser tests.
Browser test libraries like Selenium or Playwright can be used to generate screenshots or videos of websites, which are great for debugging or as media for documentation. Most of the times, these videos are not very useful, because the test code clicks much faster than a human and the cursor is invisible.
virtual-cursor emulates a cursor by injecting a custom JavaScript payload into the test browser, which animates a mocked, second cursor, and adds delays to slow down the test code.
Installation
virtual-cursor can be installed via pip
pip install virtual-cursor
Usage
pytest + playwright
See a full example which produces the clip above.
async def test_virtual_cursor():
from playwright.async_api import async_playwright
from virtual_cursor.playwright import click, fill, check, selectOption
async with async_playwright() as playwright:
browser = await playwright.chromium.launch()
browser_context = await browser.new_context(
record_video_dir='/tmp/videos/',
)
page = await browser_context.new_page()
await page.goto('http://localhost')
# click element
await click(page, '#button')
# fill out a text-input
await fill(page, '#text-input', 'Lorem Ipsum')
# select an option of a select
await selectOption(page, '#select', 'Option 17')
# check a checkbox
await check(page, '#check-box')
Metadata
Release files for virtual-cursor 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| virtual-cursor-0.1.tar.gz | 8.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| virtual_cursor-0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.5 kB
Release files / virtual-cursor-0.1.tar.gz
| Download URL | virtual-cursor-0.1.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7be3d5d243ceff3a3c61f5ef1f1bee0da01245c53c5505a88662511191be9fcc
|
|
BLAKE2b-256 checksum How to use checksums |
f2a517b51e579534e0aea4d166714a25d6b6138120c6a2649794896176159c64
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Release files / virtual_cursor-0.1-py3-none-any.whl
| Download URL | virtual_cursor-0.1-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
493a4cf851a2d31f3c17bd3ef837153ab5223eb01cecc59de708fdd2733ace82
|
|
BLAKE2b-256 checksum How to use checksums |
0bfda95cd4f807660f64bee0ecf4731acd136d387f493e8839cbfe3707488e92
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.4
|
Security for virtual-cursor 0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.