@axe-core/watcher 0.0.1-next.4c1b6e82 → 0.0.1-next.4e9657cb
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/Controller.d.ts +9 -0
- package/dist/Controller.js +137 -0
- package/dist/Controller.js.map +1 -0
- package/dist/cypress.d.ts +8 -0
- package/dist/cypress.js +60 -0
- package/dist/cypress.js.map +1 -0
- package/dist/cypressCommands.d.ts +15 -0
- package/dist/cypressCommands.js +43 -0
- package/dist/cypressCommands.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/playwright.d.ts +2 -1
- package/dist/playwright.js +5 -1
- package/dist/playwright.js.map +1 -1
- package/dist/puppeteer.d.ts +2 -1
- package/dist/puppeteer.js +5 -1
- package/dist/puppeteer.js.map +1 -1
- package/dist/util.d.ts +5 -7
- package/dist/util.js +10 -129
- package/dist/util.js.map +1 -1
- package/dist/wdio.d.ts +2 -1
- package/dist/wdio.js +5 -1
- package/dist/wdio.js.map +1 -1
- package/dist/webdriver.d.ts +2 -1
- package/dist/webdriver.js +5 -1
- package/dist/webdriver.js.map +1 -1
- package/extension/content.js +1 -1
- package/extension/worker.js +1 -1
- package/package.json +16 -33
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
declare abstract class Controller {
|
|
2
|
+
protected abstract executeScript(fn: string | (() => Promise<void>)): Promise<void>;
|
|
3
|
+
start(): Promise<void>;
|
|
4
|
+
stop(): Promise<void>;
|
|
5
|
+
analyze(): Promise<void>;
|
|
6
|
+
/** Flush all axe-core results by sending them to the server. */
|
|
7
|
+
flush(): Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
export default Controller;
|
|
@@ -0,0 +1,137 @@
|
|
|
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 __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
var fs_1 = __importDefault(require("fs"));
|
|
43
|
+
var util_1 = require("./util");
|
|
44
|
+
var updateAutoAnalyze = function (val) {
|
|
45
|
+
var fileContents = fs_1.default.readFileSync(util_1.PATH_TO_EXTENSION_VARIABLES, 'utf-8');
|
|
46
|
+
var jsonValue = JSON.parse(fileContents);
|
|
47
|
+
jsonValue.auto_analyze = val;
|
|
48
|
+
fs_1.default.writeFileSync(util_1.PATH_TO_EXTENSION_VARIABLES, JSON.stringify(jsonValue));
|
|
49
|
+
};
|
|
50
|
+
var Controller = /** @class */ (function () {
|
|
51
|
+
function Controller() {
|
|
52
|
+
}
|
|
53
|
+
Controller.prototype.start = function () {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
55
|
+
return __generator(this, function (_a) {
|
|
56
|
+
switch (_a.label) {
|
|
57
|
+
case 0:
|
|
58
|
+
updateAutoAnalyze(true);
|
|
59
|
+
return [4 /*yield*/, this.executeScript(function () {
|
|
60
|
+
var event = new CustomEvent('axe:start-auto-mode');
|
|
61
|
+
window.dispatchEvent(event);
|
|
62
|
+
return Promise.resolve();
|
|
63
|
+
})];
|
|
64
|
+
case 1:
|
|
65
|
+
_a.sent();
|
|
66
|
+
return [2 /*return*/];
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
Controller.prototype.stop = function () {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
73
|
+
return __generator(this, function (_a) {
|
|
74
|
+
switch (_a.label) {
|
|
75
|
+
case 0:
|
|
76
|
+
updateAutoAnalyze(false);
|
|
77
|
+
return [4 /*yield*/, this.executeScript(function () {
|
|
78
|
+
var event = new CustomEvent('axe:stop-auto-mode');
|
|
79
|
+
window.dispatchEvent(event);
|
|
80
|
+
return Promise.resolve();
|
|
81
|
+
})];
|
|
82
|
+
case 1:
|
|
83
|
+
_a.sent();
|
|
84
|
+
return [2 /*return*/];
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
Controller.prototype.analyze = function () {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
91
|
+
return __generator(this, function (_a) {
|
|
92
|
+
switch (_a.label) {
|
|
93
|
+
case 0: return [4 /*yield*/, this.executeScript(function () {
|
|
94
|
+
return new Promise(function (resolve) {
|
|
95
|
+
var event = new CustomEvent('axe:manual-mode-analyze');
|
|
96
|
+
var fn = function () {
|
|
97
|
+
window.removeEventListener('axe:manual-mode-analyze-done', fn);
|
|
98
|
+
resolve();
|
|
99
|
+
};
|
|
100
|
+
window.addEventListener('axe:manual-mode-analyze-done', fn);
|
|
101
|
+
window.dispatchEvent(event);
|
|
102
|
+
});
|
|
103
|
+
})];
|
|
104
|
+
case 1:
|
|
105
|
+
_a.sent();
|
|
106
|
+
return [2 /*return*/];
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
/** Flush all axe-core results by sending them to the server. */
|
|
112
|
+
Controller.prototype.flush = function () {
|
|
113
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
114
|
+
return __generator(this, function (_a) {
|
|
115
|
+
switch (_a.label) {
|
|
116
|
+
case 0: return [4 /*yield*/, this.executeScript(function () {
|
|
117
|
+
return new Promise(function (resolve) {
|
|
118
|
+
var fn = function () {
|
|
119
|
+
window.removeEventListener('axe:flush-end', fn);
|
|
120
|
+
resolve();
|
|
121
|
+
};
|
|
122
|
+
window.addEventListener('axe:flush-end', fn);
|
|
123
|
+
var event = new CustomEvent('axe:flush-start');
|
|
124
|
+
window.dispatchEvent(event);
|
|
125
|
+
});
|
|
126
|
+
})];
|
|
127
|
+
case 1:
|
|
128
|
+
_a.sent();
|
|
129
|
+
return [2 /*return*/];
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
});
|
|
133
|
+
};
|
|
134
|
+
return Controller;
|
|
135
|
+
}());
|
|
136
|
+
exports.default = Controller;
|
|
137
|
+
//# sourceMappingURL=Controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Controller.js","sourceRoot":"","sources":["../src/Controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAmB;AACnB,+BAAoD;AAEpD,IAAM,iBAAiB,GAAG,UAAC,GAAY;IACrC,IAAM,YAAY,GAAG,YAAE,CAAC,YAAY,CAAC,kCAA2B,EAAE,OAAO,CAAC,CAAA;IAC1E,IAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAA;IAC1C,SAAS,CAAC,YAAY,GAAG,GAAG,CAAA;IAC5B,YAAE,CAAC,aAAa,CAAC,kCAA2B,EAAE,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAA;AAC1E,CAAC,CAAA;AAED;IAAA;IAmDA,CAAC;IA9Cc,0BAAK,GAAlB;;;;;wBACE,iBAAiB,CAAC,IAAI,CAAC,CAAA;wBACvB,qBAAM,IAAI,CAAC,aAAa,CAAC;gCACvB,IAAM,KAAK,GAAG,IAAI,WAAW,CAAC,qBAAqB,CAAC,CAAA;gCACpD,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;gCAC3B,OAAO,O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K,GAAG,IAAI,WAAW,CAAC,iBAAiB,CAAC,CAAA;gCAChD,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;4BAC7B,CAAC,CAAC,CAAA;wBACJ,CAAC,CAAC,EAAA;;wBAVF,SAUE,CAAA;;;;;KACH;IACH,iBAAC;AAAD,CAAC,AAnDD,IAmDC;AAED,kBAAe,UAAU,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type Cypress from 'cypress';
|
|
2
|
+
import { Configuration } from './util';
|
|
3
|
+
/**
|
|
4
|
+
* Create a Cypress config that uses the axe Watcher extension.
|
|
5
|
+
*
|
|
6
|
+
* @param config Cypress config to extend
|
|
7
|
+
*/
|
|
8
|
+
export declare const cypressConfig: (config: Cypress.ConfigOptions & Configuration) => Cypress.ConfigOptions;
|
package/dist/cypress.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.cypressConfig = void 0;
|
|
26
|
+
var util_1 = require("./util");
|
|
27
|
+
/**
|
|
28
|
+
* Create a Cypress config that uses the axe Watcher extension.
|
|
29
|
+
*
|
|
30
|
+
* @param config Cypress config to extend
|
|
31
|
+
*/
|
|
32
|
+
var cypressConfig = function (config) {
|
|
33
|
+
var axe = config.axe, userConfig = __rest(config, ["axe"]);
|
|
34
|
+
(0, util_1.writeVariables)(axe);
|
|
35
|
+
(0, util_1.writeManifest)({
|
|
36
|
+
all_frames: true,
|
|
37
|
+
exclude_globs: [
|
|
38
|
+
// Top-level Cypress page.
|
|
39
|
+
'*/__/#/specs/runner?file=*',
|
|
40
|
+
// Cypress-specific iframes.
|
|
41
|
+
'*/__cypress/iframes/*'
|
|
42
|
+
]
|
|
43
|
+
});
|
|
44
|
+
return __assign(__assign({}, userConfig), { e2e: __assign(__assign({}, userConfig.e2e), { setupNodeEvents: function (on) {
|
|
45
|
+
on('before:browser:launch', function (browser, launchOptions) {
|
|
46
|
+
var _a;
|
|
47
|
+
// We only support Chrome.
|
|
48
|
+
if (browser.name === 'chrome') {
|
|
49
|
+
if (browser.isHeadless) {
|
|
50
|
+
throw new util_1.HeadlessNotSupportedError();
|
|
51
|
+
}
|
|
52
|
+
// Load the extension.
|
|
53
|
+
(_a = launchOptions.args).push.apply(_a, util_1.extensionArgs);
|
|
54
|
+
}
|
|
55
|
+
return launchOptions;
|
|
56
|
+
});
|
|
57
|
+
} }) });
|
|
58
|
+
};
|
|
59
|
+
exports.cypressConfig = cypressConfig;
|
|
60
|
+
//# sourceMappingURL=cypress.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cypress.js","sourceRoot":"","sources":["../src/cypress.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AACA,+BAMe;AAEf;;;;GAIG;AAEI,IAAM,aAAa,GAAG,UAC3B,MAA6C;IAErC,IAAA,GAAG,GAAoB,MAAM,IAA1B,EAAK,UAAU,UAAK,MAAM,EAA/B,OAAsB,CAAF,CAAW;IAErC,IAAA,qBAAc,EAAC,GAAG,CAAC,CAAA;IACnB,IAAA,oBAAa,EAAC;QACZ,UAAU,EAAE,IAAI;QAChB,aAAa,EAAE;YACb,0BAA0B;YAC1B,4BAA4B;YAC5B,4BAA4B;YAC5B,uBAAuB;SACxB;KACF,CAAC,CAAA;IAEF,6BACK,UAAU,KACb,GAAG,wBACE,UAAU,CAAC,GAAG,KACjB,eAAe,YAAC,EAAE;gBAChB,EAAE,CAAC,uBAAuB,EAAE,UAAC,OAAO,EAAE,aAAa;;oBACjD,0BAA0B;oBAC1B,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE;wBAC7B,IAAI,OAAO,CAAC,UAAU,EAAE;4BACtB,MAAM,IAAI,gCAAyB,EAAE,CAAA;yBACtC;wBAED,sBAAsB;wBACtB,CAAA,KAAA,aAAa,CAAC,IAAI,CAAA,CAAC,IAAI,WAAI,oBAAa,EAAC;qBAC1C;oBAED,OAAO,aAAa,CAAA;gBACtB,CAAC,CAAC,CAAA;YACJ,CAAC,OAEJ;AACH,CAAC,CAAA;AArCY,QAAA,aAAa,iBAqCzB"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
declare global {
|
|
3
|
+
namespace Cypress {
|
|
4
|
+
interface Chainable {
|
|
5
|
+
/** Flush the axe-core result queue by sending results to the server. */
|
|
6
|
+
axeFlush(): Chainable<void>;
|
|
7
|
+
/** Perform a manual axe-core analysis. */
|
|
8
|
+
axeAnalyze(): Chainable<void>;
|
|
9
|
+
/** Start automatic analysis mode. */
|
|
10
|
+
axeStart(): Chainable<void>;
|
|
11
|
+
/** Stop automatic analysis mode. */
|
|
12
|
+
axeStop(): Chainable<void>;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
Cypress.Commands.add('axeFlush', function () {
|
|
4
|
+
cy.window().then(function (win) {
|
|
5
|
+
return new Promise(function (resolve) {
|
|
6
|
+
var fn = function () {
|
|
7
|
+
win.removeEventListener('axe:flush-end', fn);
|
|
8
|
+
resolve();
|
|
9
|
+
};
|
|
10
|
+
win.addEventListener('axe:flush-end', fn);
|
|
11
|
+
var event = new CustomEvent('axe:flush-start');
|
|
12
|
+
win.dispatchEvent(event);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
});
|
|
16
|
+
Cypress.Commands.add('axeAnalyze', function () {
|
|
17
|
+
cy.window().then(function (win) {
|
|
18
|
+
return new Promise(function (resolve) {
|
|
19
|
+
var event = new CustomEvent('axe:manual-mode-analyze');
|
|
20
|
+
var fn = function () {
|
|
21
|
+
win.removeEventListener('axe:manual-mode-analyze-done', fn);
|
|
22
|
+
resolve();
|
|
23
|
+
};
|
|
24
|
+
win.addEventListener('axe:manual-mode-analyze-done', fn);
|
|
25
|
+
win.dispatchEvent(event);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
Cypress.Commands.add('axeStart', function () {
|
|
30
|
+
cy.window().then(function (win) {
|
|
31
|
+
var event = new CustomEvent('axe:start-auto-mode');
|
|
32
|
+
win.dispatchEvent(event);
|
|
33
|
+
return Promise.resolve();
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
Cypress.Commands.add('axeStop', function () {
|
|
37
|
+
cy.window().then(function (win) {
|
|
38
|
+
var event = new CustomEvent('axe:stop-auto-mode');
|
|
39
|
+
win.dispatchEvent(event);
|
|
40
|
+
return Promise.resolve();
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=cypressCommands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cypressCommands.js","sour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AAG;QAClB,IAAM,KAAK,GAAG,IAAI,WAAW,CAAC,qBAAqB,CAAC,CAAA;QACpD,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;QACxB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;IAC1B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE;IAC9B,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,UAAA,GAAG;QAClB,IAAM,KAAK,GAAG,IAAI,WAAW,CAAC,oBAAoB,CAAC,CAAA;QACnD,GAAG,CAAC,aAAa,CAAC,KAAK,CAAC,CAAA;QACxB,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;IAC1B,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,3 +3,4 @@ export { puppeteerConfig, PuppeteerController } from './puppeteer';
|
|
|
3
3
|
export { wdioConfig, wdioTestRunner, WdioController } from './wdio';
|
|
4
4
|
export { webdriverConfig, WebdriverController } from './webdriver';
|
|
5
5
|
export { playwrightConfig, PlaywrightController } from './playwright';
|
|
6
|
+
export { cypressConfig } from './cypress';
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/*! Copyright Deque 2021-2022 All Rights Reserved */
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.PlaywrightController = exports.playwrightConfig = exports.WebdriverController = exports.webdriverConfig = exports.WdioController = exports.wdioTestRunner = exports.wdioConfig = exports.PuppeteerController = exports.puppeteerConfig = void 0;
|
|
4
|
+
exports.cypressConfig = exports.PlaywrightController = exports.playwrightConfig = exports.WebdriverController = exports.webdriverConfig = exports.WdioController = exports.wdioTestRunner = exports.wdioConfig = exports.PuppeteerController = exports.puppeteerConfig = void 0;
|
|
5
5
|
var puppeteer_1 = require("./puppeteer");
|
|
6
6
|
Object.defineProperty(exports, "puppeteerConfig", { enumerable: true, get: function () { return puppeteer_1.puppeteerConfig; } });
|
|
7
7
|
Object.defineProperty(exports, "PuppeteerController", { enumerable: true, get: function () { return puppeteer_1.PuppeteerController; } });
|
|
@@ -15,4 +15,6 @@ Object.defineProperty(exports, "WebdriverController", { enumerable: true, get: f
|
|
|
15
15
|
var playwright_1 = require("./playwright");
|
|
16
16
|
Object.defineProperty(exports, "playwrightConfig", { enumerable: true, get: function () { return playwright_1.playwrightConfig; } });
|
|
17
17
|
Object.defineProperty(exports, "PlaywrightController", { enumerable: true, get: function () { return playwright_1.PlaywrightController; } });
|
|
18
|
+
var cypress_1 = require("./cypress");
|
|
19
|
+
Object.defineProperty(exports, "cypressConfig", { enumerable: true, get: function () { return cypress_1.cypressConfig; } });
|
|
18
20
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAEpD,yCAAkE;AAAzD,4GAAA,eAAe,OAAA;AAAE,gHAAA,mBAAmB,OAAA;AAC7C,+BAAmE;AAA1D,kGAAA,UAAU,OAAA;AAAE,sGAAA,cAAc,OAAA;AAAE,sGAAA,cAAc,OAAA;AACnD,yCAAkE;AAAzD,4GAAA,eAAe,OAAA;AAAE,gHAAA,mBAAmB,OAAA;AAC7C,2CAAqE;AAA5D,8GAAA,gBAAgB,OAAA;AAAE,kHAAA,oBAAoB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,oDAAoD;;;AAEpD,yCAAkE;AAAzD,4GAAA,eAAe,OAAA;AAAE,gHAAA,mBAAmB,OAAA;AAC7C,+BAAmE;AAA1D,kGAAA,UAAU,OAAA;AAAE,sGAAA,cAAc,OAAA;AAAE,sGAAA,cAAc,OAAA;AACnD,yCAAkE;AAAzD,4GAAA,eAAe,OAAA;AAAE,gHAAA,mBAAmB,OAAA;AAC7C,2CAAqE;AAA5D,8GAAA,gBAAgB,OAAA;AAAE,kHAAA,oBAAoB,OAAA;AAC/C,qCAAyC;AAAhC,wGAAA,aAAa,OAAA"}
|
package/dist/playwright.d.ts
CHANGED
package/dist/playwright.js
CHANGED
|
@@ -72,9 +72,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
72
72
|
}
|
|
73
73
|
return t;
|
|
74
74
|
};
|
|
75
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
76
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
77
|
+
};
|
|
75
78
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
76
79
|
exports.PlaywrightController = exports.playwrightConfig = void 0;
|
|
77
80
|
var util_1 = require("./util");
|
|
81
|
+
var Controller_1 = __importDefault(require("./Controller"));
|
|
78
82
|
/**
|
|
79
83
|
* Creates a Playwright config that uses axe extension
|
|
80
84
|
*
|
|
@@ -111,6 +115,6 @@ var PlaywrightController = /** @class */ (function (_super) {
|
|
|
111
115
|
});
|
|
112
116
|
};
|
|
113
117
|
return PlaywrightController;
|
|
114
|
-
}(
|
|
118
|
+
}(Controller_1.default));
|
|
115
119
|
exports.PlaywrightController = PlaywrightController;
|
|
116
120
|
//# sourceMappingURL=playwright.js.map
|
package/dist/playwright.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwright.js","sourceRoot":"","sources":["../src/playwright.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"playwright.js","sourceRoot":"","sources":["../src/playwright.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+BAKe;AACf,4DAAqC;AAErC;;;;GAIG;AAEH,SAAgB,gBAAgB,CAC9B,IAAmC;IAE3B,IAAA,GAAG,GAAgB,IAAI,IAApB,EAAK,MAAM,UAAK,IAAI,EAAzB,OAAkB,CAAF,CAAS;IACzB,IAAA,KAAc,MAAM,KAAX,EAAT,IAAI,mBAAG,EAAE,KAAA,CAAW;IAC1B,IAAA,qBAAc,EAAC,GAAG,CAAC,CAAA;IAEnB,IAAI,MAAM,CAAC,QAAQ,EAAE;QACnB,MAAM,IAAI,gCAAyB,EAAE,CAAA;KACtC;IAED,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,oBAAa,CAAC,CAAA;IAEjC,6BACK,MAAM,KACT,QAAQ,EAAE,KAAK,EACf,IAAI,MAAA,IACL;AACH,CAAC;AAlBD,4CAkBC;AAED;IAA0C,wCAAU;IAGlD,8BAAY,MAAY;QAAxB,YACE,iBAAO,SAER;QADC,KAAI,CAAC,MAAM,GAAG,MAAM,CAAA;;IACtB,CAAC;IAEe,4CAAa,GAA7B,UACE,EAAkC;;;;4BAElC,qBAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAA;;wBAA9B,SAA8B,CAAA;;;;;KAC/B;IACH,2BAAC;AAAD,CAAC,AAbD,CAA0C,oBAAU,GAanD;AAbY,oDAAoB"}
|
package/dist/puppeteer.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { LaunchOptions, BrowserLaunchArgumentOptions, BrowserConnectOptions, Page } from 'puppeteer';
|
|
2
|
-
import { Configuration
|
|
2
|
+
import { Configuration } from './util';
|
|
3
|
+
import Controller from './Controller';
|
|
3
4
|
declare type Options = LaunchOptions & BrowserLaunchArgumentOptions & BrowserConnectOptions;
|
|
4
5
|
/**
|
|
5
6
|
* Creates a Puppeteer config that uses axe extension.
|
package/dist/puppeteer.js
CHANGED
|
@@ -72,9 +72,13 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
72
72
|
}
|
|
73
73
|
return t;
|
|
74
74
|
};
|
|
75
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
76
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
77
|
+
};
|
|
75
78
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
76
79
|
exports.PuppeteerController = exports.puppeteerConfig = void 0;
|
|
77
80
|
var util_1 = require("./util");
|
|
81
|
+
var Controller_1 = __importDefault(require("./Controller"));
|
|
78
82
|
/**
|
|
79
83
|
* Creates a Puppeteer config that uses axe extension.
|
|
80
84
|
*
|
|
@@ -111,6 +115,6 @@ var PuppeteerController = /** @class */ (function (_super) {
|
|
|
111
115
|
});
|
|
112
116
|
};
|
|
113
117
|
return PuppeteerController;
|
|
114
|
-
}(
|
|
118
|
+
}(Controller_1.default));
|
|
115
119
|
exports.PuppeteerController = PuppeteerController;
|
|
116
120
|
//# sourceMappingURL=puppeteer.js.map
|
package/dist/puppeteer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"puppeteer.js","sourceRoot":"","sources":["../src/puppeteer.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"puppeteer.js","sourceRoot":"","sources":["../src/puppeteer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,+BAKe;AACf,4DAAqC;AAMrC;;;;GAIG;AAEH,SAAgB,eAAe,CAAC,IAA6B;IACnD,IAAA,GAAG,GAAgB,IAAI,IAApB,EAAK,MAAM,UAAK,IAAI,EAAzB,OAAkB,CAAF,CAAS;IACzB,IAAA,KAAc,MAAM,KAAX,EAAT,IAAI,mBAAG,EAAE,KAAA,CAAW;IAC1B,IAAA,qBAAc,EAAC,GAAG,CAAC,CAAA;IAEnB,IAAI,MAAM,CAAC,QAAQ,EAAE;QACnB,MAAM,IAAI,gCAAyB,EAAE,CAAA;KACtC;IAED,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,oBAAa,CAAC,CAAA;IAEjC,6BACK,MAAM,KACT,QAAQ,EAAE,KAAK,EACf,IAAI,MAAA,IACL;AACH,CAAC;AAhBD,0CAgBC;AAED;IAAyC,uCAAU;IAGjD,6BAAY,MAAY;QAAxB,YACE,iBAAO,SAER;QADC,KAAI,CAAC,MAAM,GAAG,MAAM,CAAA;;IACtB,CAAC;IAEe,2CAAa,GAA7B,UACE,EAAkC;;;;4BAElC,qBAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAA;;wBAA9B,SAA8B,CAAA;;;;;KAC/B;IACH,0BAAC;AAAD,CAAC,AAbD,CAAyC,oBAAU,GAalD;AAbY,kDAAmB"}
|
package/dist/util.d.ts
CHANGED
|
@@ -30,12 +30,10 @@ interface WriteVariablesParams {
|
|
|
30
30
|
}
|
|
31
31
|
/** Write the user's settings to the disk, so the extension can load them. */
|
|
32
32
|
export declare function writeVariables({ apiKey, serverURL, sessionId, autoAnalyze }: WriteVariablesParams): void;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
stop(): Promise<void>;
|
|
37
|
-
analyze(): Promise<void>;
|
|
38
|
-
/** Flush all axe-core results by sending them to the server. */
|
|
39
|
-
flush(): Promise<void>;
|
|
33
|
+
interface WriteManifestParams {
|
|
34
|
+
all_frames: boolean;
|
|
35
|
+
exclude_globs: string[];
|
|
40
36
|
}
|
|
37
|
+
/** Update the extension manifest file. */
|
|
38
|
+
export declare function writeManifest({ all_frames, exclude_globs }: WriteManifestParams): void;
|
|
41
39
|
export {};
|
package/dist/util.js
CHANGED
|
@@ -14,47 +14,11 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
33
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
17
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
54
18
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
55
19
|
};
|
|
56
20
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
-
exports.
|
|
21
|
+
exports.writeManifest = exports.writeVariables = exports.HeadlessNotSupportedError = exports.extensionArgs = exports.PATH_TO_EXTENSION_VARIABLES = exports.PATH_TO_SESSION_FILE = exports.DEFAULT_SERVER_URL = exports.PATH_TO_EXTENSION = void 0;
|
|
58
22
|
var fs_1 = __importDefault(require("fs"));
|
|
59
23
|
var path_1 = __importDefault(require("path"));
|
|
60
24
|
var os_1 = __importDefault(require("os"));
|
|
@@ -111,97 +75,14 @@ function writeVariables(_a) {
|
|
|
111
75
|
}));
|
|
112
76
|
}
|
|
113
77
|
exports.writeVariables = writeVariables;
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
var
|
|
117
|
-
|
|
118
|
-
fs_1.default.
|
|
78
|
+
/** Update the extension manifest file. */
|
|
79
|
+
function writeManifest(_a) {
|
|
80
|
+
var all_frames = _a.all_frames, exclude_globs = _a.exclude_globs;
|
|
81
|
+
var manifestPath = path_1.default.join(exports.PATH_TO_EXTENSION, 'manifest.json');
|
|
82
|
+
var manifest = JSON.parse(fs_1.default.readFileSync(manifestPath, 'utf-8'));
|
|
83
|
+
manifest.content_scripts[0].all_frames = all_frames;
|
|
84
|
+
manifest.content_scripts[0].exclude_globs = exclude_globs;
|
|
85
|
+
fs_1.default.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2));
|
|
119
86
|
}
|
|
120
|
-
|
|
121
|
-
function Controller() {
|
|
122
|
-
}
|
|
123
|
-
Controller.prototype.start = function () {
|
|
124
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
125
|
-
return __generator(this, function (_a) {
|
|
126
|
-
switch (_a.label) {
|
|
127
|
-
case 0:
|
|
128
|
-
updateAutoAnalyze(true);
|
|
129
|
-
return [4 /*yield*/, this.executeScript(function () {
|
|
130
|
-
var event = new CustomEvent('axe:start-auto-mode');
|
|
131
|
-
window.dispatchEvent(event);
|
|
132
|
-
return Promise.resolve();
|
|
133
|
-
})];
|
|
134
|
-
case 1:
|
|
135
|
-
_a.sent();
|
|
136
|
-
return [2 /*return*/];
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
};
|
|
141
|
-
Controller.prototype.stop = function () {
|
|
142
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
143
|
-
return __generator(this, function (_a) {
|
|
144
|
-
switch (_a.label) {
|
|
145
|
-
case 0:
|
|
146
|
-
updateAutoAnalyze(false);
|
|
147
|
-
return [4 /*yield*/, this.executeScript(function () {
|
|
148
|
-
var event = new CustomEvent('axe:stop-auto-mode');
|
|
149
|
-
window.dispatchEvent(event);
|
|
150
|
-
return Promise.resolve();
|
|
151
|
-
})];
|
|
152
|
-
case 1:
|
|
153
|
-
_a.sent();
|
|
154
|
-
return [2 /*return*/];
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
});
|
|
158
|
-
};
|
|
159
|
-
Controller.prototype.analyze = function () {
|
|
160
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
161
|
-
return __generator(this, function (_a) {
|
|
162
|
-
switch (_a.label) {
|
|
163
|
-
case 0: return [4 /*yield*/, this.executeScript(function () {
|
|
164
|
-
return new Promise(function (resolve) {
|
|
165
|
-
var event = new CustomEvent('axe:manual-mode-analyze');
|
|
166
|
-
var fn = function () {
|
|
167
|
-
window.removeEventListener('axe:manual-mode-analyze-done', fn);
|
|
168
|
-
resolve();
|
|
169
|
-
};
|
|
170
|
-
window.addEventListener('axe:manual-mode-analyze-done', fn);
|
|
171
|
-
window.dispatchEvent(event);
|
|
172
|
-
});
|
|
173
|
-
})];
|
|
174
|
-
case 1:
|
|
175
|
-
_a.sent();
|
|
176
|
-
return [2 /*return*/];
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
|
-
};
|
|
181
|
-
/** Flush all axe-core results by sending them to the server. */
|
|
182
|
-
Controller.prototype.flush = function () {
|
|
183
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
184
|
-
return __generator(this, function (_a) {
|
|
185
|
-
switch (_a.label) {
|
|
186
|
-
case 0: return [4 /*yield*/, this.executeScript(function () {
|
|
187
|
-
return new Promise(function (resolve) {
|
|
188
|
-
var fn = function () {
|
|
189
|
-
window.removeEventListener('axe:flush-end', fn);
|
|
190
|
-
resolve();
|
|
191
|
-
};
|
|
192
|
-
window.addEventListener('axe:flush-end', fn);
|
|
193
|
-
var event = new CustomEvent('axe:flush-start');
|
|
194
|
-
window.dispatchEvent(event);
|
|
195
|
-
});
|
|
196
|
-
})];
|
|
197
|
-
case 1:
|
|
198
|
-
_a.sent();
|
|
199
|
-
return [2 /*return*/];
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
});
|
|
203
|
-
};
|
|
204
|
-
return Controller;
|
|
205
|
-
}());
|
|
206
|
-
exports.Controller = Controller;
|
|
87
|
+
exports.writeManifest = writeManifest;
|
|
207
88
|
//# sourceMappingURL=util.js.map
|
package/dist/util.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"util.js","sourceRoot":"","sources":["../src/util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,0CAAmB;AACnB,8CAAuB;AACvB,0CAAmB;AAEN,QAAA,iBAAiB,GAAG,cAAI,CAAC,I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AAC,CAAC,CAAA;YACtE,SAAS,GAAG,IAAI,CAAC,EAAY,CAAA;SAC9B;QAAC,OAAO,KAAK,EAAE;YACd,MAAM,IAAI,KAAK,CAAC,gDAAyC,KAAK,CAAE,CAAC,CAAA;SAClE;KACF;IAED,YAAE,CAAC,aAAa,CACd,mCAA2B,EAC3B,IAAI,CAAC,SAAS,CAAC;QACb,OAAO,EAAE,MAAM;QACf,UAAU,EAAE,SAAS;QACrB,UAAU,EAAE,SAAS;QACrB,YAAY,EAAE,CAAC,CAAC,WAAW;KAC5B,CAAC,CACH,CAAA;AACH,CAAC;AA3CD,wCA2CC;AAOD,0CAA0C;AAC1C,SAAgB,aAAa,CAAC,EAGR;QAFpB,UAAU,gBAAA,EACV,aAAa,mBAAA;IAEb,IAAM,YAAY,GAAG,cAAI,CAAC,IAAI,CAAC,yBAAiB,EAAE,eAAe,CAAC,CAAA;IAClE,IAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,YAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAA;IACnE,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,UAAU,GAAG,UAAU,CAAA;IACnD,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,aAAa,GAAG,aAAa,CAAA;IACzD,YAAE,CAAC,aAAa,CAAC,YAAY,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;AACnE,CAAC;AATD,sCASC"}
|
package/dist/wdio.d.ts
CHANGED
package/dist/wdio.js
CHANGED
|
@@ -61,9 +61,13 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
61
61
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
65
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
66
|
+
};
|
|
64
67
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
68
|
exports.WdioController = exports.wdioTestRunner = exports.wdioConfig = void 0;
|
|
66
69
|
var util_1 = require("./util");
|
|
70
|
+
var Controller_1 = __importDefault(require("./Controller"));
|
|
67
71
|
/**
|
|
68
72
|
* Creates a WebDriverIO config that uses axe extension
|
|
69
73
|
*
|
|
@@ -131,6 +135,6 @@ var WdioController = /** @class */ (function (_super) {
|
|
|
131
135
|
});
|
|
132
136
|
};
|
|
133
137
|
return WdioController;
|
|
134
|
-
}(
|
|
138
|
+
}(Controller_1.default));
|
|
135
139
|
exports.WdioController = WdioController;
|
|
136
140
|
//# sourceMappingURL=wdio.js.map
|
package/dist/wdio.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wdio.js","sourceRoot":"","sources":["../src/wdio.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"wdio.js","sourceRoot":"","sources":["../src/wdio.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+BAKe;AACf,4DAAqC;AAUrC;;;;GAIG;AAEH,SAAgB,UAAU,CAAC,GAAY;;IACrC,IAAA,qBAAc,EAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IAEvB,iFAAiF;IACjF,uDAAuD;IACvD,IAAM,UAAU,GACd,CAAA,MAAC,MAAA,GAAG,CAAC,OAAO,0CAAE,YAAoB,0CAAG,oBAAoB,CAAC,KAAI,EAAE,CAAA;IAClE,IAAM,IAAI,GAAG,UAAU,CAAC,IAAI,IAAI,EAAE,CAAA;IAElC,IAAI,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE;QAC/B,MAAM,IAAI,gCAAyB,EAAE,CAAA;KACtC;IAED,6BACK,GAAG,CAAC,OAAO,KACd,YAAY,wBACP,MAAA,GAAG,CAAC,OAAO,0CAAE,YAA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