Skip to content

Commit 451e891

Browse files
feat(axe-core-4.6): Update axe-core to 4.6.3 (#918)
#### Details This PR updates the repo to use axe-core 4.6.3 <!-- Usually a sentence or two describing what the PR changes --> ##### Motivation We are updating Accessibility Insights products to use axe-core 4.6.3 <!-- This can be as simple as "addresses issue #123" --> ##### Context The first few commits represent the update to axe-core 4.6.3 and updating the main tests for the repo. The last part of the PR (handled by @shanisebarona) will update the wcag-link-data.test to account for the fact that axe-core 4.6.3 references one success criterion from WCAG 2.2. <!-- Are there any parts that you've intentionally left out-of-scope for a later PR to handle? --> <!-- Were there any alternative approaches you considered? What tradeoffs did you consider? --> Yes. We considered updating the converter files and related wcag-link components to account for two WCAG versions, but this proved more complicated than what seemed reasonable based on the amount of support it would provide to users. Instead, we've opted to not reference the 1 WCAG 2.2 criterion. #### Pull request checklist <!-- If a checklist item is not applicable to this change, write "n/a" in the checkbox --> - [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 - [ ] Ran `yarn precheckin` - [ ] Verified code coverage for the changes made --------- Co-authored-by: SB <[email protected]>
1 parent f2f5628 commit 451e891

18 files changed

+107572
-23
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ The [microsoft/axe-pipelines-samples](https://github.com/microsoft/axe-pipelines
6666
6767
The version number of this library is **independent** from the version numbers of the axe-core inputs and SARIF outputs it supports.
6868
69-
- axe-sarif-converter version 2.x supports input from version ^3.2.0 || ^4.0.0 of axe-core (tested with 3.2.2, 3.3.2, 3.4.1, 3.4.2, 3.5.1, 3.5.2, 3.5.3, 3.5.4, 3.5.5, 4.0.1, 4.0.2, 4.1.1, 4.2.0, 4.3.2, and 4.4.1) and outputs SARIF v2.1
69+
- axe-sarif-converter version 2.x supports input from version ^3.2.0 || ^4.0.0 of axe-core (tested with 3.2.2, 3.3.2, 3.4.1, 3.4.2, 3.5.1, 3.5.2, 3.5.3, 3.5.4, 3.5.5, 4.0.1, 4.0.2, 4.1.1, 4.2.0, 4.3.2, 4.4.1, and 4.6.3) and outputs SARIF v2.1
7070
- axe-sarif-converter version 1.x supports input from version >= 3.2.0 < 3.3.0 of axe-core (tested with 3.2.2) and outputs SARIF v2.0
7171
7272
Note that the SARIF format _does not use semantic versioning_, and there are breaking changes between the v2.0 and v2.1 SARIF formats. If you need compatibility with a SARIF viewer that only supports v2.0, you should use version 1.x of this library.

src/__snapshots__/index.test.ts.snap

+4-4
Original file line numberDiff line numberDiff line change
@@ -1388,15 +1388,15 @@ Object {
13881388
],
13891389
"tool": Object {
13901390
"driver": Object {
1391-
"downloadUri": "https://www.npmjs.com/package/axe-core/v/4.4.1",
1392-
"fullName": "axe for Web v4.4.1",
1391+
"downloadUri": "https://www.npmjs.com/package/axe-core/v/4.6.3",
1392+
"fullName": "axe for Web v4.6.3",
13931393
"informationUri": "https://www.deque.com/axe/axe-for-web/",
13941394
"name": "axe-core",
13951395
"properties": Object {
13961396
"microsoft/qualityDomain": "Accessibility",
13971397
},
13981398
"rules": Array [],
1399-
"semanticVersion": "4.4.1",
1399+
"semanticVersion": "4.6.3",
14001400
"shortDescription": Object {
14011401
"text": "An open source accessibility rules library for automated testing.",
14021402
},
@@ -1407,7 +1407,7 @@ Object {
14071407
"name": "WCAG",
14081408
},
14091409
],
1410-
"version": "4.4.1",
1410+
"version": "4.6.3",
14111411
},
14121412
},
14131413
},

src/cli.test.ts

