@axe-core/watcher 1.8.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cypress.d.ts +0 -4
- package/dist/cypress.js +1 -58
- package/dist/cypress.js.map +1 -1
- package/dist/cypressCommands.d.ts +6 -0
- package/dist/cypressCommands.js +101 -21
- package/dist/cypressCommands.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/playwright.d.ts +2 -0
- package/dist/playwright.js +3 -1
- package/dist/playwright.js.map +1 -1
- package/dist/playwrightWrapping.d.ts +20 -0
- package/dist/playwrightWrapping.js +827 -0
- package/dist/playwrightWrapping.js.map +1 -0
- package/extension/background.js +1 -1
- package/extension/content.js +1 -1
- package/extension/manifest.json +1 -1
- package/package.json +4 -3
package/dist/cypress.d.ts
CHANGED
|
@@ -6,7 +6,3 @@ import { Configuration } from './util';
|
|
|
6
6
|
* @param config Cypress config to extend
|
|
7
7
|
*/
|
|
8
8
|
export declare const cypressConfig: (config: Cypress.ConfigOptions & Configuration) => Cypress.ConfigOptions;
|
|
9
|
-
/** Methods we wrap on the provided `cy` instance. */
|
|
10
|
-
export declare const WRAPPED_METHODS: ReadonlyArray<keyof Cypress.cy>;
|
|
11
|
-
/** Wrap the given Cypress `cy` object, ensuring axe-core analysis is run after each command. */
|
|
12
|
-
export declare const wrapCy: (cy: Cypress.cy) => Cypress.cy;
|
package/dist/cypress.js
CHANGED
|
@@ -31,7 +31,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
31
31
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
32
32
|
};
|
|
33
33
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
|
-
exports.
|
|
34
|
+
exports.cypressConfig = void 0;
|
|
35
35
|
var uuid_1 = require("uuid");
|
|
36
36
|
var util_1 = require("./util");
|
|
37
37
|
/**
|
|
@@ -78,61 +78,4 @@ var cypressConfig = function (config) {
|
|
|
78
78
|
} }) });
|
|
79
79
|
};
|
|
80
80
|
exports.cypressConfig = cypressConfig;
|
|
81
|
-
/** Methods we wrap on the provided `cy` instance. */
|
|
82
|
-
exports.WRAPPED_METHODS = [
|
|
83
|
-
'blur',
|
|
84
|
-
'check',
|
|
85
|
-
'clear',
|
|
86
|
-
'click',
|
|
87
|
-
'dblclick',
|
|
88
|
-
'focus',
|
|
89
|
-
'get',
|
|
90
|
-
'go',
|
|
91
|
-
'invoke',
|
|
92
|
-
'reload',
|
|
93
|
-
'scrollIntoView',
|
|
94
|
-
'scrollTo',
|
|
95
|
-
'select',
|
|
96
|
-
'submit',
|
|
97
|
-
'trigger',
|
|
98
|
-
'type',
|
|
99
|
-
'uncheck',
|
|
100
|
-
'visit',
|
|
101
|
-
'wait'
|
|
102
|
-
];
|
|
103
|
-
/** Wrap the given Cypress `cy` object, ensuring axe-core analysis is run after each command. */
|
|
104
|
-
var wrapCy = function (cy) {
|
|
105
|
-
// We cannot wrap the `cy` instance itself, but instead, wrap its prototype.
|
|
106
|
-
// We don't have access to the $Chainer prototype, so use the returned value from `cy.wrap('')`.
|
|
107
|
-
var proto = Object.getPrototypeOf(cy.wrap(''));
|
|
108
|
-
var _loop_1 = function (method) {
|
|
109
|
-
var old = proto[method];
|
|
110
|
-
proto[method] = function () {
|
|
111
|
-
var _this = this;
|
|
112
|
-
var params = [];
|
|
113
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
114
|
-
params[_i] = arguments[_i];
|
|
115
|
-
}
|
|
116
|
-
return old.apply(this, params).then(function ($element) {
|
|
117
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
118
|
-
_this.window().then(function (win) {
|
|
119
|
-
if (win && !win.__AXE_WATCHER_HAS_VISITED) {
|
|
120
|
-
/**
|
|
121
|
-
* Set a flag on the Window to indicate that a wrapped method has been called.
|
|
122
|
-
* This is used to determine whether we should call `axeFlush` after the test.
|
|
123
|
-
*/
|
|
124
|
-
win.__AXE_WATCHER_HAS_VISITED = true;
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
return _this.axeAnalyze({ __UserRequestedAnalyze: false }).then(function () { return $element; });
|
|
128
|
-
});
|
|
129
|
-
};
|
|
130
|
-
};
|
|
131
|
-
for (var _i = 0, WRAPPED_METHODS_1 = exports.WRAPPED_METHODS; _i < WRAPPED_METHODS_1.length; _i++) {
|
|
132
|
-
var method = WRAPPED_METHODS_1[_i];
|
|
133
|
-
_loop_1(method);
|
|
134
|
-
}
|
|
135
|
-
return cy;
|
|
136
|
-
};
|
|
137
|
-
exports.wrapCy = wrapCy;
|
|
138
81
|
//# sourceMappingURL=cypress.js.map
|
package/dist/cypress.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cypress.js","sourceRoot":"","sources":["../src/cypress.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,6BAAiC;AACjC,+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,wBACT,GAAG;QACN,+CAA+C;QAC/C,kFAAkF;QAClF,SAAS,EAAE,GAAG,CAAC,SAAS,IAAI,IAAA,SAAI,GAAE;QAClC,sDAAsD;QACtD,OAAO,EAAE,IAAI,IACb,CAAA;IACF,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;;gBAAE,cAAO;qBAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;oBAAP,6BAA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AO,EAAP,IAAO;oBAAP,6BAAO;;gBACzB,MAAA,MAAA,UAAU,CAAC,GAAG,0CAAE,eAAe,4EAAG,EAAE,GAAK,IAAI,SAAC,CAAA;gBAE9C,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;AA9CY,QAAA,aAAa,iBA8CzB"}
|
|
@@ -14,6 +14,12 @@ declare global {
|
|
|
14
14
|
axeStart(): Chainable<void>;
|
|
15
15
|
/** Stop automatic analysis mode. */
|
|
16
16
|
axeStop(): Chainable<void>;
|
|
17
|
+
/** Access Cypress internal state */
|
|
18
|
+
state(state: any): any;
|
|
19
|
+
subject?: () => any;
|
|
17
20
|
}
|
|
18
21
|
}
|
|
19
22
|
}
|
|
23
|
+
declare type CypressMethod = keyof Cypress.Chainable;
|
|
24
|
+
/** Commands we wrap to help us identify new page states. */
|
|
25
|
+
export declare const WRAPPED_COMMANDS: ReadonlyArray<CypressMethod>;
|
package/dist/cypressCommands.js
CHANGED
|
@@ -1,27 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* istanbul ignore file: This file is basically untestable due to how Cypress works. Instead, it's covered by our E2E suite and manual testing. */
|
|
3
|
-
var __assign = (this && this.__assign) || function () {
|
|
4
|
-
__assign = Object.assign || function(t) {
|
|
5
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
6
|
-
s = arguments[i];
|
|
7
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
8
|
-
t[p] = s[p];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
|
-
return __assign.apply(this, arguments);
|
|
13
|
-
};
|
|
14
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
|
|
16
|
-
Cypress.Commands.overwrite('visit', function (originalFn, url, options) {
|
|
17
|
-
if (options === void 0) { options = {}; }
|
|
18
|
-
var oldOnBeforeLoad = options.onBeforeLoad || (function () { return undefined; });
|
|
19
|
-
options.onBeforeLoad = function (win) {
|
|
20
|
-
win.__AXE_WATCHER_HAS_VISITED = true;
|
|
21
|
-
oldOnBeforeLoad(win);
|
|
22
|
-
};
|
|
23
|
-
return originalFn(__assign(__assign({}, options), { url: url }));
|
|
24
|
-
});
|
|
4
|
+
exports.WRAPPED_COMMANDS = void 0;
|
|
25
5
|
/**
|
|
26
6
|
* Has the user stopped automatic mode.
|
|
27
7
|
*
|
|
@@ -101,4 +81,104 @@ Cypress.Commands.add('axeStop', function () {
|
|
|
101
81
|
});
|
|
102
82
|
});
|
|
103
83
|
});
|
|
84
|
+
/** Commands we wrap to help us identify new page states. */
|
|
85
|
+
exports.WRAPPED_COMMANDS = [
|
|
86
|
+
'blur',
|
|
87
|
+
'check',
|
|
88
|
+
'clear',
|
|
89
|
+
'click',
|
|
90
|
+
'dblclick',
|
|
91
|
+
'focus',
|
|
92
|
+
'go',
|
|
93
|
+
'reload',
|
|
94
|
+
'scrollIntoView',
|
|
95
|
+
'scrollTo',
|
|
96
|
+
'select',
|
|
97
|
+
'submit',
|
|
98
|
+
'trigger',
|
|
99
|
+
'type',
|
|
100
|
+
'uncheck',
|
|
101
|
+
'wait'
|
|
102
|
+
];
|
|
103
|
+
/**
|
|
104
|
+
* Wrapped commands queue an axe run before calling the original method. This can seem
|
|
105
|
+
* a little counter-intuitive, but the reason we do this is so that we make sure we wait
|
|
106
|
+
* for the existing page state to be analyzed before performing our action.
|
|
107
|
+
*
|
|
108
|
+
* We rely on future commands to detect any new page state created by the current command.
|
|
109
|
+
* The last command that runs relies on the flush to catch the last page state.
|
|
110
|
+
*/
|
|
111
|
+
exports.WRAPPED_COMMANDS.forEach(function (method) {
|
|
112
|
+
return Cypress.Commands.overwrite(method, function (originalFn) {
|
|
113
|
+
var _a, _b, _c;
|
|
114
|
+
var args = [];
|
|
115
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
116
|
+
args[_i - 1] = arguments[_i];
|
|
117
|
+
}
|
|
118
|
+
var currentCommand = (_b = (_a = cy.state('current')) === null || _a === void 0 ? void 0 : _a.attributes) === null || _b === void 0 ? void 0 : _b.name;
|
|
119
|
+
// Some commands, like "type" call other commands internally, like "click".
|
|
120
|
+
// We don't want to enqueue a run in these scenarios because it can cause
|
|
121
|
+
// promises to be returned from commands, which Cypress does not allow.
|
|
122
|
+
// See: https://github.com/cypress-io/cypress/issues/19086
|
|
123
|
+
if (currentCommand && currentCommand !== method) {
|
|
124
|
+
return originalFn.apply(void 0, args);
|
|
125
|
+
}
|
|
126
|
+
// Get the previous subject from the chain so we can pass it along to child commands.
|
|
127
|
+
var subject = (_c = cy.subject) === null || _c === void 0 ? void 0 : _c.call(cy);
|
|
128
|
+
cy.window()
|
|
129
|
+
.then(function (win) {
|
|
130
|
+
if (win && !win.__AXE_WATCHER_HAS_VISITED) {
|
|
131
|
+
/**
|
|
132
|
+
* Set a flag on the Window to indicate that a wrapped method has been called.
|
|
133
|
+
* This is used to determine whether we should call `axeFlush` after the test.
|
|
134
|
+
*/
|
|
135
|
+
win.__AXE_WATCHER_HAS_VISITED = true;
|
|
136
|
+
}
|
|
137
|
+
})
|
|
138
|
+
.axeAnalyze({ __UserRequestedAnalyze: false })
|
|
139
|
+
// Set the subject back to the previous subject
|
|
140
|
+
.then(function () { return subject; })
|
|
141
|
+
.then(function () { return originalFn.apply(void 0, args); });
|
|
142
|
+
});
|
|
143
|
+
});
|
|
144
|
+
/**
|
|
145
|
+
* The `visit` command is wrapped differently than the other commands. This is because
|
|
146
|
+
* we need to actually visit and load the page before we can run axe.
|
|
147
|
+
*
|
|
148
|
+
* We run the original visit command, wait for the extension to be initialized, and then
|
|
149
|
+
* queue an axe run.
|
|
150
|
+
*/
|
|
151
|
+
Cypress.Commands.overwrite('visit', function (originalFn) {
|
|
152
|
+
var args = [];
|
|
153
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
154
|
+
args[_i - 1] = arguments[_i];
|
|
155
|
+
}
|
|
156
|
+
// We use `cy.wrap(null)` here just to get into the Cypress command queue.
|
|
157
|
+
cy.wrap(null)
|
|
158
|
+
.then(function () {
|
|
159
|
+
return originalFn.apply(void 0, args);
|
|
160
|
+
})
|
|
161
|
+
.then(function (visitResult) {
|
|
162
|
+
cy.window()
|
|
163
|
+
.then(function (win) {
|
|
164
|
+
if (win && !win.__AXE_WATCHER_HAS_VISITED) {
|
|
165
|
+
/**
|
|
166
|
+
* Set a flag on the Window to indicate that a wrapped method has been called.
|
|
167
|
+
* This is used to determine whether we should call `axeFlush` after the test.
|
|
168
|
+
*/
|
|
169
|
+
win.__AXE_WATCHER_HAS_VISITED = true;
|
|
170
|
+
}
|
|
171
|
+
// Wait for watcher to initialize before continuing.
|
|
172
|
+
return new Promise(function (resolve) {
|
|
173
|
+
var fn = function () {
|
|
174
|
+
win.removeEventListener('axe:initialized', fn);
|
|
175
|
+
resolve();
|
|
176
|
+
};
|
|
177
|
+
win.addEventListener('axe:initialized', fn);
|
|
178
|
+
});
|
|
179
|
+
})
|
|
180
|
+
.axeAnalyze({ __UserRequestedAnalyze: false })
|
|
181
|
+
.then(function () { return visitResult; });
|
|
182
|
+
});
|
|
183
|
+
});
|
|
104
184
|
//# sourceMappingURL=cypressCommands.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cypressCommands.js","sourceRoot":"","sources":["../src/cypressCommands.ts"],"names":[],"mappings":";AAAA,kJAAkJ
|
|
1
|
+
{"version":3,"file":"cypressCommands.js","sourceRoot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@@ -2,5 +2,5 @@
|
|
|
2
2
|
export { puppeteerConfig, PuppeteerController } from './puppeteer';
|
|
3
3
|
export { wdioConfig, wdioTestRunner, WdioController, wrapWdio } from './wdio';
|
|
4
4
|
export { webdriverConfig, WebdriverController } from './webdriver';
|
|
5
|
-
export { playwrightConfig, PlaywrightController } from './playwright';
|
|
6
|
-
export { cypressConfig
|
|
5
|
+
export { playwrightConfig, PlaywrightController, wrapPlaywright } 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.
|
|
4
|
+
exports.cypressConfig = exports.wrapPlaywright = exports.PlaywrightController = exports.playwrightConfig = exports.WebdriverController = exports.webdriverConfig = exports.wrapWdio = 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; } });
|
|
@@ -16,7 +16,7 @@ Object.defineProperty(exports, "WebdriverController", { enumerable: true, get: f
|
|
|
16
16
|
var playwright_1 = require("./playwright");
|
|
17
17
|
Object.defineProperty(exports, "playwrightConfig", { enumerable: true, get: function () { return playwright_1.playwrightConfig; } });
|
|
18
18
|
Object.defineProperty(exports, "PlaywrightController", { enumerable: true, get: function () { return playwright_1.PlaywrightController; } });
|
|
19
|
+
Object.defineProperty(exports, "wrapPlaywright", { enumerable: true, get: function () { return playwright_1.wrapPlaywright; } });
|
|
19
20
|
var cypress_1 = require("./cypress");
|
|
20
21
|
Object.defineProperty(exports, "cypressConfig", { enumerable: true, get: function () { return cypress_1.cypressConfig; } });
|
|
21
|
-
Object.defineProperty(exports, "wrapCy", { enumerable: true, get: function () { return cypress_1.wrapCy; } });
|
|
22
22
|
//# 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,+BAA6E;AAApE,kGAAA,UAAU,OAAA;AAAE,sGAAA,cAAc,OAAA;AAAE,sGAAA,cAAc,OAAA;AAAE,gGAAA,QAAQ,OAAA;AAC7D,yCAAkE;AAAzD,4GAAA,eAAe,OAAA;AAAE,gHAAA,mBAAmB,OAAA;AAC7C,
|
|
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,+BAA6E;AAApE,kGAAA,UAAU,OAAA;AAAE,sGAAA,cAAc,OAAA;AAAE,sGAAA,cAAc,OAAA;AAAE,gGAAA,QAAQ,OAAA;AAC7D,yCAAkE;AAAzD,4GAAA,eAAe,OAAA;AAAE,gHAAA,mBAAmB,OAAA;AAC7C,2CAIqB;AAHnB,8GAAA,gBAAgB,OAAA;AAChB,kHAAA,oBAAoB,OAAA;AACpB,4GAAA,cAAc,OAAA;AAEhB,qCAAyC;AAAhC,wGAAA,aAAa,OAAA"}
|
package/dist/playwright.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { LaunchOptions, Page } from 'playwright';
|
|
2
2
|
import { Configuration } from './util';
|
|
3
3
|
import Controller from './Controller';
|
|
4
|
+
import { wrapBrowserContext } from './playwrightWrapping';
|
|
4
5
|
/**
|
|
5
6
|
* Creates a Playwright config that uses axe extension
|
|
6
7
|
*
|
|
@@ -12,3 +13,4 @@ export declare class PlaywrightController extends Controller {
|
|
|
12
13
|
constructor(driver: Page);
|
|
13
14
|
protected executeScript(fn: string | (() => Promise<void>), ...args: unknown[]): Promise<void>;
|
|
14
15
|
}
|
|
16
|
+
export { wrapBrowserContext as wrapPlaywright };
|
package/dist/playwright.js
CHANGED
|
@@ -76,9 +76,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
76
76
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
77
77
|
};
|
|
78
78
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
79
|
-
exports.PlaywrightController = exports.playwrightConfig = void 0;
|
|
79
|
+
exports.wrapPlaywright = exports.PlaywrightController = exports.playwrightConfig = void 0;
|
|
80
80
|
var util_1 = require("./util");
|
|
81
81
|
var Controller_1 = __importDefault(require("./Controller"));
|
|
82
|
+
var playwrightWrapping_1 = require("./playwrightWrapping");
|
|
83
|
+
Object.defineProperty(exports, "wrapPlaywright", { enumerable: true, get: function () { return playwrightWrapping_1.wrapBrowserContext; } });
|
|
82
84
|
/**
|
|
83
85
|
* Creates a Playwright config that uses axe extension
|
|
84
86
|
*
|
package/dist/playwright.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwright.js","sourceRoot":"","sources":["../src/playwright.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+BAKe;AACf,4DAAqC;
|
|
1
|
+
{"version":3,"file":"playwright.js","sourceRoot":"","sources":["../src/playwright.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+BAKe;AACf,4DAAqC;AACrC,2DAAyD;AA4C1B,+FA5CtB,uCAAkB,OA4CkB;AA1C7C;;;;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;QAClC,cAAkB;aAAlB,UAAkB,EAAlB,qBAAkB,EAAlB,IAAkB;YAAlB,6BAAkB;;;;;4BAElB,qBAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,EAAA;;wBAApC,SAAoC,CAAA;;;;;KACrC;IACH,2BAAC;AAAD,CAAC,AAdD,CAA0C,oBAAU,GAcnD;AAdY,oDAAoB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Browser, BrowserContext, ElementHandle, Frame, FrameLocator, JSHandle, Keyboard, Locator, Mouse, Page, Touchscreen } from 'playwright';
|
|
2
|
+
import type { PlaywrightController } from './playwright';
|
|
3
|
+
declare const kWrapped: unique symbol;
|
|
4
|
+
declare type PossiblyWrapped<T> = T & {
|
|
5
|
+
[kWrapped]?: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare const isWrapped: <T>(o: PossiblyWrapped<T>) => boolean;
|
|
8
|
+
export declare const markAsWrapped: (o: unknown) => void;
|
|
9
|
+
export declare const wrapBrowserContext: (browserContext: PossiblyWrapped<BrowserContext>, controller: PlaywrightController) => BrowserContext;
|
|
10
|
+
export declare const wrapBrowser: (browser: PossiblyWrapped<Browser>, controller: PlaywrightController) => Browser;
|
|
11
|
+
export declare const wrapPage: (page: PossiblyWrapped<Page>, controller: PlaywrightController) => Page;
|
|
12
|
+
export declare const wrapElementHandle: (elementHandle: PossiblyWrapped<ElementHandle>, controller: PlaywrightController) => ElementHandle;
|
|
13
|
+
export declare const wrapFrame: (frame: PossiblyWrapped<Frame>, controller: PlaywrightController) => Frame;
|
|
14
|
+
export declare const wrapFrameLocator: (frameLocator: PossiblyWrapped<FrameLocator>, controller: PlaywrightController) => FrameLocator;
|
|
15
|
+
export declare const wrapLocator: (locator: PossiblyWrapped<Locator>, controller: PlaywrightController) => Locator;
|
|
16
|
+
export declare const wrapJSHandle: (jsHandle: PossiblyWrapped<JSHandle>, controller: PlaywrightController) => JSHandle;
|
|
17
|
+
export declare const wrapKeyboard: (keyboard: PossiblyWrapped<Keyboard>, controller: PlaywrightController) => Keyboard;
|
|
18
|
+
export declare const wrapMouse: (mouse: PossiblyWrapped<Mouse>, controller: PlaywrightController) => Mouse;
|
|
19
|
+
export declare const wrapTouchscreen: (touchscreen: PossiblyWrapped<Touchscreen>, controller: PlaywrightController) => Touchscreen;
|
|
20
|
+
export {};
|