Name | pytest-axe-playwright-snapshot JSON |
Version |
0.0.6
JSON |
| download |
home_page | None |
Summary | A pytest plugin that runs Axe-core on Playwright pages and takes snapshots of the results. |
upload_time | 2023-07-25 19:08:18 |
maintainer | None |
docs_url | None |
author | Pamela Fox |
requires_python | >=3.8 |
license | None |
keywords |
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# pytest-axe-playwright-snapshot
A pytest plugin that runs Axe-core on Playwright pages and takes snapshots of the results.
## Installation
1. Install the plugin:
```sh
python3 -m pip install pytest-axe-playwright-snapshot
```
2. Install Playwright browsers:
```sh
python3 -m playwright install --with-deps
```
## Usage
In your tests, use the `page` fixture from pytest-playwright along with our plugin's`axe_pytest_snapshot` fixture. Once you've navigated to a page, call `axe_pytest_snapshot` with the `page` fixture as an argument:
```python
from playwright.sync_api import Page
def test_violations(page: Page, axe_pytest_snapshot):
page.goto("https://www.example.com")
axe_pytest_snapshot(page)
```
When you run a test for the first time, you must tell it explicitly to save a snapshot:
```sh
pytest --snapshot-update
```
The plugin will take a snapshot of the page and save it to a file in the `snapshots` directory. The snapshot directory will be named after the test function, and the file will be named 'violations.txt'.
On subsequent runs, the plugin will compare the latest snapshot against the snapshot and report any difference in the violations.
Raw data
{
"_id": null,
"home_page": null,
"name": "pytest-axe-playwright-snapshot",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "Pamela Fox",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/e6/11/c0e6c2d1e56d374eb363492de5844f14bd49a07a36a8eb40bed5b857d953/pytest_axe_playwright_snapshot-0.0.6.tar.gz",
"platform": null,
"description": "# pytest-axe-playwright-snapshot\n\nA pytest plugin that runs Axe-core on Playwright pages and takes snapshots of the results.\n\n## Installation\n\n1. Install the plugin:\n\n ```sh\n python3 -m pip install pytest-axe-playwright-snapshot\n ```\n\n2. Install Playwright browsers:\n\n ```sh\n python3 -m playwright install --with-deps\n ```\n\n## Usage\n\nIn your tests, use the `page` fixture from pytest-playwright along with our plugin's`axe_pytest_snapshot` fixture. Once you've navigated to a page, call `axe_pytest_snapshot` with the `page` fixture as an argument:\n\n```python\nfrom playwright.sync_api import Page\n\ndef test_violations(page: Page, axe_pytest_snapshot):\n page.goto(\"https://www.example.com\")\n axe_pytest_snapshot(page)\n```\n\nWhen you run a test for the first time, you must tell it explicitly to save a snapshot:\n\n```sh\npytest --snapshot-update\n```\n\nThe plugin will take a snapshot of the page and save it to a file in the `snapshots` directory. The snapshot directory will be named after the test function, and the file will be named 'violations.txt'.\n\nOn subsequent runs, the plugin will compare the latest snapshot against the snapshot and report any difference in the violations.\n",
"bugtrack_url": null,
"license": null,
"summary": "A pytest plugin that runs Axe-core on Playwright pages and takes snapshots of the results.",
"version": "0.0.6",
"project_urls": {
"Home": "https://github.com/pamelafox/pytest-axe-playwright-snapshot"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "702e8c330adef5d038af3a9a0488247ec73d3cf4804dd49ac84cdf15267b87b1",
"md5": "b8f519c8bfb14f8679454f0cd8df6cc0",
"sha256": "74702e978ddfbce5ac5c675d30a4ce0b743c982a3cfe70a3a4c05ac2c1b7c70c"
},
"downloads": -1,
"filename": "pytest_axe_playwright_snapshot-0.0.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "b8f519c8bfb14f8679454f0cd8df6cc0",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 4058,
"upload_time": "2023-07-25T19:08:15",
"upload_time_iso_8601": "2023-07-25T19:08:15.593339Z",
"url": "https://files.pythonhosted.org/packages/70/2e/8c330adef5d038af3a9a0488247ec73d3cf4804dd49ac84cdf15267b87b1/pytest_axe_playwright_snapshot-0.0.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "e611c0e6c2d1e56d374eb363492de5844f14bd49a07a36a8eb40bed5b857d953",
"md5": "55d53581d7903987ebd98ebec49da768",
"sha256": "b9844487d73f5f0fd129e7ced998fad20e73e94c2074d7e2d0fdd69e069d4c82"
},
"downloads": -1,
"filename": "pytest_axe_playwright_snapshot-0.0.6.tar.gz",
"has_sig": false,
"md5_digest": "55d53581d7903987ebd98ebec49da768",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 6801,
"upload_time": "2023-07-25T19:08:18",
"upload_time_iso_8601": "2023-07-25T19:08:18.187760Z",
"url": "https://files.pythonhosted.org/packages/e6/11/c0e6c2d1e56d374eb363492de5844f14bd49a07a36a8eb40bed5b857d953/pytest_axe_playwright_snapshot-0.0.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-25 19:08:18",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pamelafox",
"github_project": "pytest-axe-playwright-snapshot",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pytest-axe-playwright-snapshot"
}