Skip to content

Uses Selenium to run an axe-core analysis on the provided web pages.

Notifications You must be signed in to change notification settings

BrianDouglasIE/AxeRunner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

AxeRunner

Overview

AxeRunner is used to run accessibility tests on web pages using the axe-core library. It integrates with Selenium WebDriver to automate web accessibility testing, providing detailed reports on accessibility violations, passes, and other relevant results. The resulting axe-core report is converted into Java classes so that it can be used within a Java project.

Features

  • Runs accessibility tests on specified URLs.
  • Uses Selenium WebDriver for browser automation.
  • Configurable via AxeSpec and AxeRunOptions.
  • Parses and categorizes accessibility test results.
  • Supports axe-core rule customization.
  • Supports axe-core localization.

Prerequisites

  • Java (JDK 8 or higher)
  • Selenium WebDriver

Installation

To use AxeRunner, include the following dependencies in your project:

Maven

<dependencies>
    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>4.x.x</version>
    </dependency>
    <dependency>
        <groupId>ie.briandouglas</groupId>
        <artifactId>axe_runner</artifactId>
        <version>0.0.1-SNAPSHOT</version>
    </dependency>
</dependencies>

Usage

Creating an Instance

WebDriver driver = new ChromeDriver(); // or any other WebDriver instance
AxeRunner axeRunner = new AxeRunner(driver);

Running Accessibility Tests

String url = "https://example.com";
AxeResults results = axeRunner.getAxeResults(url);

Running with Custom Configurations

AxeSpec spec = new AxeSpec(); // Define accessibility testing specifications
AxeRunOptions options = new AxeRunOptions(); // Define run options
AxeResults results = axeRunner.getAxeResults(url, spec, options);

Accessing Results

System.out.println("Violations: " + results.violations.size());
System.out.println("Passes: " + results.passes.size());

Error Handling

  • If axe-core.min.js fails to load, an exception is thrown.
  • If Selenium fails to navigate to the page, the WebDriver is closed.
  • JSON processing errors during configuration are logged.

License

This project is licensed under the Apache License, Version 2.0.

Contributing

  • Fork the repository.
  • Create a feature branch.
  • Submit a pull request.

Contact

For any inquiries or support, reach out to Brian Douglas.

About

Uses Selenium to run an axe-core analysis on the provided web pages.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages