@axe-core/cli 4.7.4-alpha.408 → 4.7.4-bbfaae4.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/package.json +12 -11
- package/.eslintrc.js +0 -18
- package/CHANGELOG.md +0 -235
- package/dist/package.json +0 -91
- package/dist/src/bin/cli.d.ts +0 -2
- package/dist/src/bin/cli.js +0 -39
- package/dist/src/bin/cli.js.map +0 -1
- package/dist/src/bin/cli.test.d.ts +0 -1
- package/dist/src/bin/cli.test.js +0 -251
- package/dist/src/bin/cli.test.js.map +0 -1
- package/dist/src/bin/index.d.ts +0 -5
- package/dist/src/bin/index.js +0 -138
- package/dist/src/bin/index.js.map +0 -1
- package/dist/src/lib/axe-test-urls.d.ts +0 -4
- package/dist/src/lib/axe-test-urls.js +0 -89
- package/dist/src/lib/axe-test-urls.js.map +0 -1
- package/dist/src/lib/axe-test-urls.test.d.ts +0 -1
- package/dist/src/lib/axe-test-urls.test.js +0 -73
- package/dist/src/lib/axe-test-urls.test.js.map +0 -1
- package/dist/src/lib/events.d.ts +0 -10
- package/dist/src/lib/events.js +0 -54
- package/dist/src/lib/events.js.map +0 -1
- package/dist/src/lib/events.test.d.ts +0 -1
- package/dist/src/lib/events.test.js +0 -31
- package/dist/src/lib/events.test.js.map +0 -1
- package/dist/src/lib/index.d.ts +0 -4
- package/dist/src/lib/index.js +0 -36
- package/dist/src/lib/index.js.map +0 -1
- package/dist/src/lib/utils.d.ts +0 -15
- package/dist/src/lib/utils.js +0 -120
- package/dist/src/lib/utils.js.map +0 -1
- package/dist/src/lib/utils.test.d.ts +0 -1
- package/dist/src/lib/utils.test.js +0 -140
- package/dist/src/lib/utils.test.js.map +0 -1
- package/dist/src/lib/webdriver.d.ts +0 -4
- package/dist/src/lib/webdriver.js +0 -46
- package/dist/src/lib/webdriver.js.map +0 -1
- package/dist/src/lib/webdriver.test.d.ts +0 -1
- package/dist/src/lib/webdriver.test.js +0 -102
- package/dist/src/lib/webdriver.test.js.map +0 -1
- package/dist/src/testutils/index.d.ts +0 -19
- package/dist/src/testutils/index.js +0 -51
- package/dist/src/testutils/index.js.map +0 -1
- package/dist/src/types.d.ts +0 -36
- package/dist/src/types.js +0 -18
- package/dist/src/types.js.map +0 -1
- package/src/bin/cli.test.ts +0 -407
- package/src/bin/cli.ts +0 -82
- package/src/bin/index.ts +0 -184
- 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/index.ts +0 -5
- package/src/lib/utils.test.ts +0 -130
- package/src/lib/utils.ts +0 -143
- package/src/lib/webdriver.test.ts +0 -104
- package/src/lib/webdriver.ts +0 -38
- package/src/testutils/axe-core@2.5.0.js +0 -18941
- 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 -41
- package/tsconfig.json +0 -19
package/dist/src/bin/cli.test.js
DELETED
|
@@ -1,251 +0,0 @@
|
|
|
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
|
-
describe('--chromedriver-path', () => {
|
|
245
|
-
it('should throw error if path does not exist', () => __awaiter(void 0, void 0, void 0, function* () {
|
|
246
|
-
const result = yield (0, testutils_1.default)(`file://${SIMPLE_HTML_FILE}`, '--chromedriver-path="someinvalidpath"', '--show-errors');
|
|
247
|
-
chai_1.assert.include(result.stderr, 'The specified executable path does not exist');
|
|
248
|
-
}));
|
|
249
|
-
});
|
|
250
|
-
});
|
|
251
|
-
//# sourceMappingURL=cli.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.test.js","sourceRoot":"","sources":["../../../src/bin/cli.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,iBAAe;AACf,+BAA8B;AAC9B,kDAA0B;AAC1B,gDAAwB;AAExB,gDAAwB;AACxB,4CAAoB;AACpB,qDAA6C;AAC7C,8DAAmC;AAEnC,MAAM,gBAAgB,GAAG,cAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;AAChF,MAAM,sBAAsB,GAAG,cAAI,CAAC,IAAI,CACtC,SAAS,EACT,IAAI,EACJ,WAAW,EACX,mBAAmB,CACpB,CAAC;AACF,MAAM,kBAAkB,GAAG,YAAE,CAAC,YAAY,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAC;AACrE,MAAM,eAAe,GAAG,cAAI,CAAC,OAAO,CAClC,SAAS,EACT,IAAI,EACJ,WAAW,EACX,mBAAmB,CACpB,CAAC;AAEF,QAAQ,CAAC,KAAK,EAAE,GAAG,EAAE;IACnB,EAAE,CAAC,QAAQ,EAAE,GAAS,EAAE;QACtB,MAAM,MAAM,GAAG,MAAM,IAAA,mBAAM,EAAC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AkC,EAAE,GAAS,EAAE;YAChD,IAAI;gBACF,MAAM,IAAA,mBAAM,EAAC,UAAU,gBAAgB,EAAE,EAAE,WAAW,EAAE,GAAG,CAAC,CAAC;aAC9D;YAAC,OAAO,KAAK,EAAE;gBACd,aAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;gBACnC,aAAM,CAAC,OAAO,CACZ,KAAK,CAAC,MAAM,EACZ,4CAA4C,CAC7C,CAAC;aACH;QACH,CAAC,CAAA,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;QACnC,EAAE,CAAC,2CAA2C,EAAE,GAAS,EAAE;YACzD,MAAM,MAAM,GAAG,MAAM,IAAA,mBAAM,EACzB,UAAU,gBAAgB,EAAE,EAC5B,uCAAuC,EACvC,eAAe,CAChB,CAAC;YACF,aAAM,CAAC,OAAO,CACZ,MAAM,CAAC,MAAM,EACb,8CAA8C,CAC/C,CAAC;QACJ,CAAC,CAAA,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/src/bin/index.d.ts
DELETED
package/dist/src/bin/index.js
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
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 cli = (args, url) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
-
const { save, stdout, dir, exit, timer, reporter: noReporter, chromeOptions, verbose, timeout, include, exclude, tags, rules, disable, loadDelay, chromedriverPath } = args;
|
|
22
|
-
const showErrors = args.showErrors === true;
|
|
23
|
-
const silentMode = !!stdout;
|
|
24
|
-
args.axeSource = (0, utils_1.getAxeSource)(args.axeSource);
|
|
25
|
-
if (!args.axeSource) {
|
|
26
|
-
console.error((0, utils_1.error)('Unable to find the axe-core source file'));
|
|
27
|
-
process.exit(2);
|
|
28
|
-
}
|
|
29
|
-
args.browser = (0, utils_1.parseBrowser)(args.browser);
|
|
30
|
-
/* istanbul ignore if */
|
|
31
|
-
if (chromeOptions) {
|
|
32
|
-
/* istanbul ignore if */
|
|
33
|
-
if (args.browser !== 'chrome-headless') {
|
|
34
|
-
console.error((0, utils_1.error)('You may only provide --chrome-options when using headless chrome'));
|
|
35
|
-
process.exit(2);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
const driverConfigs = {
|
|
39
|
-
browser: args.browser,
|
|
40
|
-
timeout,
|
|
41
|
-
chromeOptions,
|
|
42
|
-
chromedriverPath
|
|
43
|
-
};
|
|
44
|
-
args.driver = (0, webdriver_1.startDriver)(driverConfigs);
|
|
45
|
-
const cliReporter = (0, utils_1.reporter)(noReporter, silentMode);
|
|
46
|
-
const axeVersion = (0, utils_1.getAxeVersion)(args.axeSource);
|
|
47
|
-
if (!silentMode) {
|
|
48
|
-
console.log(colors_1.default.bold('Running axe-core ' + axeVersion + ' in ' + args.browser));
|
|
49
|
-
}
|
|
50
|
-
const urls = url.args.map(utils_1.parseUrl);
|
|
51
|
-
/* istanbul ignore if */
|
|
52
|
-
if (urls.length === 0) {
|
|
53
|
-
console.error((0, utils_1.error)('No url was specified. Check `axe --help` for help\n'));
|
|
54
|
-
}
|
|
55
|
-
const events = (0, events_1.default)({
|
|
56
|
-
silentMode,
|
|
57
|
-
timer,
|
|
58
|
-
cliReporter,
|
|
59
|
-
verbose,
|
|
60
|
-
exit
|
|
61
|
-
});
|
|
62
|
-
const testPageConfigParams = {
|
|
63
|
-
driver: args.driver,
|
|
64
|
-
timer,
|
|
65
|
-
loadDelay,
|
|
66
|
-
axeSource: args.axeSource,
|
|
67
|
-
include,
|
|
68
|
-
exclude,
|
|
69
|
-
tags,
|
|
70
|
-
rules,
|
|
71
|
-
disable
|
|
72
|
-
};
|
|
73
|
-
try {
|
|
74
|
-
const outcome = yield (0, axe_test_urls_1.default)(urls, testPageConfigParams, events);
|
|
75
|
-
if (silentMode) {
|
|
76
|
-
process.stdout.write(JSON.stringify(outcome, null, 2));
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
if (timer) {
|
|
80
|
-
console.timeEnd('Total test time');
|
|
81
|
-
}
|
|
82
|
-
/* istanbul ignore if */
|
|
83
|
-
if (Array.isArray(outcome)) {
|
|
84
|
-
console.log((0, utils_1.bold)('Testing complete of %d pages\n'), outcome.length);
|
|
85
|
-
}
|
|
86
|
-
if (save || dir) {
|
|
87
|
-
try {
|
|
88
|
-
const fileName = (0, utils_1.saveOutcome)(outcome, save, dir);
|
|
89
|
-
console.log('Saved file at', fileName, '\n');
|
|
90
|
-
}
|
|
91
|
-
catch (e) {
|
|
92
|
-
/* istanbul ignore next */
|
|
93
|
-
console.error((0, utils_1.error)('Unable to save file!\n') + e);
|
|
94
|
-
process.exit(1);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
if (exit) {
|
|
98
|
-
let exitErr = false;
|
|
99
|
-
/* istanbul ignore if */
|
|
100
|
-
if (Array.isArray(outcome)) {
|
|
101
|
-
for (const res of outcome) {
|
|
102
|
-
if (res.violations.length > 0) {
|
|
103
|
-
exitErr = true;
|
|
104
|
-
break;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
exitErr = outcome.violations.length > 0;
|
|
110
|
-
}
|
|
111
|
-
if (exitErr) {
|
|
112
|
-
process.exit(1);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
/* istanbul ignore if */
|
|
116
|
-
if (silentMode) {
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
console.log((0, utils_1.italics)('Please note that only 20% to 50% of all accessibility ' +
|
|
120
|
-
'issues can automatically be detected. \nManual testing is ' +
|
|
121
|
-
'always required. For more information see:\n%s\n'), (0, utils_1.link)('https://dequeuniversity.com/curriculum/courses/testingmethods'));
|
|
122
|
-
}
|
|
123
|
-
catch (e) {
|
|
124
|
-
/* istanbul ignore else */
|
|
125
|
-
if (!showErrors) {
|
|
126
|
-
console.error((0, utils_1.error)('An error occurred while testing this page.'));
|
|
127
|
-
}
|
|
128
|
-
else {
|
|
129
|
-
console.error((0, utils_1.error)('Error: %s'), e);
|
|
130
|
-
}
|
|
131
|
-
console.error('Please report the problem to: ' +
|
|
132
|
-
(0, utils_1.link)('https://github.com/dequelabs/axe-core-npm/issues/') +
|
|
133
|
-
'\n');
|
|
134
|
-
process.exit(1);
|
|
135
|
-
}
|
|
136
|
-
});
|
|
137
|
-
exports.default = cli;
|
|
138
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/bin/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,oDAA4B;AAC5B,wCAWsB;AACtB,yEAA+C;AAC/C,2DAA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AAC;SACpE;aAAM;YACL,OAAO,CAAC,KAAK,CAAC,IAAA,aAAK,EAAC,WAAW,CAAC,EAAE,CAAC,CAAC,CAAC;SACtC;QAED,OAAO,CAAC,KAAK,CACX,gCAAgC;YAC9B,IAAA,YAAI,EAAC,mDAAmD,CAAC;YACzD,IAAI,CACP,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;KACjB;AACH,CAAC,CAAA,CAAC;AAEF,kBAAe,GAAG,CAAC"}
|
|
@@ -1,89 +0,0 @@
|
|
|
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 webdriverjs_1 = __importDefault(require("@axe-core/webdriverjs"));
|
|
16
|
-
const testPages = (urls, config, events) => __awaiter(void 0, void 0, void 0, function* () {
|
|
17
|
-
const driver = yield config.driver;
|
|
18
|
-
if (urls.length === 0) {
|
|
19
|
-
yield driver.quit();
|
|
20
|
-
return Promise.resolve([]);
|
|
21
|
-
}
|
|
22
|
-
return new Promise((resolve, reject) => {
|
|
23
|
-
const currentUrl = urls[0].replace(/[,;]$/, '');
|
|
24
|
-
if (events === null || events === void 0 ? void 0 : events.onTestStart) {
|
|
25
|
-
events === null || events === void 0 ? void 0 : events.onTestStart(currentUrl);
|
|
26
|
-
}
|
|
27
|
-
if (config.timer) {
|
|
28
|
-
events === null || events === void 0 ? void 0 : events.startTimer('axe page load time');
|
|
29
|
-
}
|
|
30
|
-
driver
|
|
31
|
-
.get(currentUrl)
|
|
32
|
-
.then(() => {
|
|
33
|
-
if (config.timer) {
|
|
34
|
-
events === null || events === void 0 ? void 0 : events.endTimer('axe page load time');
|
|
35
|
-
}
|
|
36
|
-
if (config.loadDelay) {
|
|
37
|
-
events === null || events === void 0 ? void 0 : events.waitingMessage(config.loadDelay);
|
|
38
|
-
}
|
|
39
|
-
return new Promise(resolve => {
|
|
40
|
-
setTimeout(resolve, config.loadDelay);
|
|
41
|
-
});
|
|
42
|
-
})
|
|
43
|
-
.then(() => {
|
|
44
|
-
const axe = new webdriverjs_1.default(driver, config.axeSource);
|
|
45
|
-
if (Array.isArray(config.include)) {
|
|
46
|
-
config.include.forEach((include) => axe.include(include));
|
|
47
|
-
}
|
|
48
|
-
if (Array.isArray(config.exclude)) {
|
|
49
|
-
config.exclude.forEach((exclude) => axe.exclude(exclude));
|
|
50
|
-
}
|
|
51
|
-
if (config.tags) {
|
|
52
|
-
axe.withTags(config.tags);
|
|
53
|
-
}
|
|
54
|
-
else if (config.rules) {
|
|
55
|
-
axe.withRules(config.rules);
|
|
56
|
-
}
|
|
57
|
-
/* istanbul ignore if */
|
|
58
|
-
if (config.disable) {
|
|
59
|
-
axe.disableRules(config.disable);
|
|
60
|
-
}
|
|
61
|
-
if (config.timer) {
|
|
62
|
-
events === null || events === void 0 ? void 0 : events.startTimer('axe-core execution time');
|
|
63
|
-
}
|
|
64
|
-
axe.analyze((err, results) => {
|
|
65
|
-
if (config.timer) {
|
|
66
|
-
events === null || events === void 0 ? void 0 : events.endTimer('axe-core execution time');
|
|
67
|
-
}
|
|
68
|
-
/* istanbul ignore if */
|
|
69
|
-
if (err) {
|
|
70
|
-
return reject(err);
|
|
71
|
-
}
|
|
72
|
-
// Notify about the update
|
|
73
|
-
if (events === null || events === void 0 ? void 0 : events.onTestComplete) {
|
|
74
|
-
events === null || events === void 0 ? void 0 : events.onTestComplete(results);
|
|
75
|
-
}
|
|
76
|
-
// Move to the next item
|
|
77
|
-
testPages(urls.slice(1), config, events).then((out) => {
|
|
78
|
-
resolve([results].concat(out));
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
})
|
|
82
|
-
.catch((e) => __awaiter(void 0, void 0, void 0, function* () {
|
|
83
|
-
yield driver.quit();
|
|
84
|
-
reject(e);
|
|
85
|
-
}));
|
|
86
|
-
});
|
|
87
|
-
});
|
|
88
|
-
exports.default = testPages;
|
|
89
|
-
//# sourceMappingURL=axe-test-urls.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"axe-test-urls.js","sourceRoot":"","sources":["../../../src/lib/axe-test-urls.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,wEAA+C;AAI/C,MAAM,SAAS,GAAG,CAChB,IAAuB,EACvB,MAAoB,EACpB,MAAsB,EACc,EAAE;IACtC,MAAM,MAAM,GAAwB,MAAM,MAAM,CAAC,MAAM,CAAC;IAExD,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE;QACrB,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;KAC5B;IAED,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,UAAU,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;QAEhD,IAAI,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,EAAE;YACvB,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,CAAC,UAAU,CAAC,CAAC;SACjC;QAED,IAAI,MAAM,CAAC,K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1 +0,0 @@
|
|
|
1
|
-
import 'mocha';
|
|
@@ -1,73 +0,0 @@
|
|
|
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 axe_test_urls_1 = __importDefault(require("./axe-test-urls"));
|
|
18
|
-
describe('testPages', function () {
|
|
19
|
-
this.timeout(10000);
|
|
20
|
-
let config;
|
|
21
|
-
let mockDriver;
|
|
22
|
-
beforeEach(() => {
|
|
23
|
-
const func = (arg) => __awaiter(this, void 0, void 0, function* () { return '{}'; });
|
|
24
|
-
mockDriver = {
|
|
25
|
-
get: func,
|
|
26
|
-
executeAsyncScript: func,
|
|
27
|
-
executeScript: func,
|
|
28
|
-
wait: func,
|
|
29
|
-
switchTo: () => ({ defaultContent: () => { } }),
|
|
30
|
-
findElements: () => __awaiter(this, void 0, void 0, function* () { return []; }),
|
|
31
|
-
quit: func,
|
|
32
|
-
manage: () => ({
|
|
33
|
-
setTimeouts: func
|
|
34
|
-
})
|
|
35
|
-
};
|
|
36
|
-
config = { driver: mockDriver };
|
|
37
|
-
});
|
|
38
|
-
it('return a promise', () => {
|
|
39
|
-
chai_1.assert.instanceOf((0, axe_test_urls_1.default)([], config), Promise);
|
|
40
|
-
});
|
|
41
|
-
it('calls driver.get() for each URL', () => __awaiter(this, void 0, void 0, function* () {
|
|
42
|
-
const urlsCalled = [];
|
|
43
|
-
const urls = ['http://foo', 'http://bar', 'http://baz'];
|
|
44
|
-
mockDriver.get = (url) => __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
urlsCalled.push(url);
|
|
46
|
-
return url;
|
|
47
|
-
});
|
|
48
|
-
yield (0, axe_test_urls_1.default)(urls, config);
|
|
49
|
-
chai_1.assert.deepEqual(urlsCalled, urls);
|
|
50
|
-
}));
|
|
51
|
-
it('injects axe into the page', () => __awaiter(this, void 0, void 0, function* () {
|
|
52
|
-
const scripts = [];
|
|
53
|
-
config.axeSource = 'axe="hi, I am axe"';
|
|
54
|
-
mockDriver.executeScript = (script) => __awaiter(this, void 0, void 0, function* () {
|
|
55
|
-
scripts.push(script);
|
|
56
|
-
return script;
|
|
57
|
-
});
|
|
58
|
-
yield (0, axe_test_urls_1.default)(['http://foo'], config);
|
|
59
|
-
chai_1.assert.include(scripts[0].toString(), config.axeSource);
|
|
60
|
-
}));
|
|
61
|
-
it('runs axe once the page is loaded', () => __awaiter(this, void 0, void 0, function* () {
|
|
62
|
-
const asyncScripts = [];
|
|
63
|
-
mockDriver.executeAsyncScript = (script) => __awaiter(this, void 0, void 0, function* () {
|
|
64
|
-
asyncScripts.push(script);
|
|
65
|
-
return '{}';
|
|
66
|
-
});
|
|
67
|
-
yield (0, axe_test_urls_1.default)(['http://foo'], config);
|
|
68
|
-
chai_1.assert.isDefined(asyncScripts
|
|
69
|
-
.map(script => script.toString())
|
|
70
|
-
.find(script => script.match(/(axe\.run)|(axe\.a11yCheck)/)));
|
|
71
|
-
}));
|
|
72
|
-
});
|
|
73
|
-
//# sourceMappingURL=axe-test-urls.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,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CAAC;IACJ,CAAC,CAAA,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/src/lib/events.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { AxeResults } from 'axe-core';
|
|
2
|
-
import type { EventParams } from '../types';
|
|
3
|
-
declare const _default: ({ silentMode, timer, cliReporter, verbose }: EventParams) => {
|
|
4
|
-
startTimer: (message: string) => void;
|
|
5
|
-
endTimer: (message: string) => void;
|
|
6
|
-
waitingMessage: (loadDelayTime: number) => void;
|
|
7
|
-
onTestStart: (url: string) => void;
|
|
8
|
-
onTestComplete: (results: AxeResults) => void;
|
|
9
|
-
};
|
|
10
|
-
export default _default;
|