@axe-core/cli 4.8.0 → 4.8.1-22b3a9d.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +91 -0
- package/dist/src/bin/cli.d.ts +2 -0
- package/dist/src/bin/cli.js +40 -0
- package/dist/src/bin/cli.js.map +1 -0
- package/dist/src/bin/cli.test.d.ts +1 -0
- package/dist/src/bin/cli.test.js +259 -0
- package/dist/src/bin/cli.test.js.map +1 -0
- package/dist/src/bin/index.d.ts +5 -0
- package/dist/src/bin/index.js +168 -0
- package/dist/src/bin/index.js.map +1 -0
- package/dist/src/lib/axe-test-urls.d.ts +4 -0
- package/dist/src/lib/axe-test-urls.js +89 -0
- package/dist/src/lib/axe-test-urls.js.map +1 -0
- package/dist/src/lib/axe-test-urls.test.d.ts +1 -0
- package/dist/src/lib/axe-test-urls.test.js +73 -0
- package/dist/src/lib/axe-test-urls.test.js.map +1 -0
- package/dist/src/lib/events.d.ts +10 -0
- package/dist/src/lib/events.js +54 -0
- package/dist/src/lib/events.js.map +1 -0
- package/dist/src/lib/events.test.d.ts +1 -0
- package/dist/src/lib/events.test.js +31 -0
- package/dist/src/lib/events.test.js.map +1 -0
- package/{src/lib/index.ts → dist/src/lib/index.d.ts} +0 -1
- package/dist/src/lib/index.js +36 -0
- package/dist/src/lib/index.js.map +1 -0
- package/dist/src/lib/utils.d.ts +15 -0
- package/dist/src/lib/utils.js +127 -0
- package/dist/src/lib/utils.js.map +1 -0
- package/dist/src/lib/utils.test.d.ts +1 -0
- package/dist/src/lib/utils.test.js +165 -0
- package/dist/src/lib/utils.test.js.map +1 -0
- package/dist/src/lib/webdriver.d.ts +4 -0
- package/dist/src/lib/webdriver.js +50 -0
- package/dist/src/lib/webdriver.js.map +1 -0
- package/dist/src/lib/webdriver.test.d.ts +1 -0
- package/dist/src/lib/webdriver.test.js +102 -0
- package/dist/src/lib/webdriver.test.js.map +1 -0
- package/dist/src/testutils/index.d.ts +19 -0
- package/dist/src/testutils/index.js +51 -0
- package/dist/src/testutils/index.js.map +1 -0
- package/dist/src/types.d.ts +37 -0
- package/dist/src/types.js +18 -0
- package/dist/src/types.js.map +1 -0
- package/package.json +7 -3
- package/.eslintrc.js +0 -18
- package/CHANGELOG.md +0 -221
- package/src/bin/cli.test.ts +0 -420
- package/src/bin/cli.ts +0 -86
- package/src/bin/index.ts +0 -216
- package/src/lib/axe-test-urls.test.ts +0 -73
- package/src/lib/axe-test-urls.ts +0 -98
- package/src/lib/events.test.ts +0 -26
- package/src/lib/events.ts +0 -68
- package/src/lib/utils.test.ts +0 -160
- package/src/lib/utils.ts +0 -147
- package/src/lib/webdriver.test.ts +0 -104
- package/src/lib/webdriver.ts +0 -43
- package/src/testutils/axe-core@2.5.0.js +0 -18929
- package/src/testutils/index.ts +0 -47
- package/src/testutils/simple-clean.html +0 -11
- package/src/testutils/simple.html +0 -12
- package/src/types.ts +0 -42
- package/tsconfig.json +0 -19
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@axe-core/cli",
|
|
3
|
+
"version": "4.8.0",
|
|
4
|
+
"description": "A CLI for accessibility testing using axe-core",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Wilco Fiers",
|
|
7
|
+
"organization": "Deque Systems, Inc.",
|
|
8
|
+
"url": "http://github.com/wilcofiers/"
|
|
9
|
+
},
|
|
10
|
+
"contributors": [
|
|
11
|
+
{
|
|
12
|
+
"name": "Michael Siek (me@michaelsiek.com)"
|
|
13
|
+
}
|
|
14
|
+
],
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "https://github.com/dequelabs/axe-core-npm.git"
|
|
18
|
+
},
|
|
19
|
+
"license": "MPL-2.0",
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"postinstall.js"
|
|
23
|
+
],
|
|
24
|
+
"main": "dist/src/lib/index.js",
|
|
25
|
+
"typings": "dist/src/types.d.ts",
|
|
26
|
+
"bin": {
|
|
27
|
+
"axe": "./dist/src/bin/cli.js"
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=8"
|
|
34
|
+
},
|
|
35
|
+
"scripts": {
|
|
36
|
+
"prebuild": "rimraf dist",
|
|
37
|
+
"build": "tsc",
|
|
38
|
+
"test": "mocha --timeout 60000 -r ts-node/register 'src/**/**.test.ts'",
|
|
39
|
+
"coverage": "nyc npm run test"
|
|
40
|
+
},
|
|
41
|
+
"keywords": [
|
|
42
|
+
"axe-core",
|
|
43
|
+
"accessibility",
|
|
44
|
+
"a11y",
|
|
45
|
+
"wcag",
|
|
46
|
+
"cli",
|
|
47
|
+
"testing"
|
|
48
|
+
],
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@axe-core/webdriverjs": "^4.8.0",
|
|
51
|
+
"axe-core": "~4.8.2",
|
|
52
|
+
"chromedriver": "latest",
|
|
53
|
+
"colors": "^1.4.0",
|
|
54
|
+
"commander": "^9.4.1",
|
|
55
|
+
"selenium-webdriver": "^4.8.1"
|
|
56
|
+
},
|
|
57
|
+
"devDependencies": {
|
|
58
|
+
"@types/chai": "^4.3.3",
|
|
59
|
+
"@types/chromedriver": "^81.0.1",
|
|
60
|
+
"@types/mocha": "^10.0.0",
|
|
61
|
+
"@types/selenium-webdriver": "^4.1.5",
|
|
62
|
+
"chai": "^4.3.6",
|
|
63
|
+
"execa": "5.1.0",
|
|
64
|
+
"mocha": "^10.0.0",
|
|
65
|
+
"nyc": "^15.1.0",
|
|
66
|
+
"rimraf": "^3.0.2",
|
|
67
|
+
"tempy": "^1.0.0",
|
|
68
|
+
"ts-node": "^10.9.1",
|
|
69
|
+
"typescript": "^4.8.4"
|
|
70
|
+
},
|
|
71
|
+
"nyc": {
|
|
72
|
+
"checkCoverage": true,
|
|
73
|
+
"extension": [
|
|
74
|
+
".ts"
|
|
75
|
+
],
|
|
76
|
+
"reporter": [
|
|
77
|
+
"text-summary",
|
|
78
|
+
"html"
|
|
79
|
+
],
|
|
80
|
+
"statements": 95,
|
|
81
|
+
"branches": 91,
|
|
82
|
+
"functions": 94,
|
|
83
|
+
"lines": 95,
|
|
84
|
+
"exclude": [
|
|
85
|
+
"dist",
|
|
86
|
+
"coverage",
|
|
87
|
+
"**/*.test.ts",
|
|
88
|
+
"src/testutils"
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const commander_1 = require("commander");
|
|
8
|
+
const package_json_1 = require("../../package.json");
|
|
9
|
+
const utils_1 = require("../lib/utils");
|
|
10
|
+
const _1 = __importDefault(require("."));
|
|
11
|
+
const program = new commander_1.Command();
|
|
12
|
+
program
|
|
13
|
+
.version(package_json_1.version)
|
|
14
|
+
.usage('<url...> [options]')
|
|
15
|
+
.option('-i, --include <list>', 'CSS selector of included elements, comma separated', utils_1.splitList)
|
|
16
|
+
.option('-e, --exclude <list>', 'CSS selector of excluded elements, comma separated', utils_1.splitList)
|
|
17
|
+
.option('-r, --rules <list>', 'IDs of rules to run, comma separated', utils_1.splitList)
|
|
18
|
+
.option('-t, --tags <list>', 'Tags of rules to run, comma separated', utils_1.splitList)
|
|
19
|
+
.option('-l, --disable <list>', 'IDs of rules to disable, comma separated', utils_1.splitList)
|
|
20
|
+
.option('-b, --browser [browser-name]', 'Which browser to run (Webdriver required)')
|
|
21
|
+
.option('-s, --save [filename]', 'Save the output as a JSON file. Filename is optional')
|
|
22
|
+
.option('-j, --stdout', 'Output results to STDOUT and silence all other output')
|
|
23
|
+
.option('-d, --dir <path>', 'Output directory')
|
|
24
|
+
.option('-a, --axe-source <path>', 'Path to axe.js file')
|
|
25
|
+
.option('-q, --exit', 'Exit with `1` failure code if any a11y tests fail')
|
|
26
|
+
.option('-v, --verbose', 'Output metadata like test tool name, version and environment')
|
|
27
|
+
.option('--load-delay <n>', 'Set how much time (milliseconds) axe will wait after page load before running the audit (default: 0)')
|
|
28
|
+
.option('--timeout <n>', 'Set how much time (seconds) axe has to run',
|
|
29
|
+
// @ts-ignore
|
|
30
|
+
90)
|
|
31
|
+
.option('--timer', 'Log the time it takes to run')
|
|
32
|
+
.option('--show-errors [boolean]', 'Display the full error stack', true)
|
|
33
|
+
// TODO: Replace this with a reporter option, this required adding
|
|
34
|
+
.option('--no-reporter', 'Turn the CLI reporter off')
|
|
35
|
+
.option('--chrome-options [options]', 'Options to provide to headless Chrome', utils_1.splitList)
|
|
36
|
+
.option('--chromedriver-path <path>', 'Absolute path to the desired chromedriver executable')
|
|
37
|
+
.option('--chrome-path <path>', 'Path to the desired chrome executable')
|
|
38
|
+
.action(_1.default);
|
|
39
|
+
program.parse(process.argv);
|
|
40
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/bin/cli.ts"],"names":[],"mappings":";;;;;;AAEA,yCAAoC;AACpC,qDAA6C;AAC7C,wCAAyC;AACzC,yCAAoB;AAEpB,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,OAAO,CAAC,sBAAO,CAAC;KAChB,KAAK,CAAC,oBAAoB,CAAC;KAC3B,MAAM,CACL,sBAAsB,EACtB,oDAAoD,EACpD,iBAAS,CACV;KACA,MAAM,CACL,sBAAsB,EACtB,oDAAoD,EACpD,iBAAS,CACV;KACA,MAAM,CACL,oBAAoB,EACpB,sCAAsC,EACtC,iBAAS,CACV;KACA,MAAM,CACL,mBAAmB,EACnB,uCAAuC,EACvC,iBAAS,CACV;KACA,MAAM,CACL,sBAAsB,EACtB,0CAA0C,EAC1C,iBAAS,CACV;KACA,MAAM,CACL,8BAA8B,EAC9B,2CAA2C,CAC5C;KACA,MAAM,CACL,uBAAuB,EACvB,sDAAsD,CACvD;KACA,MAAM,CACL,cAAc,EACd,uDAAuD,CACxD;KACA,MAAM,CAAC,kBAAkB,EAAE,kBAAkB,CAAC;KAC9C,MAAM,CAAC,yBAAyB,EAAE,qBAAqB,CAAC;KACxD,MAAM,CAAC,YAAY,EAAE,mDAAmD,CAAC;KACzE,MAAM,CACL,eAAe,EACf,8DAA8D,CAC/D;KACA,MAAM,CACL,kBAAkB,EAClB,sGAAsG,CACvG;KACA,MAAM,CACL,eAAe,EACf,4CAA4C;AAC5C,aAAa;AACb,EAAE,CACH;KACA,MAAM,CAAC,SAAS,EAAE,8BAA8B,CAAC;KACjD,MAAM,CAAC,yBAAyB,EAAE,8BAA8B,EAAE,IAAI,CAAC;IACxE,kEAAkE;KACjE,MAAM,CAAC,eAAe,EAAE,2BAA2B,CAAC;KACpD,MAAM,CACL,4BAA4B,EAC5B,uCAAuC,EACvC,iBAAS,CACV;KACA,MAAM,CACL,4BAA4B,EAC5B,sDAAsD,CACvD;KACA,MAAM,CACL,sBAAsB,EACtB,uCAAuC,CACxC;KACA,MAAM,CAAC,UAAG,CAAC,CAAC;AAEf,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'mocha';
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
require("mocha");
|
|
16
|
+
const chai_1 = require("chai");
|
|
17
|
+
const tempy_1 = __importDefault(require("tempy"));
|
|
18
|
+
const http_1 = __importDefault(require("http"));
|
|
19
|
+
const path_1 = __importDefault(require("path"));
|
|
20
|
+
const fs_1 = __importDefault(require("fs"));
|
|
21
|
+
const package_json_1 = require("../../package.json");
|
|
22
|
+
const testutils_1 = __importDefault(require("../testutils/"));
|
|
23
|
+
const SIMPLE_HTML_FILE = path_1.default.join(__dirname, '..', 'testutils', 'simple.html');
|
|
24
|
+
const SIMPLE_CLEAN_HTML_FILE = path_1.default.join(__dirname, '..', 'testutils', 'simple-clean.html');
|
|
25
|
+
const SIMPLE_HTML_SOURCE = fs_1.default.readFileSync(SIMPLE_HTML_FILE, 'utf8');
|
|
26
|
+
const PATH_TO_AXE_250 = path_1.default.resolve(__dirname, '..', 'testutils', 'axe-core@2.5.0.js');
|
|
27
|
+
describe('cli', () => {
|
|
28
|
+
it('--help', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
|
+
const result = yield (0, testutils_1.default)('--help');
|
|
30
|
+
chai_1.assert.equal(result.exitCode, 0);
|
|
31
|
+
chai_1.assert.include(result.stdout, 'Options:');
|
|
32
|
+
}));
|
|
33
|
+
it('--version', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
34
|
+
const result = yield (0, testutils_1.default)('--version');
|
|
35
|
+
chai_1.assert.equal(result.exitCode, 0);
|
|
36
|
+
chai_1.assert.deepEqual(result.stdout, package_json_1.version);
|
|
37
|
+
}));
|
|
38
|
+
describe('given a file:// url', () => {
|
|
39
|
+
it('should run an analysis', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
40
|
+
const result = yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`);
|
|
41
|
+
chai_1.assert.equal(result.exitCode, 0);
|
|
42
|
+
chai_1.assert.include(result.stdout, 'Violation of "marquee" with 1 occurrences!');
|
|
43
|
+
}));
|
|
44
|
+
});
|
|
45
|
+
describe('given a http:// url', () => {
|
|
46
|
+
let port;
|
|
47
|
+
let server;
|
|
48
|
+
before(done => {
|
|
49
|
+
server = http_1.default.createServer((req, res) => {
|
|
50
|
+
res.setHeader('Content-Type', 'text/html');
|
|
51
|
+
res.write(SIMPLE_HTML_SOURCE);
|
|
52
|
+
res.end();
|
|
53
|
+
});
|
|
54
|
+
server.listen(0, () => {
|
|
55
|
+
port = server.address().port;
|
|
56
|
+
done();
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
after(done => server.close(done));
|
|
60
|
+
it('should run an analysis', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
61
|
+
const result = yield (0, testutils_1.default)(`http://127.0.0.1:${port}/`);
|
|
62
|
+
chai_1.assert.equal(result.exitCode, 0);
|
|
63
|
+
chai_1.assert.include(result.stdout, 'Violation of "marquee" with 1 occurrences!');
|
|
64
|
+
}));
|
|
65
|
+
});
|
|
66
|
+
describe('--axe-source', () => {
|
|
67
|
+
it('should use the provided version of axe-core', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
68
|
+
const result = yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`, '--axe-source', PATH_TO_AXE_250);
|
|
69
|
+
chai_1.assert.equal(result.exitCode, 0);
|
|
70
|
+
chai_1.assert.include(result.stdout, 'Violation of "marquee" with 1 occurrences!');
|
|
71
|
+
chai_1.assert.include(result.stdout, 'Running axe-core 2.5.0');
|
|
72
|
+
}));
|
|
73
|
+
it('error when given invalid axe source path', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
74
|
+
const result = yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`, '--axe-source', 'foobar');
|
|
75
|
+
chai_1.assert.equal(result.exitCode, 2);
|
|
76
|
+
chai_1.assert.include(result.stderr, 'Unable to find the axe-core source file');
|
|
77
|
+
}));
|
|
78
|
+
});
|
|
79
|
+
// cannot run in ci we _should_ have the ability to add arguments to firefox not just chrome to allow users to run this headless
|
|
80
|
+
describe.skip('--browser', () => {
|
|
81
|
+
it('should change the browser', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
82
|
+
const result = yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`, '--browser', 'firefox', '--verbose');
|
|
83
|
+
chai_1.assert.equal(result.exitCode, 0);
|
|
84
|
+
chai_1.assert.include(result.stdout, 'Firefox');
|
|
85
|
+
}));
|
|
86
|
+
});
|
|
87
|
+
describe('--rules', () => {
|
|
88
|
+
it('should only run the rules with the provided IDs', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
89
|
+
const result = yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`, '--rules', 'region');
|
|
90
|
+
chai_1.assert.equal(result.exitCode, 0);
|
|
91
|
+
chai_1.assert.include(result.stdout, 'Violation of "region" with');
|
|
92
|
+
}));
|
|
93
|
+
});
|
|
94
|
+
describe('--tags', () => {
|
|
95
|
+
it('should only run rules with the provided tags', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
96
|
+
const result = yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`, '--tags', 'cat.parsing,wcag222');
|
|
97
|
+
chai_1.assert.equal(result.exitCode, 0);
|
|
98
|
+
// Region is tagged with "cat.keyboard", "best-practice"
|
|
99
|
+
chai_1.assert.notInclude(result.stdout, 'Violation of "region" with');
|
|
100
|
+
}));
|
|
101
|
+
});
|
|
102
|
+
describe('--exit', () => {
|
|
103
|
+
it('should exit non-zero if violations are found', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
104
|
+
try {
|
|
105
|
+
yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`, '--exit');
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
chai_1.assert.equal(error.exitCode, 1);
|
|
109
|
+
chai_1.assert.include(error.stdout, 'Violation of "marquee" with 1 occurrences!');
|
|
110
|
+
}
|
|
111
|
+
}));
|
|
112
|
+
it('should exit zero if violations are found', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
113
|
+
try {
|
|
114
|
+
yield (0, testutils_1.default)(`file://${SIMPLE_CLEAN_HTML_FILE}`, '--exit');
|
|
115
|
+
}
|
|
116
|
+
catch (error) {
|
|
117
|
+
chai_1.assert.equal(error.exitCode, 0);
|
|
118
|
+
chai_1.assert.include(error.stdout, 'Violation of "marquee" with 1 occurrences!');
|
|
119
|
+
}
|
|
120
|
+
}));
|
|
121
|
+
});
|
|
122
|
+
describe('--dir', () => {
|
|
123
|
+
let reportDir;
|
|
124
|
+
beforeEach(() => {
|
|
125
|
+
reportDir = tempy_1.default.directory();
|
|
126
|
+
});
|
|
127
|
+
it('should save a JSON report to the provided directory', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
128
|
+
const result = yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`, '--dir', reportDir);
|
|
129
|
+
chai_1.assert.equal(result.exitCode, 0);
|
|
130
|
+
const files = fs_1.default.readdirSync(reportDir);
|
|
131
|
+
const report = files.find(f => f.endsWith('.json'));
|
|
132
|
+
(0, chai_1.assert)(report, 'Did not create JSON report');
|
|
133
|
+
}));
|
|
134
|
+
});
|
|
135
|
+
describe('--include', () => {
|
|
136
|
+
it('should set a list of elements to include', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
137
|
+
const result = yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`, '--include', 'marquee');
|
|
138
|
+
chai_1.assert.notInclude(result.stdout, 'Violation of "region"');
|
|
139
|
+
chai_1.assert.include(result.stdout, 'Violation of "marquee" with 1 occurrences!');
|
|
140
|
+
}));
|
|
141
|
+
it('should throw error if CSS selector is not found', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
142
|
+
const result = yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`, '--include', '#hazaar', '--show-errors');
|
|
143
|
+
chai_1.assert.include(result.stderr, 'javascript error: No elements found for include in page Context');
|
|
144
|
+
chai_1.assert.equal(result.exitCode, 1);
|
|
145
|
+
}));
|
|
146
|
+
it('should throw error if invalid selector is provided', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
147
|
+
const result = yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`, '--include', '#123', '--show-errors');
|
|
148
|
+
chai_1.assert.include(result.stderr, 'is not a valid selector');
|
|
149
|
+
chai_1.assert.equal(result.exitCode, 1);
|
|
150
|
+
}));
|
|
151
|
+
});
|
|
152
|
+
describe('--exclude', () => {
|
|
153
|
+
it('should set a list of elements to exclude', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
154
|
+
const result = yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`, '--exclude', 'marquee');
|
|
155
|
+
chai_1.assert.notInclude(result.stdout, 'Violation of "marquee" with 1 occurrences!');
|
|
156
|
+
}));
|
|
157
|
+
it('should throw error if invalid selector is provided', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
158
|
+
const result = yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`, '--exclude', '#123', '--show-errors');
|
|
159
|
+
chai_1.assert.include(result.stderr, 'is not a valid selector');
|
|
160
|
+
chai_1.assert.equal(result.exitCode, 1);
|
|
161
|
+
}));
|
|
162
|
+
});
|
|
163
|
+
describe('--disable', () => {
|
|
164
|
+
it('should not run rules with the provided IDs', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
165
|
+
const result = yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`, '--disable', 'region');
|
|
166
|
+
chai_1.assert.notInclude(result.stdout, 'Violation of "region" with');
|
|
167
|
+
}));
|
|
168
|
+
});
|
|
169
|
+
describe('--stdout', () => {
|
|
170
|
+
it('should only emit JSON to stdout', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
171
|
+
const result = yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`, '--stdout');
|
|
172
|
+
chai_1.assert.equal(result.exitCode, 0);
|
|
173
|
+
chai_1.assert.doesNotThrow(() => JSON.parse(result.stdout), 'Emitted invalid JSON');
|
|
174
|
+
}));
|
|
175
|
+
});
|
|
176
|
+
describe('--timer', () => {
|
|
177
|
+
it('should log the time it takes to run', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
178
|
+
const result = yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`, '--timer');
|
|
179
|
+
chai_1.assert.equal(result.exitCode, 0);
|
|
180
|
+
chai_1.assert.isEmpty(result.stderr);
|
|
181
|
+
chai_1.assert.include(result.stdout, 'axe-core execution time');
|
|
182
|
+
chai_1.assert.include(result.stdout, 'Total test time');
|
|
183
|
+
}));
|
|
184
|
+
});
|
|
185
|
+
describe('--no-reporter', () => {
|
|
186
|
+
it('should log the time it takes to run', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
187
|
+
const result = yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`, '--no-reporter');
|
|
188
|
+
chai_1.assert.equal(result.exitCode, 0);
|
|
189
|
+
chai_1.assert.notInclude(result.stdout, 'Violation of "marquee" with 1 occurrences!');
|
|
190
|
+
}));
|
|
191
|
+
});
|
|
192
|
+
describe('--show-errors', () => {
|
|
193
|
+
it('should log the time it takes to run defaults to show errors', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
194
|
+
const result = yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`, '--include', '#hazaar');
|
|
195
|
+
chai_1.assert.equal(result.exitCode, 1);
|
|
196
|
+
chai_1.assert.include(result.stderr, 'Error: JavascriptError: javascript error:');
|
|
197
|
+
}));
|
|
198
|
+
it('do not show errors when passed false', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
199
|
+
const result = yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`, '--include', '#hazaar', '--show-errors', 'false');
|
|
200
|
+
chai_1.assert.equal(result.exitCode, 1);
|
|
201
|
+
chai_1.assert.include(result.stderr, 'An error occurred while testing this page.');
|
|
202
|
+
}));
|
|
203
|
+
});
|
|
204
|
+
describe('--save', () => {
|
|
205
|
+
let reportDir;
|
|
206
|
+
beforeEach(() => {
|
|
207
|
+
reportDir = tempy_1.default.directory();
|
|
208
|
+
});
|
|
209
|
+
it('should save the output as a JSON file', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
210
|
+
const result = yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`, '--save', 'test-name.json', '--dir', reportDir);
|
|
211
|
+
const [report] = fs_1.default.readdirSync(reportDir);
|
|
212
|
+
chai_1.assert.equal(result.exitCode, 0);
|
|
213
|
+
chai_1.assert.equal(report, 'test-name.json');
|
|
214
|
+
}));
|
|
215
|
+
});
|
|
216
|
+
describe('--load-delay', () => {
|
|
217
|
+
it('should set how much time axe will wait after a page loads before running the audit', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
218
|
+
const result = yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`, '--load-delay', '1000');
|
|
219
|
+
chai_1.assert.equal(result.exitCode, 0);
|
|
220
|
+
chai_1.assert.include(result.stdout, 'Waiting for 1000 milliseconds after page load');
|
|
221
|
+
}));
|
|
222
|
+
});
|
|
223
|
+
describe('--verbose', () => {
|
|
224
|
+
it('should output metadata such as test tool name, version and environment', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
225
|
+
const result = yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`, '--verbose');
|
|
226
|
+
chai_1.assert.equal(result.exitCode, 0);
|
|
227
|
+
chai_1.assert.include(result.stdout, 'Test Runner');
|
|
228
|
+
chai_1.assert.include(result.stdout, 'Test Engine');
|
|
229
|
+
chai_1.assert.include(result.stdout, 'Test Environment');
|
|
230
|
+
}));
|
|
231
|
+
});
|
|
232
|
+
describe('--timeout', () => {
|
|
233
|
+
// Timeout the page immediately. Ideally we'd block the page for awhile, then timeout based on that. This seemed easier for now tho.
|
|
234
|
+
it('should set the page load timeout', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
235
|
+
try {
|
|
236
|
+
yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`, '--timeout', '0');
|
|
237
|
+
}
|
|
238
|
+
catch (error) {
|
|
239
|
+
chai_1.assert.notEqual(error.exitCode, 0);
|
|
240
|
+
chai_1.assert.include(error.stderr, 'An error occurred while testing this page.');
|
|
241
|
+
}
|
|
242
|
+
}));
|
|
243
|
+
});
|
|
244
|
+
// disabled during conversion to npm workspaces as the node_module install directory changed
|
|
245
|
+
// @see https://github.com/dequelabs/axe-core-npm/issues/822
|
|
246
|
+
describe.skip('--chromedriver-path', () => {
|
|
247
|
+
it('should throw error if path does not exist', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
248
|
+
const result = yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`, '--chromedriver-path="someinvalidpath"', '--show-errors');
|
|
249
|
+
chai_1.assert.include(result.stderr, 'The specified executable path does not exist');
|
|
250
|
+
}));
|
|
251
|
+
});
|
|
252
|
+
describe('--chrome-path', () => {
|
|
253
|
+
it('should throw error if path does not exist', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
254
|
+
const result = yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`, '--chrome-path="someinvalidpath"', '--show-errors');
|
|
255
|
+
chai_1.assert.include(result.stderr, 'no chrome binary at');
|
|
256
|
+
}));
|
|
257
|
+
});
|
|
258
|
+
});
|
|
259
|
+
//# sourceMappingURL=cli.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.test.js","sourceRoot":"","sources":["../../../src/bin/cli.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,iBAAe;AACf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C;YACF,aAAM,CAAC,OAAO,CACZ,MAAM,CAAC,MAAM,EACb,8CAA8C,CAC/C,CAAC;QACJ,CAAC,CAAA,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;QAC7B,EAAE,CAAC,2CAA2C,EAAE,GAAS,EAAE;YACzD,MAAM,MAAM,GAAG,MAAM,IAAA,mBAAM,EACzB,UAAU,gBAAgB,EAAE,EAC5B,iCAAiC,EACjC,eAAe,CAChB,CAAC;YACF,aAAM,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;QACvD,CAAC,CAAA,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const colors_1 = __importDefault(require("colors"));
|
|
16
|
+
const utils_1 = require("../lib/utils");
|
|
17
|
+
const axe_test_urls_1 = __importDefault(require("../lib/axe-test-urls"));
|
|
18
|
+
const events_1 = __importDefault(require("../lib/events"));
|
|
19
|
+
const webdriver_1 = require("../lib/webdriver");
|
|
20
|
+
const selenium_webdriver_1 = require("selenium-webdriver");
|
|
21
|
+
const cli = (args, url) => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
+
const { save, stdout, dir, exit, timer, reporter: noReporter, chromeOptions, verbose, timeout, include, exclude, tags, rules, disable, loadDelay, chromedriverPath, chromePath } = args;
|
|
23
|
+
const showErrors = args.showErrors === true;
|
|
24
|
+
const silentMode = !!stdout;
|
|
25
|
+
args.axeSource = (0, utils_1.getAxeSource)(args.axeSource);
|
|
26
|
+
if (!args.axeSource) {
|
|
27
|
+
console.error((0, utils_1.error)('Unable to find the axe-core source file'));
|
|
28
|
+
process.exit(2);
|
|
29
|
+
}
|
|
30
|
+
args.browser = (0, utils_1.parseBrowser)(args.browser);
|
|
31
|
+
/* istanbul ignore if */
|
|
32
|
+
if (chromeOptions) {
|
|
33
|
+
/* istanbul ignore if */
|
|
34
|
+
if (args.browser !== 'chrome-headless') {
|
|
35
|
+
console.error((0, utils_1.error)('You may only provide --chrome-options when using headless chrome'));
|
|
36
|
+
process.exit(2);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
const driverConfigs = {
|
|
40
|
+
browser: args.browser,
|
|
41
|
+
timeout,
|
|
42
|
+
chromeOptions,
|
|
43
|
+
chromedriverPath,
|
|
44
|
+
chromePath
|
|
45
|
+
};
|
|
46
|
+
args.driver = (0, webdriver_1.startDriver)(driverConfigs);
|
|
47
|
+
const cliReporter = (0, utils_1.reporter)(noReporter, silentMode);
|
|
48
|
+
const axeVersion = (0, utils_1.getAxeVersion)(args.axeSource);
|
|
49
|
+
if (!silentMode) {
|
|
50
|
+
console.log(colors_1.default.bold('Running axe-core ' + axeVersion + ' in ' + args.browser));
|
|
51
|
+
}
|
|
52
|
+
const urls = url.args.map(utils_1.parseUrl);
|
|
53
|
+
/* istanbul ignore if */
|
|
54
|
+
if (urls.length === 0) {
|
|
55
|
+
console.error((0, utils_1.error)('No url was specified. Check `axe --help` for help\n'));
|
|
56
|
+
}
|
|
57
|
+
const events = (0, events_1.default)({
|
|
58
|
+
silentMode,
|
|
59
|
+
timer,
|
|
60
|
+
cliReporter,
|
|
61
|
+
verbose,
|
|
62
|
+
exit
|
|
63
|
+
});
|
|
64
|
+
const testPageConfigParams = {
|
|
65
|
+
driver: args.driver,
|
|
66
|
+
timer,
|
|
67
|
+
loadDelay,
|
|
68
|
+
axeSource: args.axeSource,
|
|
69
|
+
include,
|
|
70
|
+
exclude,
|
|
71
|
+
tags,
|
|
72
|
+
rules,
|
|
73
|
+
disable
|
|
74
|
+
};
|
|
75
|
+
let outcome;
|
|
76
|
+
try {
|
|
77
|
+
try {
|
|
78
|
+
outcome = yield (0, axe_test_urls_1.default)(urls, testPageConfigParams, events);
|
|
79
|
+
}
|
|
80
|
+
catch (e) {
|
|
81
|
+
if (e instanceof selenium_webdriver_1.error.ScriptTimeoutError) {
|
|
82
|
+
console.error((0, utils_1.error)('Error: %s'), e.message);
|
|
83
|
+
console.log(`The timeout is currently configured to be ${timeout} seconds (you can change it with --timeout).`);
|
|
84
|
+
process.exit(2);
|
|
85
|
+
}
|
|
86
|
+
// Provide a more user-friendly error message when there's a ChromeDriver/Chrome version mismatch.
|
|
87
|
+
else if (e instanceof selenium_webdriver_1.error.SessionNotCreatedError &&
|
|
88
|
+
e.message.includes('This version of ChromeDriver only supports'
|
|
89
|
+
// This string has to match the error message printed by chromedriver, see
|
|
90
|
+
// https://chromium.googlesource.com/chromium/src/+/refs/tags/110.0.5481.194/chrome/test/chromedriver/chrome_launcher.cc#300.
|
|
91
|
+
)) {
|
|
92
|
+
console.error((0, utils_1.error)('Error: %s'), e.message);
|
|
93
|
+
console.log(`\nPlease install a matching version of ChromeDriver and run axe with the --chromedriver-path option:
|
|
94
|
+
|
|
95
|
+
$ npm install -g chromedriver@<version>
|
|
96
|
+
$ axe --chromedriver-path $(npm root -g)/chromedriver/bin/chromedriver <url...>
|
|
97
|
+
|
|
98
|
+
(where <version> is the first number of the "current browser version" reported above.)`);
|
|
99
|
+
process.exit(2);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
throw e;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
if (silentMode) {
|
|
106
|
+
process.stdout.write(JSON.stringify(outcome, null, 2));
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
if (timer) {
|
|
110
|
+
console.timeEnd('Total test time');
|
|
111
|
+
}
|
|
112
|
+
/* istanbul ignore if */
|
|
113
|
+
if (Array.isArray(outcome)) {
|
|
114
|
+
console.log((0, utils_1.bold)('Testing complete of %d pages\n'), outcome.length);
|
|
115
|
+
}
|
|
116
|
+
if (save || dir) {
|
|
117
|
+
try {
|
|
118
|
+
const fileName = (0, utils_1.saveOutcome)(outcome, save, dir);
|
|
119
|
+
console.log('Saved file at', fileName, '\n');
|
|
120
|
+
}
|
|
121
|
+
catch (e) {
|
|
122
|
+
/* istanbul ignore next */
|
|
123
|
+
console.error((0, utils_1.error)('Unable to save file!\n') + e);
|
|
124
|
+
process.exit(1);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
if (exit) {
|
|
128
|
+
let exitErr = false;
|
|
129
|
+
/* istanbul ignore if */
|
|
130
|
+
if (Array.isArray(outcome)) {
|
|
131
|
+
for (const res of outcome) {
|
|
132
|
+
if (res.violations.length > 0) {
|
|
133
|
+
exitErr = true;
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
exitErr = outcome.violations.length > 0;
|
|
140
|
+
}
|
|
141
|
+
if (exitErr) {
|
|
142
|
+
process.exit(1);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
/* istanbul ignore if */
|
|
146
|
+
if (silentMode) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
console.log((0, utils_1.italics)('Please note that only 20% to 50% of all accessibility ' +
|
|
150
|
+
'issues can automatically be detected. \nManual testing is ' +
|
|
151
|
+
'always required. For more information see:\n%s\n'), (0, utils_1.link)('https://dequeuniversity.com/curriculum/courses/testingmethods'));
|
|
152
|
+
}
|
|
153
|
+
catch (e) {
|
|
154
|
+
/* istanbul ignore else */
|
|
155
|
+
if (!showErrors) {
|
|
156
|
+
console.error((0, utils_1.error)('An error occurred while testing this page.'));
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
console.error((0, utils_1.error)('Error: %s'), e);
|
|
160
|
+
}
|
|
161
|
+
console.error('Please report the problem to: ' +
|
|
162
|
+
(0, utils_1.link)('https://github.com/dequelabs/axe-core-npm/issues/') +
|
|
163
|
+
'\n');
|
|
164
|
+
process.exit(1);
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
exports.default = cli;
|
|
168
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/bin/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,oDAA4B;AAC5B,wCAWsB;AACtB,yEAA+C;AAC/C,2DAAkC;AAClC,gDAA+C;AAC/C,2DAA6D;AAE7D,MAAM,GAAG,GAAG,CACV,IAAkB,EAClB,GAAuB,EACR,EAAE;IACjB,MAAM,EACJ,IAAI,EACJ,MAAM,EACN,GAAG,EACH,IAAI,EACJ,KAAK,EACL,QAAQ,EAAE,UAAU,EACpB,aAAa,EACb,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,IAAI,EACJ,KAAK,EACL,OAAO,EACP,SAAS,EACT,gBAAgB,EAChB,UAAU,EACX,GAAG,IAAI,CAAC;IAET,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,KAAK,IAAI,CAAC;IAE5C,MAAM,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5B,IAAI,CAAC,SAAS,GAAG,IAAA,oBAAY,EAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAE9C,IAAI,CA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