-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: document/test support for axe-core v3.4.1 and axe-cli v3.2.0 (#175
) #### Description of changes Neither axe-core v3.4.1 nor axe-cli v3.2.0 contain any breaking output format changes, so axe-sarif-converter was already compatible with both of them. This PR updates our test cases to include verification of this compatibility. This PR also checks in code to generate test cases for future axe-core updates, and documents the process for performing such an update in the README under a new subsection of `Contributing`. Review suggestions: * Start from the `README.md` changes; this provides a broad understanding of the changes and the expected usage of the new generator. * For the files under `/src/test-resources/*.{json|sarif}`, review by comparing against the similar files for old axe versions to satisfy yourself that they've been generated consistently and follow the same format. * Review all other code per normal (particularly the new code under `/src/test-resources/generator`) #### Pull request checklist - [x] PR title respects [Conventional Commits](https://www.conventionalcommits.org) (starts with `fix:`, `feat:`, etc, and is suitable for user-facing release notes) - [x] PR contains no breaking changes, **OR** description of both PR **and final merge commit** starts with `BREAKING CHANGE:` - [n/a] (if applicable) Addresses issue: #0000 - [x] Added relevant unit tests for your changes - [x] Ran `yarn precheckin` - [x] Verified code coverage for the changes made
- Loading branch information
Showing
33 changed files
with
58,564 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,4 +62,5 @@ typings/ | |
|
||
# build output | ||
/dist/ | ||
/src/test-resources/generator/*.js | ||
/test-results/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
export const testResourceTimestampPlaceholder = '2000-01-02T03:04:05.006Z'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
[ | ||
{ | ||
"inapplicable": [], | ||
"incomplete": [], | ||
"passes": [], | ||
"testEngine": { | ||
"name": "axe-core", | ||
"version": "3.4.1" | ||
}, | ||
"testEnvironment": { | ||
"orientationAngle": 0, | ||
"orientationType": "landscape-primary", | ||
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/79.0.3945.88 Safari/537.36", | ||
"windowHeight": 600, | ||
"windowWidth": 800 | ||
}, | ||
"testRunner": { | ||
"name": "axe" | ||
}, | ||
"timestamp": "2020-01-07T01:18:34.868Z", | ||
"toolOptions": { | ||
"reporter": "v1", | ||
"runOnly": { | ||
"type": "rule", | ||
"values": [ | ||
"document-title" | ||
] | ||
} | ||
}, | ||
"url": "file:///Q:/repos/axe-sarif-converter/src/test-resources/basic.html", | ||
"violations": [ | ||
{ | ||
"description": "Ensures each HTML document contains a non-empty <title> element", | ||
"help": "Documents must have <title> element to aid in navigation", | ||
"helpUrl": "https://dequeuniversity.com/rules/axe/3.4/document-title?application=webdriverjs", | ||
"id": "document-title", | ||
"impact": "serious", | ||
"nodes": [ | ||
{ | ||
"all": [], | ||
"any": [ | ||
{ | ||
"data": null, | ||
"id": "doc-has-title", | ||
"impact": "serious", | ||
"message": "Document does not have a non-empty <title> element", | ||
"relatedNodes": [] | ||
} | ||
], | ||
"failureSummary": "Fix any of the following:\n Document does not have a non-empty <title> element", | ||
"html": "<html class=\"deque-axe-is-ready\"><head></head><body>\n</body><script>document.documentElement.classList.add(\"deque-axe-is-ready\");</script></html>", | ||
"impact": "serious", | ||
"none": [], | ||
"target": [ | ||
"html" | ||
] | ||
} | ||
], | ||
"tags": [ | ||
"cat.text-alternatives", | ||
"wcag2a", | ||
"wcag242" | ||
] | ||
} | ||
] | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
[ | ||
{ | ||
"id": "document-title", | ||
"result": "failed", | ||
"pageLevel": false, | ||
"impact": "serious", | ||
"tags": [ | ||
"cat.text-alternatives", | ||
"wcag2a", | ||
"wcag242" | ||
], | ||
"description": "Ensures each HTML document contains a non-empty <title> element", | ||
"help": "Documents must have <title> element to aid in navigation", | ||
"helpUrl": "https://dequeuniversity.com/rules/axe/3.4/document-title?application=axe-puppeteer", | ||
"inapplicable": [], | ||
"passes": [], | ||
"incomplete": [], | ||
"violations": [ | ||
{ | ||
"any": [ | ||
{ | ||
"id": "doc-has-title", | ||
"data": null, | ||
"relatedNodes": [], | ||
"impact": "serious", | ||
"message": "Document does not have a non-empty <title> element" | ||
} | ||
], | ||
"all": [], | ||
"none": [], | ||
"node": { | ||
"selector": [ | ||
"html" | ||
], | ||
"source": "<html><head></head><body>\n</body></html>", | ||
"xpath": [ | ||
"/html" | ||
] | ||
}, | ||
"impact": "serious", | ||
"result": "failed" | ||
} | ||
] | ||
} | ||
] |
Oops, something went wrong.