python-a11y-playwright


Namepython-a11y-playwright JSON
Version 1.0.1 PyPI version JSON
download
home_page
SummaryAutomate Web Accessibility Testing using AXE/HTMLCS with Playwright Python
upload_time2023-01-26 16:03:55
maintainer
docs_urlNone
author
requires_python>=3.7
licenseMIT License
keywords axe htmlcs accessibility playwright
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ## Accessibility Automation for Web Apps with Python and [Playwright](https://playwright.dev/).

### This project uses [HTML CodeSniffer](https://squizlabs.github.io/HTML_CodeSniffer/) and [Deque Axe](https://www.deque.com/)

**HTML CodeSniffer** : checks HTML source code and detects any Accessibility violations. Comes with standards that cover
the three (A, AA & AAA) conformance levels of the W3C's Web Content Accessibility Guidelines (WCAG) 2.1 and the U.S.
Section 508 legislation.

**Deque Axe** : World’s leading digital accessibility toolkit. Powerful and accurate accessibility toolkit can get you
to 80% issue coverage, or more, during development.

### Features

1. Simple & Easy to use
2. No need of prior knowledge on Accessibility
3. Works with Python [Playwright](https://playwright.dev/)
4. Rich Reporting
5. Open source

### Installation

For maven based project add the below dependency

```
pip install python-a11y-playwright
```
### Getting Started

#### Using HTML CodeSniffer

Below is the example usage using HTML CodeSniffer.

```python
from pathlib import Path

from automateda11y.pw.settings import Settings
from playwright.sync_api import sync_playwright
from automateda11y.pw.htmlcsrunner import HtmlCsRunner


def json_reports_dir():
    return Path(__file__).parent.parent.__str__()


with sync_playwright() as p:
    Settings.report_dir = json_reports_dir() + '/reports'
    browser = p.chromium.launch(headless=False)
    page = browser.new_page()
    page.goto("http://playwright.dev")
    data = HtmlCsRunner(page).execute()
    browser.close()
```

#### Using Deque Axe

Below is the example usage using Deque Axe.

```python
from pathlib import Path

from automateda11y.pw.settings import Settings
from playwright.sync_api import sync_playwright
from automateda11y.pw.axerunner import AxeRunner


def json_reports_dir():
    return Path(__file__).parent.parent.__str__()


with sync_playwright() as p:
    Settings.report_dir = json_reports_dir() + '/reports'
    browser = p.chromium.launch(headless=False)
    page = browser.new_page()
    page.goto("http://playwright.dev")
    data = AxeRunner(page).execute()
    browser.close()
```


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "python-a11y-playwright",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "axe,htmlcs,accessibility,playwright",
    "author": "",
    "author_email": "Sridhar Bandi <sridhar.bandi.ece@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/5f/65/46f79be7d70eb22525c015cf8662ed697a053fef6bb7d2cc0bd9428dd09c/python-a11y-playwright-1.0.1.tar.gz",
    "platform": null,
    "description": "## Accessibility Automation for Web Apps with Python and [Playwright](https://playwright.dev/).\n\n### This project uses [HTML CodeSniffer](https://squizlabs.github.io/HTML_CodeSniffer/) and [Deque Axe](https://www.deque.com/)\n\n**HTML CodeSniffer** : checks HTML source code and detects any Accessibility violations. Comes with standards that cover\nthe three (A, AA & AAA) conformance levels of the W3C's Web Content Accessibility Guidelines (WCAG) 2.1 and the U.S.\nSection 508 legislation.\n\n**Deque Axe** : World\u2019s leading digital accessibility toolkit. Powerful and accurate accessibility toolkit can get you\nto 80% issue coverage, or more, during development.\n\n### Features\n\n1. Simple & Easy to use\n2. No need of prior knowledge on Accessibility\n3. Works with Python [Playwright](https://playwright.dev/)\n4. Rich Reporting\n5. Open source\n\n### Installation\n\nFor maven based project add the below dependency\n\n```\npip install python-a11y-playwright\n```\n### Getting Started\n\n#### Using HTML CodeSniffer\n\nBelow is the example usage using HTML CodeSniffer.\n\n```python\nfrom pathlib import Path\n\nfrom automateda11y.pw.settings import Settings\nfrom playwright.sync_api import sync_playwright\nfrom automateda11y.pw.htmlcsrunner import HtmlCsRunner\n\n\ndef json_reports_dir():\n    return Path(__file__).parent.parent.__str__()\n\n\nwith sync_playwright() as p:\n    Settings.report_dir = json_reports_dir() + '/reports'\n    browser = p.chromium.launch(headless=False)\n    page = browser.new_page()\n    page.goto(\"http://playwright.dev\")\n    data = HtmlCsRunner(page).execute()\n    browser.close()\n```\n\n#### Using Deque Axe\n\nBelow is the example usage using Deque Axe.\n\n```python\nfrom pathlib import Path\n\nfrom automateda11y.pw.settings import Settings\nfrom playwright.sync_api import sync_playwright\nfrom automateda11y.pw.axerunner import AxeRunner\n\n\ndef json_reports_dir():\n    return Path(__file__).parent.parent.__str__()\n\n\nwith sync_playwright() as p:\n    Settings.report_dir = json_reports_dir() + '/reports'\n    browser = p.chromium.launch(headless=False)\n    page = browser.new_page()\n    page.goto(\"http://playwright.dev\")\n    data = AxeRunner(page).execute()\n    browser.close()\n```\n\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Automate Web Accessibility Testing using AXE/HTMLCS with Playwright Python",
    "version": "1.0.1",
    "split_keywords": [
        "axe",
        "htmlcs",
        "accessibility",
        "playwright"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d6a5bc4b98e874d6425e1e5c07153c22357b6f5d3fd61e30dee575013f45aa13",
                "md5": "6236933e46132e6f752fdf740a0b23a5",
                "sha256": "f564d12201cdf33766ca3b16ac5469c97f38dd4af10f2aa6b574bc739871899d"
            },
            "downloads": -1,
            "filename": "python_a11y_playwright-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6236933e46132e6f752fdf740a0b23a5",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 15106,
            "upload_time": "2023-01-26T16:03:53",
            "upload_time_iso_8601": "2023-01-26T16:03:53.868140Z",
            "url": "https://files.pythonhosted.org/packages/d6/a5/bc4b98e874d6425e1e5c07153c22357b6f5d3fd61e30dee575013f45aa13/python_a11y_playwright-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5f6546f79be7d70eb22525c015cf8662ed697a053fef6bb7d2cc0bd9428dd09c",
                "md5": "1ecf14d61f4c864c6cd048eb404817c2",
                "sha256": "ac0a6e87db1626f06fb31532d20462ada73b2a7e3cf191f837f00319f1474be8"
            },
            "downloads": -1,
            "filename": "python-a11y-playwright-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1ecf14d61f4c864c6cd048eb404817c2",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 9221,
            "upload_time": "2023-01-26T16:03:55",
            "upload_time_iso_8601": "2023-01-26T16:03:55.119542Z",
            "url": "https://files.pythonhosted.org/packages/5f/65/46f79be7d70eb22525c015cf8662ed697a053fef6bb7d2cc0bd9428dd09c/python-a11y-playwright-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-26 16:03:55",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "python-a11y-playwright"
}
        
Elapsed time: 0.03316s