Skip to content

Files

This branch is 58 commits behind develop.

rules

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Oct 31, 2023
Nov 24, 2020
Jul 11, 2024
Mar 4, 2025
Aug 8, 2023
Nov 24, 2020
Jul 31, 2023
Jul 10, 2023
Aug 8, 2023
Jan 19, 2023
Jan 31, 2023
Nov 24, 2020
Nov 24, 2020
Jul 22, 2024
Jul 2, 2024
Mar 5, 2024
Jun 3, 2022
Nov 24, 2020
Jul 10, 2023
Oct 17, 2022
Nov 24, 2020
Nov 24, 2020
Nov 24, 2020
Apr 23, 2024
Nov 24, 2020
Nov 24, 2020
Jun 20, 2024
Oct 17, 2022
Oct 17, 2022
Oct 16, 2024
Nov 28, 2022
Mar 12, 2024
Nov 24, 2020
Nov 24, 2020
Oct 17, 2022
Jul 3, 2023
Oct 17, 2022
Oct 31, 2023
Dec 6, 2022
Mar 4, 2025
Nov 24, 2020
Oct 31, 2023
Oct 31, 2023
Oct 31, 2023
Nov 24, 2020
Nov 24, 2020
Oct 17, 2022
Oct 17, 2022
Nov 24, 2020
Oct 16, 2024
Oct 16, 2024
Apr 11, 2024
Oct 18, 2021
Aug 8, 2023
Oct 31, 2023
May 15, 2023
Nov 24, 2020
Oct 17, 2022
Oct 17, 2022
Nov 24, 2020
Nov 24, 2020
Nov 24, 2020
Oct 31, 2023
Oct 17, 2022
Oct 4, 2022
Oct 17, 2022
Oct 12, 2022
Oct 17, 2022
Nov 24, 2020
Jan 23, 2023
Oct 4, 2022
Nov 24, 2020
Jul 10, 2024
Nov 24, 2020
Nov 24, 2020
Nov 24, 2020
Nov 24, 2020
Mar 4, 2025
Nov 24, 2020
Sep 28, 2022
Nov 24, 2020
Sep 7, 2022
Oct 17, 2022
Apr 26, 2024
May 17, 2024
Oct 16, 2024

Rule Integration Tests

Rule Integration tests take an HTML snippet file and runs an axe-core rule against it. The results for the run are then compared against the companion JSON file to ensure that every node returns as the expected result (passes, violation, incomplete, inapplicable).

To run the rule integration tests, run npm run test:unit:integration. You can run and debug the tests in a non-headless browser by running npm run test:debug -- testDirs=integration. You can either use that browser's debugger or attach an external debugger on port 9765; a VS Code launch profile is provided.

When the tests are run, each JSON file is converted into a test suite file using Karmas preprocessor and runner.js as the test suite template.

The JSON file for a rule integration test contains the following information:

  • description - string(required). The title of the test. Used in the describe block of the test suite
  • rule - string(required) The axe-core rule to run
  • violations array(optional). List of axe-core selectors of nodes that should return as Violations
  • passes array(optional). List of axe-core selectors of nodes that should return as Passes
  • incomplete array(optional). List of axe-core selectors of nodes that should return as Needs Review

The JSON file should have at least one of the violations, passes, or incomplete arrays. Inapplicable results are not listed as the test will fail if any node is found in one of the 3 arrays that is not explicitly listed.