@applitools/spec-driver-playwright 1.9.0 → 1.9.1

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,27 @@
1
1
  # Changelog
2
2
 
3
+ ## [1.9.1](https://github.com/Applitools-Dev/sdk/compare/js/spec-driver-playwright@1.9.0...js/spec-driver-playwright@1.9.1) (2026-05-19)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * address CI regressions from executeBrowserCommands and Chromium 140+ service worker ([#3848](https://github.com/Applitools-Dev/sdk/issues/3848)) ([099ada5](https://github.com/Applitools-Dev/sdk/commit/099ada5e52d4153157b98c2203df428579527e49))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * @applitools/snippets bumped to 2.9.1
14
+ #### Bug Fixes
15
+
16
+ * declare @babel/preset-typescript dep for sandbox build ([#3815](https://github.com/Applitools-Dev/sdk/issues/3815)) ([10c44c6](https://github.com/Applitools-Dev/sdk/commit/10c44c66635f1ed4e0361f22ecebf2221c2cc912))
17
+ * @applitools/driver bumped to 1.26.1
18
+ #### Bug Fixes
19
+
20
+ * address CI regressions from executeBrowserCommands and Chromium 140+ service worker ([#3848](https://github.com/Applitools-Dev/sdk/issues/3848)) ([099ada5](https://github.com/Applitools-Dev/sdk/commit/099ada5e52d4153157b98c2203df428579527e49))
21
+
22
+
23
+
24
+
3
25
  ## [1.9.0](https://github.com/Applitools-Dev/sdk/compare/js/spec-driver-playwright@1.8.5...js/spec-driver-playwright@1.9.0) (2026-05-05)
4
26
 
5
27
 
@@ -48,28 +48,33 @@ async function handleToObject(handle) {
48
48
  return handle.jsonValue();
49
49
  }
50
50
  }
51
+ // Playwright 1.60 renamed its public classes with a leading underscore (Page → _Page,
52
+ // Frame → _Frame, etc.). Accept both so the SDK works on Playwright >=1.0 <1.60 and >=1.60.
53
+ function isPwInstanceOf(value, name) {
54
+ return utils.types.instanceOf(value, name) || utils.types.instanceOf(value, `_${name}`);
55
+ }
51
56
  function isDriver(page) {
52
57
  if (!page)
53
58
  return false;
54
- return utils.types.instanceOf(page, 'Page');
59
+ return isPwInstanceOf(page, 'Page');
55
60
  }
56
61
  exports.isDriver = isDriver;
57
62
  function isContext(frame) {
58
63
  if (!frame)
59
64
  return false;
60
- return utils.types.instanceOf(frame, 'Frame');
65
+ return isPwInstanceOf(frame, 'Frame');
61
66
  }
62
67
  exports.isContext = isContext;
63
68
  function isElement(element) {
64
69
  if (!element)
65
70
  return false;
66
- return utils.types.instanceOf(element, 'ElementHandle');
71
+ return isPwInstanceOf(element, 'ElementHandle');
67
72
  }
68
73
  exports.isElement = isElement;
69
74
  function isSelector(selector) {
70
75
  if (!selector)
71
76
  return false;
72
- return utils.types.isString(selector) || utils.types.instanceOf(selector, 'Locator');
77
+ return utils.types.isString(selector) || isPwInstanceOf(selector, 'Locator');
73
78
  }
74
79
  exports.isSelector = isSelector;
75
80
  function isStaleElementError(err) {
@@ -92,10 +97,10 @@ function toSelector(selector) {
92
97
  }
93
98
  exports.toSelector = toSelector;
94
99
  function toSimpleCommonSelector(selector) {
95
- if (utils.types.instanceOf(selector, 'Locator')) {
100
+ if (isPwInstanceOf(selector, 'Locator')) {
96
101
  selector = selector._selector;
97
102
  }
98
- else if (utils.types.instanceOf(selector, 'FrameLocator')) {
103
+ else if (isPwInstanceOf(selector, 'FrameLocator')) {
99
104
  selector = selector._frameSelector;
100
105
  }
101
106
  return utils.types.isString(selector) ? { selector } : null;
@@ -153,7 +158,7 @@ async function executeBrowserCommands(page, commands, logger) {
153
158
  }
154
159
  exports.executeBrowserCommands = executeBrowserCommands;
155
160
  async function findElement(frame, selector, parent) {
156
- if (utils.types.instanceOf(selector, 'Locator')) {
161
+ if (isPwInstanceOf(selector, 'Locator')) {
157
162
  return selector.elementHandle();
158
163
  }
159
164
  const root = parent !== null && parent !== void 0 ? parent : frame;
@@ -161,7 +166,7 @@ async function findElement(frame, selector, parent) {
161
166
  }
162
167
  exports.findElement = findElement;
163
168
  async function findElements(frame, selector, parent) {
164
- if (utils.types.instanceOf(selector, 'Locator')) {
169
+ if (isPwInstanceOf(selector, 'Locator')) {
165
170
  return (await selector.elementHandles());
166
171
  }
167
172
  const root = parent !== null && parent !== void 0 ? parent : frame;
@@ -286,7 +291,9 @@ async function build(env) {
286
291
  }
287
292
  }
288
293
  // TODO remove this once Playwright provides formal support for headless: 'new' (https://github.com/microsoft/playwright/issues/21194)
289
- if (headless) {
294
+ // Skip --headless=new when loading a Chrome extension: Chromium's new headless mode does not reliably
295
+ // load MV3 extensions, so fall back to Playwright's default behavior when `extension` is set.
296
+ if (headless && !extension) {
290
297
  options.args.push('--headless=new');
291
298
  delete options.headless;
292
299
  options.ignoreDefaultArgs.push('--headless');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applitools/spec-driver-playwright",
3
- "version": "1.9.0",
3
+ "version": "1.9.1",
4
4
  "keywords": [
5
5
  "playwright",
6
6
  "chrome devtools protocol",
@@ -40,7 +40,7 @@
40
40
  "up:framework": "echo \"$(jq '.devDependencies.playwright = $ENV.APPLITOOLS_FRAMEWORK_VERSION' ./package.json)\" > ./package.json"
41
41
  },
42
42
  "dependencies": {
43
- "@applitools/driver": "1.26.0",
43
+ "@applitools/driver": "1.26.1",
44
44
  "@applitools/utils": "1.14.4"
45
45
  },
46
46
  "devDependencies": {