@empiricalrun/playwright-utils 0.19.40 → 0.20.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/CHANGELOG.md +13 -0
- package/dist/overlay-tests/click.spec.js +1 -2
- package/dist/test/index.d.ts.map +1 -1
- package/dist/test/index.js +4 -6
- package/dist/test/scripts/agent-capabilities.d.ts +2 -2
- package/dist/test/scripts/agent-capabilities.d.ts.map +1 -1
- package/dist/test/scripts/agent-capabilities.js +7 -7
- package/dist/test/scripts/index.d.ts +2 -2
- package/dist/test/scripts/index.d.ts.map +1 -1
- package/dist/test/scripts/index.js +2 -8
- package/dist/test/scripts/pw-locator-patch/highlight/click.d.ts +2 -2
- package/dist/test/scripts/pw-locator-patch/highlight/click.d.ts.map +1 -1
- package/dist/test/scripts/pw-locator-patch/highlight/click.js +6 -7
- package/dist/test/scripts/pw-locator-patch/highlight/hover.d.ts +1 -1
- package/dist/test/scripts/pw-locator-patch/highlight/hover.d.ts.map +1 -1
- package/dist/test/scripts/pw-locator-patch/highlight/is-checked.d.ts +1 -1
- package/dist/test/scripts/pw-locator-patch/highlight/is-checked.d.ts.map +1 -1
- package/dist/test/scripts/pw-locator-patch/highlight/is-checked.js +3 -3
- package/dist/test/scripts/pw-locator-patch/highlight/is-disabled.d.ts +1 -1
- package/dist/test/scripts/pw-locator-patch/highlight/is-disabled.d.ts.map +1 -1
- package/dist/test/scripts/pw-locator-patch/highlight/is-disabled.js +3 -3
- package/dist/test/scripts/pw-locator-patch/highlight/is-editable.d.ts +1 -1
- package/dist/test/scripts/pw-locator-patch/highlight/is-editable.d.ts.map +1 -1
- package/dist/test/scripts/pw-locator-patch/highlight/is-editable.js +3 -3
- package/dist/test/scripts/pw-locator-patch/vision/query.d.ts +2 -2
- package/dist/test/scripts/pw-locator-patch/vision/query.d.ts.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @empiricalrun/playwright-utils
|
|
2
2
|
|
|
3
|
+
## 0.20.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 96f34f4: fix: Pass testFn as parameter to patch methods instead of using global variable
|
|
8
|
+
|
|
9
|
+
## 0.19.41
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [f39500b]
|
|
14
|
+
- @empiricalrun/test-gen@0.42.29
|
|
15
|
+
|
|
3
16
|
## 0.19.40
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -27,8 +27,7 @@ test_1.test.afterAll(() => {
|
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
test_1.test.beforeEach(async ({ page }) => {
|
|
30
|
-
|
|
31
|
-
(0, test_2.injectLocatorHighlightScripts)(page);
|
|
30
|
+
(0, test_2.injectLocatorHighlightScripts)(page, test_1.test);
|
|
32
31
|
});
|
|
33
32
|
(0, test_1.test)("should dismiss survicate for click", async ({ page }) => {
|
|
34
33
|
await page.goto(`http://localhost:${PORT}/survey.html`);
|
package/dist/test/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,IAAI,EACJ,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,QAAQ,EACT,MAAM,kBAAkB,CAAC;AAK1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,IAAI,CAAC;IACX,yBAAyB,EAAE,CACzB,OAAO,CAAC,EAAE,qBAAqB,KAC5B,OAAO,CAAC;QAAE,OAAO,EAAE,cAAc,CAAC;QAAC,IAAI,EAAE,IAAI,CAAA;KAAE,CAAC,CAAC;IACtD,UAAU,EAAE,IAAI,CAAC;CAClB,CAAC;AAIF,eAAO,MAAM,eAAe,WAClB,SACN,kBAAkB,GAAG,qBAAqB,EAC1C,oBAAoB,GAAG,uBAAuB,CAC/C,YACQ,eAAe,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,cAAc,EACd,qBAAqB,EACrB,IAAI,EACJ,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,QAAQ,EACT,MAAM,kBAAkB,CAAC;AAK1B,OAAO,EAAE,6BAA6B,EAAE,MAAM,WAAW,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,KAAK,WAAW,GAAG;IACjB,IAAI,EAAE,IAAI,CAAC;IACX,yBAAyB,EAAE,CACzB,OAAO,CAAC,EAAE,qBAAqB,KAC5B,OAAO,CAAC;QAAE,OAAO,EAAE,cAAc,CAAC;QAAC,IAAI,EAAE,IAAI,CAAA;KAAE,CAAC,CAAC;IACtD,UAAU,EAAE,IAAI,CAAC;CAClB,CAAC;AAIF,eAAO,MAAM,eAAe,WAClB,SACN,kBAAkB,GAAG,qBAAqB,EAC1C,oBAAoB,GAAG,uBAAuB,CAC/C,YACQ,eAAe,uHA0DzB,CAAC;AAEF,OAAO,EAAE,6BAA6B,EAAE,CAAC"}
|
package/dist/test/index.js
CHANGED
|
@@ -18,21 +18,21 @@ const baseTestFixture = function (testFn, options = {
|
|
|
18
18
|
}) {
|
|
19
19
|
const extendedTestFn = testFn.extend({
|
|
20
20
|
page: async ({ page }, use) => {
|
|
21
|
-
(0, scripts_1.injectLocatorHighlightScripts)(page, options);
|
|
21
|
+
(0, scripts_1.injectLocatorHighlightScripts)(page, extendedTestFn, options);
|
|
22
22
|
await use(page);
|
|
23
23
|
},
|
|
24
24
|
customContextPageProvider: async ({ browser }, use, testInfo) => {
|
|
25
25
|
const contexts = [];
|
|
26
|
-
async function createContext(
|
|
26
|
+
async function createContext(contextOptions = {}) {
|
|
27
27
|
const pageContext = await browser.newContext({
|
|
28
|
-
...
|
|
28
|
+
...contextOptions,
|
|
29
29
|
recordVideo: {
|
|
30
30
|
dir: path_1.default.join(testInfo.project.outputDir, videoStore, testInfo.testId),
|
|
31
31
|
},
|
|
32
32
|
});
|
|
33
33
|
contexts.push(pageContext);
|
|
34
34
|
const customPage = await pageContext.newPage();
|
|
35
|
-
(0, scripts_1.injectLocatorHighlightScripts)(customPage);
|
|
35
|
+
(0, scripts_1.injectLocatorHighlightScripts)(customPage, extendedTestFn, options);
|
|
36
36
|
return { context: pageContext, page: customPage };
|
|
37
37
|
}
|
|
38
38
|
await use(createContext);
|
|
@@ -58,8 +58,6 @@ const baseTestFixture = function (testFn, options = {
|
|
|
58
58
|
{ auto: true },
|
|
59
59
|
],
|
|
60
60
|
});
|
|
61
|
-
//@ts-ignore
|
|
62
|
-
global.testFn = extendedTestFn;
|
|
63
61
|
return extendedTestFn;
|
|
64
62
|
};
|
|
65
63
|
exports.baseTestFixture = baseTestFixture;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { Page } from "@playwright/test";
|
|
2
|
-
export declare function addAgentCapabilities(page: Page): void;
|
|
1
|
+
import type { Page, PlaywrightTestArgs, PlaywrightTestOptions, PlaywrightWorkerArgs, PlaywrightWorkerOptions, TestType } from "@playwright/test";
|
|
2
|
+
export declare function addAgentCapabilities(page: Page, testFn: TestType<PlaywrightTestArgs & PlaywrightTestOptions, PlaywrightWorkerArgs & PlaywrightWorkerOptions>): void;
|
|
3
3
|
//# sourceMappingURL=agent-capabilities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-capabilities.d.ts","sourceRoot":"","sources":["../../../src/test/scripts/agent-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"agent-capabilities.d.ts","sourceRoot":"","sources":["../../../src/test/scripts/agent-capabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACJ,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,QAAQ,EACT,MAAM,kBAAkB,CAAC;AAe1B,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,QAAQ,CACd,kBAAkB,GAAG,qBAAqB,EAC1C,oBAAoB,GAAG,uBAAuB,CAC/C,QAMF"}
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addAgentCapabilities = void 0;
|
|
4
4
|
const click_1 = require("./pw-locator-patch/highlight/click");
|
|
5
|
-
function
|
|
6
|
-
|
|
5
|
+
function applyPatchForAutoDismissOverlay(page, testFn) {
|
|
6
|
+
const LocatorClass = page.locator("").constructor;
|
|
7
|
+
(0, click_1.patchClick)(LocatorClass, testFn);
|
|
8
|
+
}
|
|
9
|
+
function addAgentCapabilities(page, testFn) {
|
|
10
|
+
applyPatchForAutoDismissOverlay(page, testFn);
|
|
7
11
|
page.context().on("page", async (newPage) => {
|
|
8
|
-
applyPatchForAutoDismissOverlay(newPage);
|
|
12
|
+
applyPatchForAutoDismissOverlay(newPage, testFn);
|
|
9
13
|
});
|
|
10
14
|
}
|
|
11
15
|
exports.addAgentCapabilities = addAgentCapabilities;
|
|
12
|
-
function applyPatchForAutoDismissOverlay(page) {
|
|
13
|
-
const LocatorClass = page.locator("").constructor;
|
|
14
|
-
(0, click_1.patchClick)(LocatorClass);
|
|
15
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Page } from "@playwright/test";
|
|
1
|
+
import type { Page, PlaywrightTestArgs, PlaywrightTestOptions, PlaywrightWorkerArgs, PlaywrightWorkerOptions, TestType } from "@playwright/test";
|
|
2
2
|
import { HighlighterOpts } from "../types";
|
|
3
|
-
export declare function injectLocatorHighlightScripts(page: Page, options?: HighlighterOpts): void;
|
|
3
|
+
export declare function injectLocatorHighlightScripts(page: Page, testFn: TestType<PlaywrightTestArgs & PlaywrightTestOptions, PlaywrightWorkerArgs & PlaywrightWorkerOptions>, options?: HighlighterOpts): void;
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/test/scripts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/test/scripts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACJ,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,QAAQ,EACT,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAa3C,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,QAAQ,CACd,kBAAkB,GAAG,qBAAqB,EAC1C,oBAAoB,GAAG,uBAAuB,CAC/C,EACD,OAAO,GAAE,eAAgC,QAsB1C"}
|
|
@@ -12,29 +12,23 @@ const defaultOptions = {
|
|
|
12
12
|
visionMethods: true,
|
|
13
13
|
agentCapabilities: true,
|
|
14
14
|
};
|
|
15
|
-
function injectLocatorHighlightScripts(page, options = defaultOptions) {
|
|
16
|
-
// TODO: if this method is used standalone (not through the fixture),
|
|
17
|
-
// then page.locator.query() will throw a type error.
|
|
15
|
+
function injectLocatorHighlightScripts(page, testFn, options = defaultOptions) {
|
|
18
16
|
const opts = {
|
|
19
17
|
...defaultOptions,
|
|
20
18
|
...options,
|
|
21
19
|
};
|
|
22
20
|
try {
|
|
23
21
|
if (opts.mousePointerHighlighter) {
|
|
24
|
-
// pointer highlighter and focus highlighter
|
|
25
22
|
(0, mouse_pointer_1.addMousePointerHighlighter)(page);
|
|
26
23
|
}
|
|
27
24
|
if (opts.locatorHighlighter) {
|
|
28
|
-
// playwright locator highlighter
|
|
29
25
|
(0, locator_highlights_1.addLocatorHighlights)(page);
|
|
30
26
|
}
|
|
31
27
|
if (opts.visionMethods) {
|
|
32
|
-
// patch with vision methods
|
|
33
28
|
(0, locator_vision_1.addLocatorVisionMethods)(page);
|
|
34
29
|
}
|
|
35
30
|
if (opts.agentCapabilities) {
|
|
36
|
-
|
|
37
|
-
(0, agent_capabilities_1.addAgentCapabilities)(page);
|
|
31
|
+
(0, agent_capabilities_1.addAgentCapabilities)(page, testFn);
|
|
38
32
|
}
|
|
39
33
|
}
|
|
40
34
|
catch (e) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Locator } from "@playwright/test";
|
|
1
|
+
import type { Locator, PlaywrightTestArgs, PlaywrightTestOptions, PlaywrightWorkerArgs, PlaywrightWorkerOptions, TestType } from "@playwright/test";
|
|
2
2
|
type OverlayElement = {
|
|
3
3
|
interceptor: string;
|
|
4
4
|
parent: string | undefined;
|
|
@@ -6,6 +6,6 @@ type OverlayElement = {
|
|
|
6
6
|
export declare function extractInterceptingElement(errorMessage: string): OverlayElement | undefined;
|
|
7
7
|
export declare function patchClick(LocatorClass: Function & {
|
|
8
8
|
prototype: Locator;
|
|
9
|
-
}): void;
|
|
9
|
+
}, testFn: TestType<PlaywrightTestArgs & PlaywrightTestOptions, PlaywrightWorkerArgs & PlaywrightWorkerOptions>): void;
|
|
10
10
|
export {};
|
|
11
11
|
//# sourceMappingURL=click.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"click.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/click.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"click.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/click.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,OAAO,EAEP,kBAAkB,EAClB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,QAAQ,EACT,MAAM,kBAAkB,CAAC;AA6B1B,KAAK,cAAc,GAAG;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5B,CAAC;AAEF,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,MAAM,GACnB,cAAc,GAAG,SAAS,CAiC5B;AA6GD,wBAAgB,UAAU,CACxB,YAAY,EAAE,QAAQ,GAAG;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,EAC/C,MAAM,EAAE,QAAQ,CACd,kBAAkB,GAAG,qBAAqB,EAC1C,oBAAoB,GAAG,uBAAuB,CAC/C,QAmDF"}
|
|
@@ -147,15 +147,14 @@ ${promptAddition}
|
|
|
147
147
|
},
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
|
-
function annotateForReport(description) {
|
|
150
|
+
function annotateForReport(testFn, description) {
|
|
151
151
|
console.log(`[Overlay dismissal]: ${description}`);
|
|
152
|
-
|
|
153
|
-
global.testFn?.info().annotations.push({
|
|
152
|
+
testFn.info().annotations.push({
|
|
154
153
|
type: "auto-dismiss-overlay",
|
|
155
154
|
description,
|
|
156
155
|
});
|
|
157
156
|
}
|
|
158
|
-
function patchClick(LocatorClass) {
|
|
157
|
+
function patchClick(LocatorClass, testFn) {
|
|
159
158
|
// Check if already patched
|
|
160
159
|
if (isClickPatched.get(LocatorClass)) {
|
|
161
160
|
return;
|
|
@@ -181,15 +180,15 @@ function patchClick(LocatorClass) {
|
|
|
181
180
|
catch (err) {
|
|
182
181
|
// Ignoring this error
|
|
183
182
|
}
|
|
184
|
-
annotateForReport(`Attempting to auto-dismiss overlay: ${description(overlayElement)}`);
|
|
183
|
+
annotateForReport(testFn, `Attempting to auto-dismiss overlay: ${description(overlayElement)}`);
|
|
185
184
|
try {
|
|
186
185
|
await runAgentOnOverlay(this._frame._page, overlayElement);
|
|
187
186
|
}
|
|
188
187
|
catch (agentError) {
|
|
189
|
-
annotateForReport(`Error in overlay dismiss: ${agentError.toString()}`);
|
|
188
|
+
annotateForReport(testFn, `Error in overlay dismiss: ${agentError.toString()}`);
|
|
190
189
|
throw originalError;
|
|
191
190
|
}
|
|
192
|
-
annotateForReport("Overlay was dismissed, retrying original action");
|
|
191
|
+
annotateForReport(testFn, "Overlay was dismissed, retrying original action");
|
|
193
192
|
await originalClick.apply(this, [options]);
|
|
194
193
|
}
|
|
195
194
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hover.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/hover.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"hover.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/hover.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAOhD,wBAAgB,UAAU,CAAC,YAAY,EAAE,QAAQ,GAAG;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,QAyBzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-checked.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/is-checked.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"is-checked.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/is-checked.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAOhD,wBAAgB,cAAc,CAC5B,YAAY,EAAE,QAAQ,GAAG;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,QAiChD"}
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.patchIsChecked = void 0;
|
|
4
4
|
const logger_1 = require("../../../../logger");
|
|
5
5
|
const constants_1 = require("../../../constants");
|
|
6
|
-
const
|
|
6
|
+
const isIsCheckedPatched = new WeakMap();
|
|
7
7
|
function patchIsChecked(LocatorClass) {
|
|
8
|
-
if (
|
|
8
|
+
if (isIsCheckedPatched.get(LocatorClass)) {
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
11
|
const originalIsChecked = LocatorClass.prototype.isChecked;
|
|
@@ -33,6 +33,6 @@ function patchIsChecked(LocatorClass) {
|
|
|
33
33
|
}
|
|
34
34
|
return result;
|
|
35
35
|
};
|
|
36
|
-
|
|
36
|
+
isIsCheckedPatched.set(LocatorClass, true);
|
|
37
37
|
}
|
|
38
38
|
exports.patchIsChecked = patchIsChecked;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-disabled.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/is-disabled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"is-disabled.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/is-disabled.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAOhD,wBAAgB,eAAe,CAC7B,YAAY,EAAE,QAAQ,GAAG;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,QAiChD"}
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.patchIsDisabled = void 0;
|
|
4
4
|
const logger_1 = require("../../../../logger");
|
|
5
5
|
const constants_1 = require("../../../constants");
|
|
6
|
-
const
|
|
6
|
+
const isIsDisabledPatched = new WeakMap();
|
|
7
7
|
function patchIsDisabled(LocatorClass) {
|
|
8
|
-
if (
|
|
8
|
+
if (isIsDisabledPatched.get(LocatorClass)) {
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
11
|
const originalIsDisabled = LocatorClass.prototype.isDisabled;
|
|
@@ -33,6 +33,6 @@ function patchIsDisabled(LocatorClass) {
|
|
|
33
33
|
}
|
|
34
34
|
return result;
|
|
35
35
|
};
|
|
36
|
-
|
|
36
|
+
isIsDisabledPatched.set(LocatorClass, true);
|
|
37
37
|
}
|
|
38
38
|
exports.patchIsDisabled = patchIsDisabled;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-editable.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/is-editable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"is-editable.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/highlight/is-editable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAOhD,wBAAgB,eAAe,CAC7B,YAAY,EAAE,QAAQ,GAAG;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,QAgChD"}
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.patchIsEditable = void 0;
|
|
4
4
|
const logger_1 = require("../../../../logger");
|
|
5
5
|
const constants_1 = require("../../../constants");
|
|
6
|
-
const
|
|
6
|
+
const isIsEditablePatched = new WeakMap();
|
|
7
7
|
function patchIsEditable(LocatorClass) {
|
|
8
|
-
if (
|
|
8
|
+
if (isIsEditablePatched.get(LocatorClass)) {
|
|
9
9
|
return;
|
|
10
10
|
}
|
|
11
11
|
const originalIsEditable = LocatorClass.prototype.isEditable;
|
|
@@ -32,6 +32,6 @@ function patchIsEditable(LocatorClass) {
|
|
|
32
32
|
}
|
|
33
33
|
return result;
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
isIsEditablePatched.set(LocatorClass, true);
|
|
36
36
|
}
|
|
37
37
|
exports.patchIsEditable = patchIsEditable;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Locator } from "@playwright/test";
|
|
2
|
-
export declare function patchQuery(LocatorClass: {
|
|
1
|
+
import type { Locator } from "@playwright/test";
|
|
2
|
+
export declare function patchQuery(LocatorClass: Function & {
|
|
3
3
|
prototype: Locator;
|
|
4
4
|
}): void;
|
|
5
5
|
//# sourceMappingURL=query.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/vision/query.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../../../../src/test/scripts/pw-locator-patch/vision/query.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD,wBAAgB,UAAU,CAAC,YAAY,EAAE,QAAQ,GAAG;IAAE,SAAS,EAAE,OAAO,CAAA;CAAE,QAOzE"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@empiricalrun/playwright-utils",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"registry": "https://registry.npmjs.org/",
|
|
6
6
|
"access": "public"
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"playwright-core": "1.47.1",
|
|
43
43
|
"puppeteer-extra-plugin-recaptcha": "^3.6.8",
|
|
44
44
|
"rimraf": "^6.0.1",
|
|
45
|
-
"@empiricalrun/llm": "^0.9.34",
|
|
46
45
|
"@empiricalrun/r2-uploader": "^0.3.8",
|
|
47
|
-
"@empiricalrun/test-gen": "^0.42.
|
|
46
|
+
"@empiricalrun/test-gen": "^0.42.29",
|
|
47
|
+
"@empiricalrun/llm": "^0.9.34"
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"dev": "tsc --build --watch",
|