@axe-core/watcher 2.0.0-next.3e4ae779 → 2.0.0-next.7e99a295
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.js +71 -131
- package/dist/Controller.js.map +1 -1
- package/dist/cypress.d.ts +1 -1
- package/dist/cypress.js +9 -34
- package/dist/cypress.js.map +1 -1
- package/dist/cypressCommands.js +55 -66
- package/dist/cypressCommands.js.map +1 -1
- package/dist/git.js +15 -21
- package/dist/git.js.map +1 -1
- package/dist/playwright.d.ts +1 -1
- package/dist/playwright.js +17 -84
- package/dist/playwright.js.map +1 -1
- package/dist/playwrightTest.js +26 -104
- package/dist/playwrightTest.js.map +1 -1
- package/dist/playwrightWrapping.js +165 -463
- package/dist/playwrightWrapping.js.map +1 -1
- package/dist/puppeteer.d.ts +1 -1
- package/dist/puppeteer.js +14 -91
- package/dist/puppeteer.js.map +1 -1
- package/dist/puppeteerWrapping.js +141 -409
- package/dist/puppeteerWrapping.js.map +1 -1
- package/dist/util.js +26 -46
- package/dist/util.js.map +1 -1
- package/dist/validateApiKey.js +6 -7
- package/dist/validateApiKey.js.map +1 -1
- package/dist/wdio.d.ts +1 -1
- package/dist/wdio.js +45 -134
- package/dist/wdio.js.map +1 -1
- package/dist/webdriver.d.ts +1 -1
- package/dist/webdriver.js +21 -84
- package/dist/webdriver.js.map +1 -1
- package/extension/background.js +1 -1
- package/extension/content.js +1 -1
- package/package.json +1 -1
package/dist/webdriver.js
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -23,49 +8,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
23
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
9
|
});
|
|
25
10
|
};
|
|
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
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
54
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
55
|
-
if (ar || !(i in from)) {
|
|
56
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
57
|
-
ar[i] = from[i];
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
61
|
-
};
|
|
62
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
63
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
64
13
|
};
|
|
65
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
66
15
|
exports.WebdriverController = exports.webdriverConfig = void 0;
|
|
67
|
-
|
|
68
|
-
|
|
16
|
+
const util_1 = require("./util");
|
|
17
|
+
const Controller_1 = __importDefault(require("./Controller"));
|
|
69
18
|
/**
|
|
70
19
|
* Creates a Selenium config that uses axe extension
|
|
71
20
|
*
|
|
@@ -75,11 +24,11 @@ function webdriverConfig(arg) {
|
|
|
75
24
|
var _a, _b;
|
|
76
25
|
// Lazily require `chrome` to avoid Puppeteer/Playwright/WDIO users from needing `selenium-webdriver` installed.
|
|
77
26
|
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
78
|
-
|
|
79
|
-
|
|
27
|
+
const chrome = require('selenium-webdriver/chrome');
|
|
28
|
+
const { axe, options } = arg;
|
|
80
29
|
(0, util_1.writeVariables)(axe);
|
|
81
|
-
|
|
82
|
-
opts.addArguments
|
|
30
|
+
const opts = options ? options : new chrome.Options();
|
|
31
|
+
opts.addArguments(...util_1.extensionArgs);
|
|
83
32
|
// Note: fragile, but selenium does not give us a real way to check this
|
|
84
33
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
85
34
|
if ((_b = (_a = opts === null || opts === void 0 ? void 0 : opts.options_) === null || _a === void 0 ? void 0 : _a.args) === null || _b === void 0 ? void 0 : _b.includes('headless')) {
|
|
@@ -88,34 +37,22 @@ function webdriverConfig(arg) {
|
|
|
88
37
|
return opts;
|
|
89
38
|
}
|
|
90
39
|
exports.webdriverConfig = webdriverConfig;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
_this.driver = driver;
|
|
96
|
-
return _this;
|
|
40
|
+
class WebdriverController extends Controller_1.default {
|
|
41
|
+
constructor(driver) {
|
|
42
|
+
super();
|
|
43
|
+
this.driver = driver;
|
|
97
44
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
switch (_b.label) {
|
|
108
|
-
case 0:
|
|
109
|
-
script = "\n const callback = arguments[arguments.length - 1];\n Promise.resolve(...arguments)\n .then(".concat(fn, ")\n .then(callback);\n ");
|
|
110
|
-
return [4 /*yield*/, (_a = this.driver).executeAsyncScript.apply(_a, __spreadArray([script], args, false))];
|
|
111
|
-
case 1:
|
|
112
|
-
_b.sent();
|
|
113
|
-
return [2 /*return*/];
|
|
114
|
-
}
|
|
115
|
-
});
|
|
45
|
+
executeScript(fn, ...args) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
const script = `
|
|
48
|
+
const callback = arguments[arguments.length - 1];
|
|
49
|
+
Promise.resolve(...arguments)
|
|
50
|
+
.then(${fn})
|
|
51
|
+
.then(callback);
|
|
52
|
+
`;
|
|
53
|
+
yield this.driver.executeAsyncScript(script, ...args);
|
|
116
54
|
});
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
}(Controller_1.default));
|
|
55
|
+
}
|
|
56
|
+
}
|
|
120
57
|
exports.WebdriverController = WebdriverController;
|
|
121
58
|
//# sourceMappingURL=webdriver.js.map
|
package/dist/webdriver.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webdriver.js","sourceRoot":"","sources":["../src/webdriver.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"webdriver.js","sourceRoot":"","sources":["../src/webdriver.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,iCAKe;AACf,8DAAqC;AAMrC;;;;GAIG;AAEH,SAAgB,eAAe,CAAC,GAAkB;;IAChD,gHAAgH;IAChH,8DAA8D;IAC9D,MAAM,MAAM,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAA;IAEnD,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,GAAG,CAAA;IAC5B,IAAA,qBAAc,EAAC,GAAG,CAAC,CAAA;IAEnB,MAAM,IAAI,GAAY,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAA;IAC9D,IAAI,CAAC,YAAY,CAAC,GAAG,oBAAa,CAAC,CAAA;IAEnC,wEAAwE;IACxE,8DAA8D;IAC9D,IAAI,MAAA,MAAC,IAAY,aAAZ,IAAI,uBAAJ,IAAI,CAAU,QAAQ,0CAAE,IAAI,0CAAE,QAAQ,CAAC,UAAU,CAAC,EAAE;QACvD,MAAM,IAAI,gCAAyB,EAAE,CAAA;KACtC;IAED,OAAO,IAAI,CAAA;AACb,CAAC;AAlBD,0CAkBC;AAED,MAAa,mBAAoB,SAAQ,oBAAU;IAGjD,YAAY,MAAiB;QAC3B,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;IACtB,CAAC;IAEe,aAAa,CAC3B,EAAkC,EAClC,GAAG,IAAe;;YAElB,MAAM,MAAM,GAAG;;;gBAGH,EAAE;;KAEb,CAAA;YACD,MAAM,IAAI,CAAC,MAAM,CAAC,kBAAkB,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAAA;QACvD,CAAC;KAAA;CACF;AApBD,kDAoBC"}
|