Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(axe-core-4.9.1): update to use axe-core 4.9.1 #1322

Merged
merged 6 commits into from
Jun 20, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"yargs": "^17.0.0"
},
"devDependencies": {
"@axe-core/cli": "^4.8.0",
"@axe-core/puppeteer": "^4.8.0",
"@axe-core/cli": "^4.9.1",
"@axe-core/puppeteer": "^4.9.1",
rohittarpara marked this conversation as resolved.
Show resolved Hide resolved
"@types/jest": "^27.4.0",
"@types/lodash": "^4.14.136",
"@types/node": "^18.16.2",
Expand All @@ -46,7 +46,7 @@
},
"resolutions": {
"ansi-regex@^4.1.0": "^5.0.1",
"axe-core": "4.8.4",
"axe-core": "4.9.1",
"chromedriver": "^119.0.1"
},
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions src/__snapshots__/index.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1388,15 +1388,15 @@ Object {
],
"tool": Object {
"driver": Object {
"downloadUri": "https://www.npmjs.com/package/axe-core/v/4.8.4",
"fullName": "axe for Web v4.8.4",
"downloadUri": "https://www.npmjs.com/package/axe-core/v/4.9.1",
"fullName": "axe for Web v4.9.1",
"informationUri": "https://www.deque.com/axe/axe-for-web/",
"name": "axe-core",
"properties": Object {
"microsoft/qualityDomain": "Accessibility",
},
"rules": Array [],
"semanticVersion": "4.8.4",
"semanticVersion": "4.9.1",
"shortDescription": Object {
"text": "An open source accessibility rules library for automated testing.",
},
Expand All @@ -1407,7 +1407,7 @@ Object {
"name": "WCAG",
},
],
"version": "4.8.4",
"version": "4.9.1",
},
},
},
Expand Down
6 changes: 4 additions & 2 deletions src/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ describe('axe-sarif-converter CLI', () => {
${'w3citylights-axe-v4.8.4.axe-cli-v4.8.5.json'}
${'basic-axe-v4.8.4.axe-cli-v4.9.0.json'}
${'w3citylights-axe-v4.8.4.axe-cli-v4.9.0.json'}
${'basic-axe-v4.9.1.axe-cli-v4.9.1.json'}
${'w3citylights-axe-v4.9.1.axe-cli-v4.9.1.json'}
`(
'supports conversion from axe-cli output $inputFile',
async ({ inputFile }) => {
Expand Down Expand Up @@ -204,11 +206,11 @@ describe('axe-sarif-converter CLI', () => {
const testResultsDir = path.join(__dirname, '..', 'test-results');
const basicAxeV2File = path.join(
testResourcesDir,
'basic-axe-v4.8.4.reporter-v2.json',
'basic-axe-v4.9.1.reporter-v2.json',
);
const basicSarifFile = path.join(
testResourcesDir,
'basic-axe-v4.8.4.sarif',
'basic-axe-v4.9.1.sarif',
);

const mkdir = promisify(fs.mkdir);
Expand Down
6 changes: 5 additions & 1 deletion src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ describe('public convertAxeToSarif API', () => {
${'basic-axe-v4.8.4.reporter-v2.json'} | ${'basic-axe-v4.8.4.sarif'}
${'w3citylights-axe-v4.8.4.reporter-v1.json'} | ${'w3citylights-axe-v4.8.4.sarif'}
${'w3citylights-axe-v4.8.4.reporter-v2.json'} | ${'w3citylights-axe-v4.8.4.sarif'}
${'basic-axe-v4.9.1.reporter-v1.json'} | ${'basic-axe-v4.9.1.sarif'}
${'basic-axe-v4.9.1.reporter-v2.json'} | ${'basic-axe-v4.9.1.sarif'}
${'w3citylights-axe-v4.9.1.reporter-v1.json'} | ${'w3citylights-axe-v4.9.1.sarif'}
${'w3citylights-axe-v4.9.1.reporter-v2.json'} | ${'w3citylights-axe-v4.9.1.sarif'}
`(
'converts pinned v1/v2 input $inputFile to pinned output $outputFile',
({ inputFile, outputFile }) => {
Expand Down Expand Up @@ -165,7 +169,7 @@ describe('public sarifReporter API', () => {
// it isn't very meaningful to test cases that involve old axe versions here.
it.each`
inputFile | outputFile
${'basic-axe-v4.8.4.reporter-raw.json'} | ${'basic-axe-v4.8.4.sarif'}
${'basic-axe-v4.9.1.reporter-raw.json'} | ${'basic-axe-v4.9.1.sarif'}
`(
'converts pinned raw input $inputFile to pinned output $outputFile',
async ({ inputFile, outputFile }) => {
Expand Down
72 changes: 72 additions & 0 deletions src/test-resources/basic-axe-v4.9.1.axe-cli-v4.9.1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
[
{
"testEngine": {
"name": "axe-core",
"version": "4.9.1"
},
"testRunner": {
"name": "axe"
},
"testEnvironment": {
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/119.0.6045.105 Safari/537.36",
"windowWidth": 800,
"windowHeight": 600,
"orientationAngle": 0,
"orientationType": "landscape-primary"
},
"timestamp": "2024-06-19T05:14:53.272Z",
"url": "file:///C:/Users/v-rtarpara/Rohit/Projects/fork/axe-sarif-converter/src/test-resources/basic.html",
"toolOptions": {
"runOnly": {
"type": "rule",
"values": [
"document-title"
]
},
"reporter": "v1"
},
"inapplicable": [],
"passes": [],
"incomplete": [],
"violations": [
{
"id": "document-title",
"impact": "serious",
"tags": [
"cat.text-alternatives",
"wcag2a",
"wcag242",
"TTv5",
"TT12.a",
"EN-301-549",
"EN-9.2.4.2",
"ACT"
],
"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/4.9/document-title?application=webdriverjs",
"nodes": [
{
"any": [
{
"id": "doc-has-title",
"data": null,
"relatedNodes": [],
"impact": "serious",
"message": "Document does not have a non-empty <title> element"
}
],
"all": [],
"none": [],
"impact": "serious",
"html": "<html><head></head><body>\n</body></html>",
"target": [
"html"
],
"failureSummary": "Fix any of the following:\n Document does not have a non-empty <title> element"
}
]
}
]
}
]
57 changes: 57 additions & 0 deletions src/test-resources/basic-axe-v4.9.1.reporter-raw.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[
{
"id": "document-title",
"result": "failed",
"pageLevel": false,
"impact": "serious",
"tags": [
"cat.text-alternatives",
"wcag2a",
"wcag242",
"TTv5",
"TT12.a",
"EN-301-549",
"EN-9.2.4.2",
"ACT"
],
"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/4.9/document-title?application=axe-puppeteer",
"inapplicable": [],
"passes": [],
"incomplete": [],
"violations": [
{
"any": [
{
"id": "doc-has-title",
"data": null,
"impact": "serious",
"message": "Document does not have a non-empty <title> element",
"relatedNodes": []
}
],
"all": [],
"none": [],
"impact": "serious",
"result": "failed",
"node": {
"selector": [
"html"
],
"source": "<html><head></head><body>\n</body></html>",
"xpath": [
"/html"
],
"ancestry": [
"html"
],
"nodeIndexes": [
0
],
"fromFrame": false
}
}
]
}
]
74 changes: 74 additions & 0 deletions src/test-resources/basic-axe-v4.9.1.reporter-v1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"testEngine": {
"name": "axe-core",
"version": "4.9.1"
},
"testRunner": {
"name": "axe"
},
"testEnvironment": {
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/101.0.4950.0 Safari/537.36",
"windowWidth": 800,
"windowHeight": 600,
"orientationAngle": 0,
"orientationType": "portrait-primary"
},
"timestamp": "2000-01-02T03:04:05.006Z",
"url": "http://localhost/",
"toolOptions": {
"xpath": true,
"runOnly": {
"type": "rule",
"values": [
"document-title"
]
},
"reporter": "v1"
},
"inapplicable": [],
"passes": [],
"incomplete": [],
"violations": [
{
"id": "document-title",
"impact": "serious",
"tags": [
"cat.text-alternatives",
"wcag2a",
"wcag242",
"TTv5",
"TT12.a",
"EN-301-549",
"EN-9.2.4.2",
"ACT"
],
"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/4.9/document-title?application=axe-puppeteer",
"nodes": [
{
"any": [
{
"id": "doc-has-title",
"data": null,
"relatedNodes": [],
"impact": "serious",
"message": "Document does not have a non-empty <title> element"
}
],
"all": [],
"none": [],
"impact": "serious",
"html": "<html><head></head><body>\n</body></html>",
"target": [
"html"
],
"xpath": [
"/html"
],
"failureSummary": "Fix any of the following:\n Document does not have a non-empty <title> element"
}
]
}
]
}
73 changes: 73 additions & 0 deletions src/test-resources/basic-axe-v4.9.1.reporter-v2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
{
"testEngine": {
"name": "axe-core",
"version": "4.9.1"
},
"testRunner": {
"name": "axe"
},
"testEnvironment": {
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/101.0.4950.0 Safari/537.36",
"windowWidth": 800,
"windowHeight": 600,
"orientationAngle": 0,
"orientationType": "portrait-primary"
},
"timestamp": "2000-01-02T03:04:05.006Z",
"url": "http://localhost/",
"toolOptions": {
"xpath": true,
"runOnly": {
"type": "rule",
"values": [
"document-title"
]
},
"reporter": "v2"
},
"inapplicable": [],
"passes": [],
"incomplete": [],
"violations": [
{
"id": "document-title",
"impact": "serious",
"tags": [
"cat.text-alternatives",
"wcag2a",
"wcag242",
"TTv5",
"TT12.a",
"EN-301-549",
"EN-9.2.4.2",
"ACT"
],
"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/4.9/document-title?application=axe-puppeteer",
"nodes": [
{
"any": [
{
"id": "doc-has-title",
"data": null,
"relatedNodes": [],
"impact": "serious",
"message": "Document does not have a non-empty <title> element"
}
],
"all": [],
"none": [],
"impact": "serious",
"html": "<html><head></head><body>\n</body></html>",
"target": [
"html"
],
"xpath": [
"/html"
]
}
]
}
]
}
Loading