+2
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ describe('axe-sarif-converter CLI', () => {
7171
${'w3citylights-axe-v4.3.2.axe-cli-v4.2.2.json'}
7272
${'basic-axe-v4.4.1.axe-cli-v4.4.2.json'}
7373
${'w3citylights-axe-v4.4.1.axe-cli-v4.4.2.json'}
74+
${'basic-axe-v4.6.3.axe-cli-v4.6.0.json'}
75+
${'w3citylights-axe-v4.6.3.axe-cli-v4.6.0.json'}
7476
`(
7577
'supports conversion from axe-cli output $inputFile',
7678
async ({ inputFile }) => {

src/index.test.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ describe('public convertAxeToSarif API', () => {
107107
${'basic-axe-v4.4.1.reporter-v2.json'} | ${'basic-axe-v4.4.1.sarif'}
108108
${'w3citylights-axe-v4.4.1.reporter-v1.json'} | ${'w3citylights-axe-v4.4.1.sarif'}
109109
${'w3citylights-axe-v4.4.1.reporter-v2.json'} | ${'w3citylights-axe-v4.4.1.sarif'}
110+
${'basic-axe-v4.6.3.reporter-v1.json'} | ${'basic-axe-v4.6.3.sarif'}
111+
${'basic-axe-v4.6.3.reporter-v2.json'} | ${'basic-axe-v4.6.3.sarif'}
112+
${'w3citylights-axe-v4.6.3.reporter-v1.json'} | ${'w3citylights-axe-v4.6.3.sarif'}
113+
${'w3citylights-axe-v4.6.3.reporter-v2.json'} | ${'w3citylights-axe-v4.6.3.sarif'}
110114
`(
111115
'converts pinned v1/v2 input $inputFile to pinned output $outputFile',
112116
({ inputFile, outputFile }) => {
@@ -151,7 +155,7 @@ describe('public sarifReporter API', () => {
151155
// it isn't very meaningful to test cases that involve old axe versions here.
152156
it.each`
153157
inputFile | outputFile
154-
${'basic-axe-v4.4.1.reporter-raw.json'} | ${'basic-axe-v4.4.1.sarif'}
158+
${'basic-axe-v4.6.3.reporter-raw.json'} | ${'basic-axe-v4.6.3.sarif'}
155159
`(
156160
'converts pinned raw input $inputFile to pinned output $outputFile',
157161
async ({ inputFile, outputFile }) => {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
[
2+
{
3+
"testEngine": {
4+
"name": "axe-core",
5+
"version": "4.6.3"
6+
},
7+
"testRunner": {
8+
"name": "axe"
9+
},
10+
"testEnvironment": {
11+
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/109.0.5414.120 Safari/537.36",
12+
"windowWidth": 800,
13+
"windowHeight": 600,
14+
"orientationAngle": 0,
15+
"orientationType": "landscape-primary"
16+
},
17+
"timestamp": "2023-02-07T17:56:33.760Z",
18+
"url": "file:///C:/Users/jagibson/repos/axe-sarif-converter/src/test-resources/basic.html",
19+
"toolOptions": {
20+
"runOnly": {
21+
"type": "rule",
22+
"values": [
23+
"document-title"
24+
]
25+
},
26+
"reporter": "v1"
27+
},
28+
"inapplicable": [],
29+
"passes": [],
30+
"incomplete": [],
31+
"violations": [
32+
{
33+
"id": "document-title",
34+
"impact": "serious",
35+
"tags": [
36+
"cat.text-alternatives",
37+
"wcag2a",
38+
"wcag242",
39+
"ACT"
40+
],
41+
"description": "Ensures each HTML document contains a non-empty <title> element",
42+
"help": "Documents must have <title> element to aid in navigation",
43+
"helpUrl": "https://dequeuniversity.com/rules/axe/4.6/document-title?application=webdriverjs",
44+
"nodes": [
45+
{
46+
"any": [
47+
{
48+
"id": "doc-has-title",
49+
"data": null,
50+
"relatedNodes": [],
51+
"impact": "serious",
52+
"message": "Document does not have a non-empty <title> element"
53+
}
54+
],
55+
"all": [],
56+
"none": [],
57+
"impact": "serious",
58+
"html": "<html class=\"deque-axe-is-ready\"><head></head><body>\n</body><script>document.documentElement.classList.add(\"deque-axe-is-ready\");</script></html>",
59+
"target": [
60+
"html"
61+
],
62+
"failureSummary": "Fix any of the following:\n Document does not have a non-empty <title> element"
63+
}
64+
]
65+
}
66+
]
67+
}
68+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
[
2+
{
3+
"id": "document-title",
4+
"result": "failed",
5+
"pageLevel": false,
6+
"impact": "serious",
7+
"tags": [
8+
"cat.text-alternatives",
9+
"wcag2a",
10+
"wcag242",
11+
"ACT"
12+
],
13+
"description": "Ensures each HTML document contains a non-empty <title> element",
14+
"help": "Documents must have <title> element to aid in navigation",
15+
"helpUrl": "https://dequeuniversity.com/rules/axe/4.6/document-title?application=axe-puppeteer",
16+
"inapplicable": [],
17+
"passes": [],
18+
"incomplete": [],
19+
"violations": [
20+
{
21+
"node": {
22+
"selector": [
23+
"html"
24+
],
25+
"source": "<html><head></head><body>\n</body></html>",
26+
"xpath": [
27+
"/html"
28+
],
29+
"ancestry": [
30+
"html"
31+
],
32+
"nodeIndexes": [
33+
0
34+
]
35+
},
36+
"any": [
37+
{
38+
"id": "doc-has-title",
39+
"data": null,
40+
"relatedNodes": [],
41+
"impact": "serious",
42+
"message": "Document does not have a non-empty <title> element"
43+
}
44+
],
45+
"all": [],
46+
"none": [],
47+
"impact": "serious",
48+
"result": "failed"
49+
}
50+
]
51+
}
52+
]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
{
2+
"testEngine": {
3+
"name": "axe-core",
4+
"version": "4.6.3"
5+
},
6+
"testRunner": {
7+
"name": "axe"
8+
},
9+
"testEnvironment": {
10+
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/101.0.4950.0 Safari/537.36",
11+
"windowWidth": 800,
12+
"windowHeight": 600,
13+
"orientationAngle": 0,
14+
"orientationType": "portrait-primary"
15+
},
16+
"timestamp": "2000-01-02T03:04:05.006Z",
17+
"url": "http://localhost/",
18+
"toolOptions": {
19+
"xpath": true,
20+
"runOnly": {
21+
"type": "rule",
22+
"values": [
23+
"document-title"
24+
]
25+
},
26+
"reporter": "v1"
27+
},
28+
"inapplicable": [],
29+
"passes": [],
30+
"incomplete": [],
31+
"violations": [
32+
{
33+
"id": "document-title",
34+
"impact": "serious",
35+
"tags": [
36+
"cat.text-alternatives",
37+
"wcag2a",
38+
"wcag242",
39+
"ACT"
40+
],
41+
"description": "Ensures each HTML document contains a non-empty <title> element",
42+
"help": "Documents must have <title> element to aid in navigation",
43+
"helpUrl": "https://dequeuniversity.com/rules/axe/4.6/document-title?application=axe-puppeteer",
44+
"nodes": [
45+
{
46+
"any": [
47+
{
48+
"id": "doc-has-title",
49+
"data": null,
50+
"relatedNodes": [],
51+
"impact": "serious",
52+
"message": "Document does not have a non-empty <title> element"
53+
}
54+
],
55+
"all": [],
56+
"none": [],
57+
"impact": "serious",
58+
"html": "<html><head></head><body>\n</body></html>",
59+
"target": [
60+
"html"
61+
],
62+
"xpath": [
63+
"/html"
64+
],
65+
"failureSummary": "Fix any of the following:\n Document does not have a non-empty <title> element"
66+
}
67+
]
68+
}
69+
]
70+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"testEngine": {
3+
"name": "axe-core",
4+
"version": "4.6.3"
5+
},
6+
"testRunner": {
7+
"name": "axe"
8+
},
9+
"testEnvironment": {
10+
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/101.0.4950.0 Safari/537.36",
11+
"windowWidth": 800,
12+
"windowHeight": 600,
13+
"orientationAngle": 0,
14+
"orientationType": "portrait-primary"
15+
},
16+
"timestamp": "2000-01-02T03:04:05.006Z",
17+
"url": "http://localhost/",
18+
"toolOptions": {
19+
"xpath": true,
20+
"runOnly": {
21+
"type": "rule",
22+
"values": [
23+
"document-title"
24+
]
25+
},
26+
"reporter": "v2"
27+
},
28+
"inapplicable": [],
29+
"passes": [],
30+
"incomplete": [],
31+
"violations": [
32+
{
33+
"id": "document-title",
34+
"impact": "serious",
35+
"tags": [
36+
"cat.text-alternatives",
37+
"wcag2a",
38+
"wcag242",
39+
"ACT"
40+
],
41+
"description": "Ensures each HTML document contains a non-empty <title> element",
42+
"help": "Documents must have <title> element to aid in navigation",
43+
"helpUrl": "https://dequeuniversity.com/rules/axe/4.6/document-title?application=axe-puppeteer",
44+
"nodes": [
45+
{
46+
"any": [
47+
{
48+
"id": "doc-has-title",
49+
"data": null,
50+
"relatedNodes": [],
51+
"impact": "serious",
52+
"message": "Document does not have a non-empty <title> element"
53+
}
54+
],
55+
"all": [],
56+
"none": [],
57+
"impact": "serious",
58+
"html": "<html><head></head><body>\n</body></html>",
59+
"target": [
60+
"html"
61+
],
62+
"xpath": [
63+
"/html"
64+
]
65+
}
66+
]
67+
}
68+
]
69+
}

0 commit comments

Comments
 (0)