Skip to content

API

base.AxeBase(axe_script=AXE_SCRIPT)

Bases: ABC

Abstract base class.

Parameters:

  • axe_script (str) –

    axe.js or axe.min.js javascript. Defaults to AXE_SCRIPT.

from_file(axe_min_js_path) classmethod

Load axe script from file and create Axe instance.

Parameters:

  • axe_min_js_path (str | Path) –

    path to axe.js or axe.min.js

Returns:

  • AxeBase( AxeBase ) –

    Axe instance

selenium.Axe

Bases: AxeBase

run(webdriver, context=None, options=None)

Run axe accessibility checks against webdriver.

Parameters:

  • webdriver –

    selenium webdriver

  • context (str | list | dict | None) –

    context. Defaults to None.

  • options (dict | None) –

    options. Defaults to None.

For more information on context and options, view the axe-core documentation.

Returns:

  • dict( dict ) –

    test result

sync_playwright.Axe

Bases: AxeBase

run(page, context=None, options=None)

Run axe accessibility checks against webpage.

Parameters:

  • page (playwright.sync_api._generated.Page) –

    Page object

  • context (str | list | dict | None) –

    context. Defaults to None.

  • options (dict | None) –

    options. Defaults to None.

For more information on context and options, view the axe-core documentation.

Returns:

  • dict( dict ) –

    test result

async_playwright.Axe

Bases: AxeBase

run(page, context=None, options=None) async

Asynchronously run axe accessibility checks against webpage.

Parameters:

  • page (playwright.async_api.Page) –

    Page object

  • context (str | list | dict | None) –

    context. Defaults to None.

  • options (dict | None) –

    options. Defaults to None.

For more information on context and options, view the axe-core documentation.

Returns:

  • dict( dict ) –

    test result