Package: rh-axe-selenium-python
axe-selenium-python integrates aXe and selenium to enable automated web accessibility testing.This version of axe-selenium-python is using axe-core@3.3.2.RequirementsYou will need the following prerequisites in order to use axe-selenium-python:selenium >= 3.0.0Python 2.7 or 3.6The appropriate driver for the browser you intend to use, downloaded and added to your path, e.g. geckodriver for Firefox:geckodriverdownloaded andadded to your PATHInstallationTo install axe-selenium-python:$pipinstallrh-axe-selenium-pythonUsagefromseleniumimportwebdriverfromaxe_selenium_pythonimportAxedeftest_google():driver=webdriver.Firefox()driver.get("http://www.google.com")axe=Axe(driver)# Inject axe-core javascript into page.axe.inject()# Run axe accessibility checks.results=axe.run()# Write results to fileaxe.write_results(results,'a11y.json')driver.close()# Assert no violations are foundassertlen(results["violations"])==0,axe.report(results["violations"])The methodaxe.run()accepts two parameters:contextandoptions.For more information oncontextandoptions, view theaXe documentation here.ContributingFork the repository and submit PRs with bug fixes and enhancements;
contributions are very welcome.Node dependencies must be installed by runningnpm installinside the axe-selenium-python directory.You can run the tests usingtox:$toxResourcesIssue TrackerCodepytest-axeCHANGELOGversion 2.1.5Breaks backwards compatibility:The Axe class methodexecutehas been renamed torunto mirror the method in the axe-core API.version 2.1.0Created package.json file to maintain axe-core dependencyReplaced unit tests with more meaningful integration tests
- included a sample html file for integration testsversion 2.0.0All functionalities that are not part of axe-core have been moved into a separate package,pytest-axe. This includes:run_axehelper methodget_rulesAxe class methodrunAxe class methodimpact_includedAxe class methodanalyzeAxe class method.The purpose of this change is to separate implementations that are specific to the Mozilla Firefox Test Engineering team, and leave the baseaxe-selenium-pythonpackage for a more broad use case. This package was modeled off of Deque’s Java package, axe-selenium-java, and will now more closely mirror it.All functionalities can still be utilized when usingaxe-selenium-pythonin conjunction withpytest-axe.version 1.2.3Added the analyze method to the Axe class. This method runs accessibility checks, and writes the JSON results to file based on the page URL and the timestamp.Writing results to file can be enabled by setting the environment variableACCESSIBILITY_REPORTING=true. The files will be written toresults/directory, which must be created if it does not already exist.Accessibility checks can be disabled by setting the environment variableACCESSIBILITY_DISABLED=true.version 1.2.1Updated axe toaxe-core@2.6.1Modified impact_included class method to reflect changes to the aXe API:There are now only 3 impact levels: ‘critical’, ‘serious’, and ‘minor’version 1.0.0Updated usage examples in READMEAdded docstrings to methods lacking documentationRemoved unused filesversion 0.0.3Added run method to Axe class to simplify the usage in existing test suitesrun method includes the ability to set what impact level to test for: ‘minor’, ‘moderate’, ‘severe’, ‘critical’version 0.0.28Added selenium instance as a class attributeChanged file paths to OS independent structureFixed file read operations to use with keywordversion 0.0.21Fixed include of aXe API file and references to itUpdated README