@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 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
@@ -2,4 +2,5 @@ export * from "./auth";
2
2
  export { solveRecaptcha } from "./captcha";
3
3
  export { baseConfig, chromeStablePath } from "./config";
4
4
  export * from "./email";
5
+ export * from "./playwright-extensions";
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -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,8 @@
1
+ export type EnhancedLocator = {
2
+ query(instruction: string): Promise<string>;
3
+ };
4
+ declare module "playwright-core" {
5
+ interface Locator extends EnhancedLocator {
6
+ }
7
+ }
8
+ //# sourceMappingURL=playwright-extensions.d.ts.map
@@ -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"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // Extend Playwright core interfaces transparently to the end user.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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;AAK3C,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,IAAI,EACV,OAAO,GAAE,eAIR,QAoBF"}
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
- function injectLocatorHighlightScripts(page, options = {
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 (options.mousePointerHighlighter) {
21
+ if (opts.mousePointerHighlighter) {
17
22
  // pointer highlighter and focus highlighter
18
23
  (0, mouse_pointer_1.addMousePointerHighlighter)(page);
19
24
  }
20
- if (options.locatorHighlighter) {
25
+ if (opts.locatorHighlighter) {
21
26
  // playwright locator highlighter
22
27
  (0, locator_highlights_1.addLocatorHighlights)(page);
23
28
  }
24
- if (options.visionMethods) {
29
+ if (opts.visionMethods) {
25
30
  // patch with vision methods
26
31
  (0, locator_vision_1.addLocatorVisionMethods)(page);
27
32
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@empiricalrun/playwright-utils",
3
- "version": "0.14.31",
3
+ "version": "0.15.0",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"