@empiricalrun/playwright-utils 0.14.31 → 0.15.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 +16 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/playwright-extensions.d.ts +8 -0
- package/dist/playwright-extensions.d.ts.map +1 -0
- package/dist/playwright-extensions.js +3 -0
- package/dist/test/scripts/index.d.ts.map +1 -1
- package/dist/test/scripts/index.js +10 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @empiricalrun/playwright-utils
|
|
2
2
|
|
|
3
|
+
## 0.15.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- c2a778d: fix locator extension not working
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- fe63921: feat: add eslint autofix for unused vars
|
|
12
|
+
|
|
13
|
+
## 0.14.32
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- caace94: fix: highlighter options defaults
|
|
18
|
+
|
|
3
19
|
## 0.14.31
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACxD,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACxD,cAAc,SAAS,CAAC;AACxB,cAAc,yBAAyB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -22,3 +22,4 @@ var config_1 = require("./config");
|
|
|
22
22
|
Object.defineProperty(exports, "baseConfig", { enumerable: true, get: function () { return config_1.baseConfig; } });
|
|
23
23
|
Object.defineProperty(exports, "chromeStablePath", { enumerable: true, get: function () { return config_1.chromeStablePath; } });
|
|
24
24
|
__exportStar(require("./email"), exports);
|
|
25
|
+
__exportStar(require("./playwright-extensions"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"playwright-extensions.d.ts","sourceRoot":"","sources":["../src/playwright-extensions.ts"],"names":[],"mappings":"AASA,MAAM,MAAM,eAAe,GAAG;IAC5B,KAAK,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CAC7C,CAAC;AAEF,OAAO,QAAQ,iBAAiB,CAAC;IAC/B,UAAU,OAAQ,SAAQ,eAAe;KAAG;CAC7C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/test/scripts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAG7C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/test/scripts/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAG7C,OAAO,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAW3C,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,IAAI,EACV,OAAO,GAAE,eAAgC,QAwB1C"}
|
|
@@ -5,23 +5,28 @@ const logger_1 = require("../../logger");
|
|
|
5
5
|
const locator_highlights_1 = require("./locator-highlights");
|
|
6
6
|
const locator_vision_1 = require("./locator-vision");
|
|
7
7
|
const mouse_pointer_1 = require("./mouse-pointer");
|
|
8
|
-
|
|
8
|
+
const defaultOptions = {
|
|
9
9
|
mousePointerHighlighter: true,
|
|
10
10
|
locatorHighlighter: true,
|
|
11
11
|
visionMethods: true,
|
|
12
|
-
}
|
|
12
|
+
};
|
|
13
|
+
function injectLocatorHighlightScripts(page, options = defaultOptions) {
|
|
13
14
|
// TODO: if this method is used standalone (not through the fixture),
|
|
14
15
|
// then page.locator.query() will throw a type error.
|
|
16
|
+
const opts = {
|
|
17
|
+
...defaultOptions,
|
|
18
|
+
...options,
|
|
19
|
+
};
|
|
15
20
|
try {
|
|
16
|
-
if (
|
|
21
|
+
if (opts.mousePointerHighlighter) {
|
|
17
22
|
// pointer highlighter and focus highlighter
|
|
18
23
|
(0, mouse_pointer_1.addMousePointerHighlighter)(page);
|
|
19
24
|
}
|
|
20
|
-
if (
|
|
25
|
+
if (opts.locatorHighlighter) {
|
|
21
26
|
// playwright locator highlighter
|
|
22
27
|
(0, locator_highlights_1.addLocatorHighlights)(page);
|
|
23
28
|
}
|
|
24
|
-
if (
|
|
29
|
+
if (opts.visionMethods) {
|
|
25
30
|
// patch with vision methods
|
|
26
31
|
(0, locator_vision_1.addLocatorVisionMethods)(page);
|
|
27
32
|
}
|