@axe-core/watcher 0.0.1-next.581e3953 → 0.0.1-next.68a4dc1e
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/cli.d.ts +2 -0
- package/dist/cli.js +134 -0
- package/dist/cli.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 +6 -4
- package/dist/index.js +8 -5
- package/dist/index.js.map +1 -1
- package/dist/playwright.d.ts +2 -2
- package/dist/playwright.js +9 -9
- package/dist/playwright.js.map +1 -1
- package/dist/puppeteer.d.ts +2 -2
- package/dist/puppeteer.js +9 -9
- package/dist/puppeteer.js.map +1 -1
- package/dist/util.d.ts +16 -1
- package/dist/util.js +93 -43
- package/dist/util.js.map +1 -1
- package/dist/wdio.d.ts +2 -2
- package/dist/wdio.js +10 -10
- package/dist/wdio.js.map +1 -1
- package/dist/webdriver.d.ts +2 -2
- package/dist/webdriver.js +9 -9
- package/dist/webdriver.js.map +1 -1
- package/extension/content.js +1 -1
- package/extension/content.js.LICENSE.txt +3 -1
- package/extension/manifest.json +1 -0
- package/extension/worker.js +1 -1
- package/extension/worker.js.LICENSE.txt +1 -0
- package/package.json +39 -48
package/dist/util.js
CHANGED
|
@@ -1,27 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
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
|
+
})();
|
|
25
17
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
18
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
19
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -58,17 +50,33 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
58
50
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
51
|
}
|
|
60
52
|
};
|
|
53
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
54
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
55
|
+
};
|
|
61
56
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
62
|
-
exports.
|
|
63
|
-
var
|
|
64
|
-
var
|
|
65
|
-
|
|
57
|
+
exports.Controller = 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
|
+
var fs_1 = __importDefault(require("fs"));
|
|
59
|
+
var path_1 = __importDefault(require("path"));
|
|
60
|
+
var os_1 = __importDefault(require("os"));
|
|
61
|
+
exports.PATH_TO_EXTENSION = path_1.default.join(__dirname, '..', 'extension');
|
|
66
62
|
exports.DEFAULT_SERVER_URL = 'https://axe.deque.com/';
|
|
63
|
+
exports.PATH_TO_SESSION_FILE = path_1.default.join(os_1.default.tmpdir(), 'axe-watcher-session.json');
|
|
64
|
+
exports.PATH_TO_EXTENSION_VARIABLES = path_1.default.join(exports.PATH_TO_EXTENSION, 'variables.json');
|
|
67
65
|
exports.extensionArgs = [
|
|
68
66
|
"--disable-extensions-except=".concat(exports.PATH_TO_EXTENSION),
|
|
69
67
|
"--load-extension=".concat(exports.PATH_TO_EXTENSION)
|
|
70
68
|
];
|
|
71
|
-
|
|
69
|
+
var HeadlessNotSupportedError = /** @class */ (function (_super) {
|
|
70
|
+
__extends(HeadlessNotSupportedError, _super);
|
|
71
|
+
function HeadlessNotSupportedError() {
|
|
72
|
+
var _this = _super.call(this, 'Cannot use extension while headless.') || this;
|
|
73
|
+
_this.name = 'HeadlessNotSupportedError';
|
|
74
|
+
return _this;
|
|
75
|
+
}
|
|
76
|
+
return HeadlessNotSupportedError;
|
|
77
|
+
}(Error));
|
|
78
|
+
exports.HeadlessNotSupportedError = HeadlessNotSupportedError;
|
|
79
|
+
/** Write the user's settings to the disk, so the extension can load them. */
|
|
72
80
|
function writeVariables(_a) {
|
|
73
81
|
var apiKey = _a.apiKey, serverURL = _a.serverURL, sessionId = _a.sessionId, autoAnalyze = _a.autoAnalyze;
|
|
74
82
|
if (!serverURL) {
|
|
@@ -84,8 +92,18 @@ function writeVariables(_a) {
|
|
|
84
92
|
if (typeof autoAnalyze === 'undefined') {
|
|
85
93
|
autoAnalyze = true;
|
|
86
94
|
}
|
|
87
|
-
|
|
88
|
-
|
|
95
|
+
// When a custom session ID is not provided, attempt to read it from the filesystem.
|
|
96
|
+
// This enables multi-process/multi-browser test suites to all use the same session ID.
|
|
97
|
+
if (!sessionId && fs_1.default.existsSync(exports.PATH_TO_SESSION_FILE)) {
|
|
98
|
+
try {
|
|
99
|
+
var data = JSON.parse(fs_1.default.readFileSync(exports.PATH_TO_SESSION_FILE, 'utf8'));
|
|
100
|
+
sessionId = data.id;
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
throw new Error("Unable to read session configuration: ".concat(error));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
fs_1.default.writeFileSync(exports.PATH_TO_EXTENSION_VARIABLES, JSON.stringify({
|
|
89
107
|
api_key: apiKey,
|
|
90
108
|
server_url: urlString,
|
|
91
109
|
session_id: sessionId,
|
|
@@ -93,17 +111,26 @@ function writeVariables(_a) {
|
|
|
93
111
|
}));
|
|
94
112
|
}
|
|
95
113
|
exports.writeVariables = writeVariables;
|
|
114
|
+
/** Update the extension manifest file. */
|
|
115
|
+
function writeManifest(_a) {
|
|
116
|
+
var all_frames = _a.all_frames, exclude_globs = _a.exclude_globs;
|
|
117
|
+
var manifestPath = path_1.default.join(exports.PATH_TO_EXTENSION, 'manifest.json');
|
|
118
|
+
var manifest = JSON.parse(fs_1.default.readFileSync(manifestPath, 'utf-8'));
|
|
119
|
+
manifest.content_scripts[0].all_frames = all_frames;
|
|
120
|
+
manifest.content_scripts[0].exclude_globs = exclude_globs;
|
|
121
|
+
fs_1.default.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2));
|
|
122
|
+
}
|
|
123
|
+
exports.writeManifest = writeManifest;
|
|
96
124
|
function updateAutoAnalyze(newVal) {
|
|
97
|
-
var
|
|
98
|
-
var fileContents = fs.readFileSync(filePath, 'utf-8');
|
|
125
|
+
var fileContents = fs_1.default.readFileSync(exports.PATH_TO_EXTENSION_VARIABLES, 'utf-8');
|
|
99
126
|
var jsonValue = JSON.parse(fileContents);
|
|
100
127
|
jsonValue['auto_analyze'] = newVal;
|
|
101
|
-
|
|
128
|
+
fs_1.default.writeFileSync(exports.PATH_TO_EXTENSION_VARIABLES, JSON.stringify(jsonValue));
|
|
102
129
|
}
|
|
103
|
-
var
|
|
104
|
-
function
|
|
130
|
+
var Controller = /** @class */ (function () {
|
|
131
|
+
function Controller() {
|
|
105
132
|
}
|
|
106
|
-
|
|
133
|
+
Controller.prototype.start = function () {
|
|
107
134
|
return __awaiter(this, void 0, void 0, function () {
|
|
108
135
|
return __generator(this, function (_a) {
|
|
109
136
|
switch (_a.label) {
|
|
@@ -121,7 +148,7 @@ var ManualController = /** @class */ (function () {
|
|
|
121
148
|
});
|
|
122
149
|
});
|
|
123
150
|
};
|
|
124
|
-
|
|
151
|
+
Controller.prototype.stop = function () {
|
|
125
152
|
return __awaiter(this, void 0, void 0, function () {
|
|
126
153
|
return __generator(this, function (_a) {
|
|
127
154
|
switch (_a.label) {
|
|
@@ -139,19 +166,42 @@ var ManualController = /** @class */ (function () {
|
|
|
139
166
|
});
|
|
140
167
|
});
|
|
141
168
|
};
|
|
142
|
-
|
|
169
|
+
Controller.prototype.analyze = function () {
|
|
143
170
|
return __awaiter(this, void 0, void 0, function () {
|
|
144
171
|
return __generator(this, function (_a) {
|
|
145
172
|
switch (_a.label) {
|
|
146
173
|
case 0: return [4 /*yield*/, this.executeScript(function () {
|
|
147
174
|
return new Promise(function (resolve) {
|
|
148
175
|
var event = new CustomEvent('axe:manual-mode-analyze');
|
|
176
|
+
var fn = function () {
|
|
177
|
+
window.removeEventListener('axe:manual-mode-analyze-done', fn);
|
|
178
|
+
resolve();
|
|
179
|
+
};
|
|
180
|
+
window.addEventListener('axe:manual-mode-analyze-done', fn);
|
|
149
181
|
window.dispatchEvent(event);
|
|
150
|
-
|
|
151
|
-
|
|
182
|
+
});
|
|
183
|
+
})];
|
|
184
|
+
case 1:
|
|
185
|
+
_a.sent();
|
|
186
|
+
return [2 /*return*/];
|
|
187
|
+
}
|
|
188
|
+
});
|
|
189
|
+
});
|
|
190
|
+
};
|
|
191
|
+
/** Flush all axe-core results by sending them to the server. */
|
|
192
|
+
Controller.prototype.flush = function () {
|
|
193
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
194
|
+
return __generator(this, function (_a) {
|
|
195
|
+
switch (_a.label) {
|
|
196
|
+
case 0: return [4 /*yield*/, this.executeScript(function () {
|
|
197
|
+
return new Promise(function (resolve) {
|
|
198
|
+
var fn = function () {
|
|
199
|
+
window.removeEventListener('axe:flush-end', fn);
|
|
152
200
|
resolve();
|
|
153
201
|
};
|
|
154
|
-
window.addEventListener('axe:
|
|
202
|
+
window.addEventListener('axe:flush-end', fn);
|
|
203
|
+
var event = new CustomEvent('axe:flush-start');
|
|
204
|
+
window.dispatchEvent(event);
|
|
155
205
|
});
|
|
156
206
|
})];
|
|
157
207
|
case 1:
|
|
@@ -161,7 +211,7 @@ var ManualController = /** @class */ (function () {
|
|
|
161
211
|
});
|
|
162
212
|
});
|
|
163
213
|
};
|
|
164
|
-
return
|
|
214
|
+
return Controller;
|
|
165
215
|
}());
|
|
166
|
-
exports.
|
|
216
|
+
exports.Controller = Controller;
|
|
167
217
|
//# 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,IAAI,CAAC,SAAS,EAAE,IAAI,EAAE,WAAW,CAAC,CAAA;AAC3D,QAAA,kBAAkB,GAAG,wBAAwB,CAAA;AAC7C,QAA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,EAAE,GAAG;oCACT,MAAM,CAAC,mBAAmB,CAAC,eAAe,EAAE,EAAE,CAAC,CAAA;oCAC/C,OAAO,EAAE,CAAA;gCACX,CAAC,CAAA;gCACD,MAAM,CAAC,gBAAgB,CAAC,eAAe,EAAE,EAAE,CAAC,CAAA;gCAC5C,IAAM,KAAK,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;AAnDqB,gCAAU"}
|
package/dist/wdio.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Configuration, ManualController } from './util';
|
|
2
1
|
import type { Options } from '@wdio/types';
|
|
2
|
+
import { Configuration, Controller } from './util';
|
|
3
3
|
interface Browser {
|
|
4
4
|
executeAsyncScript(script: string, args: object[]): void;
|
|
5
5
|
}
|
|
@@ -13,7 +13,7 @@ interface WdioArg extends Configuration {
|
|
|
13
13
|
*/
|
|
14
14
|
export declare function wdioConfig(arg: WdioArg): Options.WebDriver;
|
|
15
15
|
export declare function wdioTestRunner(axe: Configuration['axe'], config: Options.Testrunner): Options.Testrunner;
|
|
16
|
-
export declare class
|
|
16
|
+
export declare class WdioController extends Controller {
|
|
17
17
|
private driver;
|
|
18
18
|
constructor(driver: Browser);
|
|
19
19
|
protected executeScript(fn: string | (() => Promise<void>)): Promise<void>;
|
package/dist/wdio.js
CHANGED
|
@@ -62,7 +62,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
62
62
|
}
|
|
63
63
|
};
|
|
64
64
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
|
-
exports.
|
|
65
|
+
exports.WdioController = exports.wdioTestRunner = exports.wdioConfig = void 0;
|
|
66
66
|
var util_1 = require("./util");
|
|
67
67
|
/**
|
|
68
68
|
* Creates a WebDriverIO config that uses axe extension
|
|
@@ -77,7 +77,7 @@ function wdioConfig(arg) {
|
|
|
77
77
|
var chromeOpts = ((_b = (_a = arg.options) === null || _a === void 0 ? void 0 : _a.capabilities) === null || _b === void 0 ? void 0 : _b['goog:chromeOptions']) || {};
|
|
78
78
|
var args = chromeOpts.args || [];
|
|
79
79
|
if (args.includes('--headless')) {
|
|
80
|
-
throw new
|
|
80
|
+
throw new util_1.HeadlessNotSupportedError();
|
|
81
81
|
}
|
|
82
82
|
return __assign(__assign({}, arg.options), { capabilities: __assign(__assign({}, (_c = arg.options) === null || _c === void 0 ? void 0 : _c.capabilities), { browserName: 'chrome', 'goog:chromeOptions': {
|
|
83
83
|
args: util_1.extensionArgs.concat(args)
|
|
@@ -102,20 +102,20 @@ function wdioTestRunner(axe, config) {
|
|
|
102
102
|
chromeOpts.args = chromeOpts.args || [];
|
|
103
103
|
var args = chromeOpts.args;
|
|
104
104
|
if (args.includes('--headless')) {
|
|
105
|
-
throw new
|
|
105
|
+
throw new util_1.HeadlessNotSupportedError();
|
|
106
106
|
}
|
|
107
107
|
chromeOpts.args = util_1.extensionArgs.concat(args);
|
|
108
108
|
return __assign(__assign({}, config), { capabilities: capabilities });
|
|
109
109
|
}
|
|
110
110
|
exports.wdioTestRunner = wdioTestRunner;
|
|
111
|
-
var
|
|
112
|
-
__extends(
|
|
113
|
-
function
|
|
111
|
+
var WdioController = /** @class */ (function (_super) {
|
|
112
|
+
__extends(WdioController, _super);
|
|
113
|
+
function WdioController(driver) {
|
|
114
114
|
var _this = _super.call(this) || this;
|
|
115
115
|
_this.driver = driver;
|
|
116
116
|
return _this;
|
|
117
117
|
}
|
|
118
|
-
|
|
118
|
+
WdioController.prototype.executeScript = function (fn) {
|
|
119
119
|
return __awaiter(this, void 0, void 0, function () {
|
|
120
120
|
var script;
|
|
121
121
|
return __generator(this, function (_a) {
|
|
@@ -130,7 +130,7 @@ var WdioManualController = /** @class */ (function (_super) {
|
|
|
130
130
|
});
|
|
131
131
|
});
|
|
132
132
|
};
|
|
133
|
-
return
|
|
134
|
-
}(util_1.
|
|
135
|
-
exports.
|
|
133
|
+
return WdioController;
|
|
134
|
+
}(util_1.Controller));
|
|
135
|
+
exports.WdioController = WdioController;
|
|
136
136
|
//# 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,+BAMe;AAUf;;;;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,YAAY,KAC5B,WAAW,EAAE,QAAQ,EACrB,oBAAoB,EAAE;gBACpB,IAAI,EAAE,oBAAa,CAAC,MAAM,CAAC,IAAI,CAAC;aACjC,OAEJ;AACH,CAAC;AAvBD,gCAuBC;AAED,sFAAsF;AACtF,SAAgB,cAAc,CAC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|
2
1
|
import type { WebDriver } from 'selenium-webdriver';
|
|
3
2
|
import type { Options } from 'selenium-webdriver/chrome';
|
|
3
|
+
import { Configuration, Controller } from './util';
|
|
4
4
|
interface WebDriverArgs extends Configuration {
|
|
5
5
|
options?: Options;
|
|
6
6
|
}
|
|
@@ -10,7 +10,7 @@ interface WebDriverArgs extends Configuration {
|
|
|
10
10
|
* @param arg Config to extend
|
|
11
11
|
*/
|
|
12
12
|
export declare function webdriverConfig(arg: WebDriverArgs): Options;
|
|
13
|
-
export declare class
|
|
13
|
+
export declare class WebdriverController extends Controller {
|
|
14
14
|
private driver;
|
|
15
15
|
constructor(driver: WebDriver);
|
|
16
16
|
protected executeScript(fn: string | (() => Promise<void>)): Promise<void>;
|
package/dist/webdriver.js
CHANGED
|
@@ -51,7 +51,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
-
exports.
|
|
54
|
+
exports.WebdriverController = exports.webdriverConfig = void 0;
|
|
55
55
|
var util_1 = require("./util");
|
|
56
56
|
/**
|
|
57
57
|
* Creates a Selenium config that uses axe extension
|
|
@@ -70,19 +70,19 @@ function webdriverConfig(arg) {
|
|
|
70
70
|
// Note: fragile, but selenium does not give us a real way to check this
|
|
71
71
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
72
72
|
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')) {
|
|
73
|
-
throw new
|
|
73
|
+
throw new util_1.HeadlessNotSupportedError();
|
|
74
74
|
}
|
|
75
75
|
return opts;
|
|
76
76
|
}
|
|
77
77
|
exports.webdriverConfig = webdriverConfig;
|
|
78
|
-
var
|
|
79
|
-
__extends(
|
|
80
|
-
function
|
|
78
|
+
var WebdriverController = /** @class */ (function (_super) {
|
|
79
|
+
__extends(WebdriverController, _super);
|
|
80
|
+
function WebdriverController(driver) {
|
|
81
81
|
var _this = _super.call(this) || this;
|
|
82
82
|
_this.driver = driver;
|
|
83
83
|
return _this;
|
|
84
84
|
}
|
|
85
|
-
|
|
85
|
+
WebdriverController.prototype.executeScript = function (fn) {
|
|
86
86
|
return __awaiter(this, void 0, void 0, function () {
|
|
87
87
|
var script;
|
|
88
88
|
return __generator(this, function (_a) {
|
|
@@ -97,7 +97,7 @@ var WebdriverManualController = /** @class */ (function (_super) {
|
|
|
97
97
|
});
|
|
98
98
|
});
|
|
99
99
|
};
|
|
100
|
-
return
|
|
101
|
-
}(util_1.
|
|
102
|
-
exports.
|
|
100
|
+
return WebdriverController;
|
|
101
|
+
}(util_1.Controller));
|
|
102
|
+
exports.WebdriverController = WebdriverController;
|
|
103
103
|
//# 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,+BAMe;AAMf;;;;GAIG;AAEH,SAAgB,eAAe,CAAC,GAAkB;;IAChD,gHAAgH;IAChH,8DAA8D;IAC9D,IAAM,MAAM,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAA;IAE3C,IAAA,GAAG,GAAc,GAAG,IAAjB,EAAE,OAAO,GAAK,GAAG,QAAR,CAAQ;IAC5B,IAAA,qBAAc,EAAC,GAAG,CAAC,CAAA;IAEnB,IAAM,IAAI,GAAY,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAA;IA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