@empiricalrun/playwright-utils 0.14.31 → 0.14.32

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,11 @@
1
1
  # @empiricalrun/playwright-utils
2
2
 
3
+ ## 0.14.32
4
+
5
+ ### Patch Changes
6
+
7
+ - caace94: fix: highlighter options defaults
8
+
3
9
  ## 0.14.31
4
10
 
5
11
  ### Patch Changes
@@ -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.14.32",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"