webdriverio 9.12.4 → 9.12.6

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.
@@ -32,7 +32,7 @@ import type { Selector } from '../../types.js';
32
32
  *
33
33
  * @alias $$
34
34
  * @param {String|Function} selector selector or JS Function to fetch multiple elements
35
- * @return {ElementArray}
35
+ * @return {WebdriverIO.ElementArray}
36
36
  * @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/example.html
37
37
  * @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/multipleElements.js#L6-L7
38
38
  * @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/multipleElements.js#L15-L24
@@ -50,7 +50,7 @@ import type { Selector } from '../../types.js';
50
50
  *
51
51
  * @alias $
52
52
  * @param {String|Function|Matcher} selector selector, JS Function, or Matcher object to fetch a certain element
53
- * @return {Element}
53
+ * @return {WebdriverIO.Element}
54
54
  * @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/example.html
55
55
  * @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/singleElements.js#L9-L10
56
56
  * @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/singleElements.js#L16-L25
@@ -23,7 +23,7 @@
23
23
  * @example https://github.com/webdriverio/example-recipes/blob/f5730428ec3605e856e90bf58be17c9c9da891de/queryElements/customStrategy.js#L2-L11
24
24
  * @example https://github.com/webdriverio/example-recipes/blob/f5730428ec3605e856e90bf58be17c9c9da891de/queryElements/example.html#L8-L12
25
25
  * @example https://github.com/webdriverio/example-recipes/blob/f5730428ec3605e856e90bf58be17c9c9da891de/queryElements/customStrategy.js#L16-L19
26
- * @return {Element}
26
+ * @return {WebdriverIO.Element}
27
27
  */
28
28
  export declare function custom$(this: WebdriverIO.Browser, strategyName: string, ...strategyArguments: unknown[]): Promise<WebdriverIO.Element>;
29
29
  //# sourceMappingURL=custom$.d.ts.map
@@ -29,7 +29,7 @@ import type { ReactSelectorOptions } from '../../types.js';
29
29
  * @param {ReactSelectorOptions=} options React selector options
30
30
  * @param {Object=} options.props React props the element should contain
31
31
  * @param {`Array<any>|number|string|object|boolean`=} options.state React state the element should be in
32
- * @return {ElementArray}
32
+ * @return {WebdriverIO.ElementArray}
33
33
  *
34
34
  */
35
35
  export declare function react$$(this: WebdriverIO.Browser, selector: string, { props, state }?: ReactSelectorOptions): Promise<WebdriverIO.ElementArray>;
@@ -39,7 +39,7 @@ import type { ReactSelectorOptions } from '../../types.js';
39
39
  * @param {ReactSelectorOptions=} options React selector options
40
40
  * @param {Object=} options.props React props the element should contain
41
41
  * @param {`Array<any>|number|string|object|boolean`=} options.state React state the element should be in
42
- * @return {Element}
42
+ * @return {WebdriverIO.Element}
43
43
  *
44
44
  */
45
45
  export declare function react$(this: WebdriverIO.Browser, selector: string, { props, state }?: ReactSelectorOptions): Promise<WebdriverIO.Element>;
@@ -15,8 +15,8 @@
15
15
  * </example>
16
16
  *
17
17
  * @alias element.scroll
18
- * @param {number=} x horizontal scroll position (default: `0`)
19
- * @param {number=} y vertical scroll position (default: `0`)
18
+ * @param {number} [x=0] horizontal scroll position (default: `0`)
19
+ * @param {number} [y=0] vertical scroll position (default: `0`)
20
20
  * @uses protocol/execute
21
21
  * @type utility
22
22
  *
@@ -42,7 +42,7 @@
42
42
  *
43
43
  * @alias $$
44
44
  * @param {String|Function|Matcher} selector selector, JS Function, or Matcher object to fetch multiple elements
45
- * @return {ElementArray}
45
+ * @return {WebdriverIO.ElementArray}
46
46
  * @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/example.html
47
47
  * @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/multipleElements.js#L6-L7
48
48
  * @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/multipleElements.js#L15-L24
@@ -57,7 +57,7 @@
57
57
  *
58
58
  * @alias $
59
59
  * @param {String|Function|Matcher} selector selector, JS Function, or Matcher object to fetch a certain element
60
- * @return {Element}
60
+ * @return {WebdriverIO.Element}
61
61
  * @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/example.html
62
62
  * @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/singleElements.js#L9-L10
63
63
  * @example https://github.com/webdriverio/example-recipes/blob/59c122c809d44d343c231bde2af7e8456c8f086c/queryElements/singleElements.js#L16-L25
@@ -21,7 +21,7 @@
21
21
  * @alias custom$$
22
22
  * @param {string} strategyName
23
23
  * @param {*} strategyArguments
24
- * @return {ElementArray}
24
+ * @return {WebdriverIO.ElementArray}
25
25
  */
26
26
  export declare function custom$$(this: WebdriverIO.Element, strategyName: string, ...strategyArguments: unknown[]): Promise<WebdriverIO.ElementArray>;
27
27
  //# sourceMappingURL=custom$$.d.ts.map
@@ -24,7 +24,7 @@
24
24
  * @example https://github.com/webdriverio/example-recipes/blob/f5730428ec3605e856e90bf58be17c9c9da891de/queryElements/customStrategy.js#L2-L11
25
25
  * @example https://github.com/webdriverio/example-recipes/blob/f5730428ec3605e856e90bf58be17c9c9da891de/queryElements/example.html#L8-L12
26
26
  * @example https://github.com/webdriverio/example-recipes/blob/f5730428ec3605e856e90bf58be17c9c9da891de/queryElements/customStrategy.js#L16-L19
27
- * @return {Element}
27
+ * @return {WebdriverIO.Element}
28
28
  */
29
29
  export declare function custom$(this: WebdriverIO.Element, strategyName: string, ...strategyArguments: unknown[]): Promise<WebdriverIO.Element>;
30
30
  //# sourceMappingURL=custom$.d.ts.map
@@ -12,7 +12,7 @@ import type { ChainablePromiseElement } from '../../types.js';
12
12
  * </example>
13
13
  *
14
14
  * @alias element.getElement
15
- * @return {Element}
15
+ * @return {WebdriverIO.Element}
16
16
  * @type utility
17
17
  *
18
18
  */
@@ -12,7 +12,7 @@ import type { ChainablePromiseArray } from '../../types.js';
12
12
  * </example>
13
13
  *
14
14
  * @alias element.getElements
15
- * @return {Element}
15
+ * @return {WebdriverIO.ElementArray}
16
16
  * @type utility
17
17
  *
18
18
  */
@@ -1 +1 @@
1
- {"version":3,"file":"isDisplayed.d.ts","sourceRoot":"","sources":["../../../src/commands/element/isDisplayed.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0FG;AAEH,wBAAsB,WAAW,CAC7B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,aAAa,GAAE,iBAAkC,oBAmEpD;AASD,UAAU,iBAAiB;IACvB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC/B"}
1
+ {"version":3,"file":"isDisplayed.d.ts","sourceRoot":"","sources":["../../../src/commands/element/isDisplayed.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0FG;AAEH,wBAAsB,WAAW,CAC7B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,aAAa,GAAE,iBAAkC,oBAoEpD;AASD,UAAU,iBAAiB;IACvB;;OAEG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC/B"}
@@ -18,7 +18,7 @@
18
18
  * </example>
19
19
  *
20
20
  * @alias element.nextElement
21
- * @return {Element}
21
+ * @return {WebdriverIO.Element}
22
22
  * @type utility
23
23
  */
24
24
  export declare function nextElement(this: WebdriverIO.Element): import("../../types.js").ChainablePromiseElement;
@@ -18,7 +18,7 @@
18
18
  * </example>
19
19
  *
20
20
  * @alias element.parentElement
21
- * @return {Element}
21
+ * @return {WebdriverIO.Element}
22
22
  * @type utility
23
23
  */
24
24
  export declare function parentElement(this: WebdriverIO.Element): import("../../types.js").ChainablePromiseElement;
@@ -18,7 +18,7 @@
18
18
  * </example>
19
19
  *
20
20
  * @alias element.previousElement
21
- * @return {Element}
21
+ * @return {WebdriverIO.Element}
22
22
  * @type utility
23
23
  */
24
24
  export declare function previousElement(this: WebdriverIO.Element): import("../../types.js").ChainablePromiseElement;
@@ -29,7 +29,7 @@ import type { ReactSelectorOptions } from '../../types.js';
29
29
  * @param {ReactSelectorOptions=} options React selector options
30
30
  * @param {Object=} options.props React props the element should contain
31
31
  * @param {`Array<any>|number|string|object|boolean`=} options.state React state the element should be in
32
- * @return {ElementArray}
32
+ * @return {WebdriverIO.ElementArray}
33
33
  *
34
34
  */
35
35
  export declare function react$$(this: WebdriverIO.Element, selector: string, { props, state }?: ReactSelectorOptions): Promise<WebdriverIO.ElementArray>;
@@ -39,7 +39,7 @@ import type { ReactSelectorOptions } from '../../types.js';
39
39
  * @param {ReactSelectorOptions=} options React selector options
40
40
  * @param {Object=} options.props React props the element should contain
41
41
  * @param {`Array<any>|number|string|object|boolean`=} options.state React state the element should be in
42
- * @return {Element}
42
+ * @return {WebdriverIO.Element}
43
43
  *
44
44
  */
45
45
  export declare function react$(this: WebdriverIO.Element, selector: string, { props, state }?: ReactSelectorOptions): Promise<WebdriverIO.Element>;
@@ -22,7 +22,7 @@
22
22
  *
23
23
  * @alias element.shadow$$
24
24
  * @param {String|Function} selector selector or JS Function to fetch a certain element
25
- * @return {ElementArray}
25
+ * @return {WebdriverIO.ElementArray}
26
26
  * @type utility
27
27
  *
28
28
  */
@@ -22,7 +22,7 @@
22
22
  *
23
23
  * @alias element.shadow$
24
24
  * @param {String|Function} selector selector or JS Function to fetch a certain element
25
- * @return {Element}
25
+ * @return {WebdriverIO.Element}
26
26
  * @type utility
27
27
  *
28
28
  */
@@ -40,7 +40,7 @@ import type { SwipeOptions } from '../../types.js';
40
40
  * </example>
41
41
  *
42
42
  * @alias element.scrollIntoView
43
- * @param {object|boolean=} options options for `Element.scrollIntoView()`. Default for desktop/mobile web: <br/> `{ block: 'start', inline: 'nearest' }` <br /> Default for Mobile Native App <br /> `{ maxScrolls: 10, scrollDirection: 'down' }`
43
+ * @param {object|boolean=} options options for `browser.swipe()`. Default for desktop/mobile web: <br/> `{ direction: 'up', duration: 1500, percent: 0.95, scrollableElement: WebdriverIO.Element }`
44
44
  * @param {string=} options.direction Can be one of `down`, `up`, `left` or `right`, default is `up`. <br /><strong>MOBILE-NATIVE-APP-ONLY</strong>
45
45
  * @rowInfo Down ::<strong>Starting Point:</strong><br/>You place your finger towards the top of the screen.<br/><strong>Movement:</strong><br/>You slide your finger downwards towards the bottom of the screen.<br/><strong>Action:</strong><br/>This also varies by context:<br />- On the home screen or in applications, it typically scrolls the content upwards.<br />- From the top edge, it often opens the notifications panel or quick settings.<br />- In browsers or reading apps, it can be used to scroll through content.
46
46
  * @rowInfo Left ::<strong>Starting Point:</strong><br/>You place your finger on the right side of the screen.<br/><strong>Movement:</strong><br/>You slide your finger horizontally to the left.><br/><strong>Action:</strong><br/>The response to this gesture depends on the application:<br />- It can move to the next item in a carousel or a set of images.<br />- In a navigation context, it might go back to the previous page or close the current view.<br />- On the home screen, it usually switches to the next virtual desktop or screen.
package/build/index.js CHANGED
@@ -3405,6 +3405,7 @@ registerScripts_fn = function(context) {
3405
3405
  !context.parent ? __privateGet(this, _browser4).scriptAddPreloadScript({
3406
3406
  functionDeclaration,
3407
3407
  contexts: [context.context]
3408
+ }).catch(() => {
3408
3409
  }) : Promise.resolve(),
3409
3410
  __privateGet(this, _browser4).scriptCallFunction({
3410
3411
  functionDeclaration,
@@ -3772,23 +3773,7 @@ function parseOverwrite(overwrite, request) {
3772
3773
  const result = {};
3773
3774
  if ("body" in overwrite && overwrite.body) {
3774
3775
  const bodyOverwrite = typeof overwrite.body === "function" ? overwrite.body(request) : overwrite.body;
3775
- result.body = typeof bodyOverwrite === "string" ? (
3776
- /**
3777
- * if body is a string we can pass it as is
3778
- */
3779
- {
3780
- type: "string",
3781
- value: bodyOverwrite
3782
- }
3783
- ) : (
3784
- /**
3785
- * if body is an object we need to encode it
3786
- */
3787
- {
3788
- type: "base64",
3789
- value: Buffer.from(JSON.stringify(bodyOverwrite || "")).toString("base64")
3790
- }
3791
- );
3776
+ result.body = (bodyOverwrite == null ? void 0 : bodyOverwrite.type) === "string" || (bodyOverwrite == null ? void 0 : bodyOverwrite.type) === "base64" ? bodyOverwrite : typeof bodyOverwrite === "string" ? { type: "string", value: bodyOverwrite } : { type: "base64", value: Buffer.from(JSON.stringify(bodyOverwrite || "")).toString("base64") };
3792
3777
  }
3793
3778
  if ("headers" in overwrite) {
3794
3779
  const headersOverwrite = typeof overwrite.headers === "function" ? overwrite.headers(request) : overwrite.headers;
@@ -3900,19 +3885,14 @@ var _WebDriverInterception = class _WebDriverInterception {
3900
3885
  */
3901
3886
  getBinaryResponse(requestId) {
3902
3887
  const body = __privateGet(this, _responseBodies).get(requestId);
3903
- if ((body == null ? void 0 : body.type) === "base64") {
3904
- try {
3905
- const decoded = Buffer.from(body.value, "base64").toString();
3906
- const parsed = JSON.parse(decoded);
3907
- if (parsed.type === "base64" || parsed.base64Encoded) {
3908
- return Buffer.from(parsed.value, "base64");
3909
- }
3910
- return Buffer.from(parsed.value);
3911
- } catch {
3912
- return Buffer.from(body.value, "base64");
3913
- }
3888
+ if ((body == null ? void 0 : body.type) !== "base64") {
3889
+ return null;
3914
3890
  }
3915
- return null;
3891
+ if (/[^A-Za-z0-9+/=\s]/.test(body.value)) {
3892
+ log7.warn("Invalid base64 data for request ".concat(requestId));
3893
+ return null;
3894
+ }
3895
+ return Buffer.from(body.value, "base64");
3916
3896
  }
3917
3897
  /**
3918
3898
  * Simulate a responseStarted event for testing purposes
@@ -4125,6 +4105,7 @@ handleBeforeRequestSent_fn = function(request) {
4125
4105
  });
4126
4106
  };
4127
4107
  handleResponseStarted_fn = function(request) {
4108
+ var _a;
4128
4109
  if (!__privateMethod(this, _WebDriverInterception_instances, isRequestMatching_fn).call(this, request)) {
4129
4110
  return;
4130
4111
  }
@@ -4148,9 +4129,11 @@ handleResponseStarted_fn = function(request) {
4148
4129
  if (responseData.body) {
4149
4130
  __privateGet(this, _responseBodies).set(request.request.request, responseData.body);
4150
4131
  }
4132
+ const bodyToSend = ((_a = responseData.body) == null ? void 0 : _a.type) === "string" ? responseData.body.value : responseData.body;
4151
4133
  return __privateGet(this, _browser5).networkProvideResponse({
4152
4134
  request: request.request.request,
4153
- ...responseData
4135
+ ...responseData,
4136
+ body: bodyToSend
4154
4137
  }).catch(__privateMethod(this, _WebDriverInterception_instances, handleNetworkProvideResponseError_fn));
4155
4138
  }
4156
4139
  __privateMethod(this, _WebDriverInterception_instances, emit_fn).call(this, "continue", request.request.request);
@@ -6838,11 +6821,10 @@ function isElementClickable(elem) {
6838
6821
  return isElementInViewport2(elem2) && !hasOverlaps(elem2);
6839
6822
  }
6840
6823
  function getViewportScrollPositions() {
6841
- var _a, _b;
6842
6824
  return {
6843
6825
  // Cross-browser compatibility
6844
- x: (_a = window.scrollX) != null ? _a : window.pageXOffset,
6845
- y: (_b = window.scrollY) != null ? _b : window.pageYOffset
6826
+ x: window.scrollX !== null && window.scrollX !== void 0 ? window.scrollX : window.pageXOffset,
6827
+ y: window.scrollY !== null && window.scrollY !== void 0 ? window.scrollY : window.pageYOffset
6846
6828
  };
6847
6829
  }
6848
6830
  let _isFullyDisplayedInViewport = isFullyDisplayedInViewport(elem);
@@ -7074,16 +7056,19 @@ async function isDisplayed(commandParams = DEFAULT_PARAMS) {
7074
7056
  let hadToFallback = false;
7075
7057
  const [isDisplayed2, displayProperty] = await Promise.all([
7076
7058
  browser2.execute(function checkVisibility(elem, params) {
7077
- return elem.checkVisibility(params);
7059
+ if (typeof elem.checkVisibility === "function") {
7060
+ return elem.checkVisibility(params);
7061
+ }
7062
+ return null;
7078
7063
  }, this, {
7079
7064
  ...DEFAULT_PARAMS,
7080
7065
  ...commandParams
7081
- }).catch((err) => {
7082
- if (err.message.includes("checkVisibility is not a function")) {
7066
+ }).then((result) => {
7067
+ if (result === null) {
7083
7068
  hadToFallback = true;
7084
7069
  return browser2.execute(isElementDisplayed, this);
7085
7070
  }
7086
- throw err;
7071
+ return result;
7087
7072
  }),
7088
7073
  /**
7089
7074
  * don't fail if element is not existing
package/build/node.js CHANGED
@@ -3578,6 +3578,7 @@ var PolyfillManager = class _PolyfillManager extends SessionManager {
3578
3578
  !context.parent ? this.#browser.scriptAddPreloadScript({
3579
3579
  functionDeclaration,
3580
3580
  contexts: [context.context]
3581
+ }).catch(() => {
3581
3582
  }) : Promise.resolve(),
3582
3583
  this.#browser.scriptCallFunction({
3583
3584
  functionDeclaration,
@@ -3959,23 +3960,7 @@ function parseOverwrite(overwrite, request) {
3959
3960
  const result = {};
3960
3961
  if ("body" in overwrite && overwrite.body) {
3961
3962
  const bodyOverwrite = typeof overwrite.body === "function" ? overwrite.body(request) : overwrite.body;
3962
- result.body = typeof bodyOverwrite === "string" ? (
3963
- /**
3964
- * if body is a string we can pass it as is
3965
- */
3966
- {
3967
- type: "string",
3968
- value: bodyOverwrite
3969
- }
3970
- ) : (
3971
- /**
3972
- * if body is an object we need to encode it
3973
- */
3974
- {
3975
- type: "base64",
3976
- value: Buffer.from(JSON.stringify(bodyOverwrite || "")).toString("base64")
3977
- }
3978
- );
3963
+ result.body = bodyOverwrite?.type === "string" || bodyOverwrite?.type === "base64" ? bodyOverwrite : typeof bodyOverwrite === "string" ? { type: "string", value: bodyOverwrite } : { type: "base64", value: Buffer.from(JSON.stringify(bodyOverwrite || "")).toString("base64") };
3979
3964
  }
3980
3965
  if ("headers" in overwrite) {
3981
3966
  const headersOverwrite = typeof overwrite.headers === "function" ? overwrite.headers(request) : overwrite.headers;
@@ -4137,9 +4122,11 @@ var WebDriverInterception = class _WebDriverInterception {
4137
4122
  if (responseData.body) {
4138
4123
  this.#responseBodies.set(request.request.request, responseData.body);
4139
4124
  }
4125
+ const bodyToSend = responseData.body?.type === "string" ? responseData.body.value : responseData.body;
4140
4126
  return this.#browser.networkProvideResponse({
4141
4127
  request: request.request.request,
4142
- ...responseData
4128
+ ...responseData,
4129
+ body: bodyToSend
4143
4130
  }).catch(this.#handleNetworkProvideResponseError);
4144
4131
  }
4145
4132
  this.#emit("continue", request.request.request);
@@ -4165,19 +4152,14 @@ var WebDriverInterception = class _WebDriverInterception {
4165
4152
  */
4166
4153
  getBinaryResponse(requestId) {
4167
4154
  const body = this.#responseBodies.get(requestId);
4168
- if (body?.type === "base64") {
4169
- try {
4170
- const decoded = Buffer.from(body.value, "base64").toString();
4171
- const parsed = JSON.parse(decoded);
4172
- if (parsed.type === "base64" || parsed.base64Encoded) {
4173
- return Buffer.from(parsed.value, "base64");
4174
- }
4175
- return Buffer.from(parsed.value);
4176
- } catch {
4177
- return Buffer.from(body.value, "base64");
4178
- }
4155
+ if (body?.type !== "base64") {
4156
+ return null;
4179
4157
  }
4180
- return null;
4158
+ if (/[^A-Za-z0-9+/=\s]/.test(body.value)) {
4159
+ log8.warn(`Invalid base64 data for request ${requestId}`);
4160
+ return null;
4161
+ }
4162
+ return Buffer.from(body.value, "base64");
4181
4163
  }
4182
4164
  /**
4183
4165
  * Simulate a responseStarted event for testing purposes
@@ -6831,16 +6813,19 @@ async function isDisplayed(commandParams = DEFAULT_PARAMS) {
6831
6813
  let hadToFallback = false;
6832
6814
  const [isDisplayed2, displayProperty] = await Promise.all([
6833
6815
  browser2.execute(function checkVisibility(elem, params) {
6834
- return elem.checkVisibility(params);
6816
+ if (typeof elem.checkVisibility === "function") {
6817
+ return elem.checkVisibility(params);
6818
+ }
6819
+ return null;
6835
6820
  }, this, {
6836
6821
  ...DEFAULT_PARAMS,
6837
6822
  ...commandParams
6838
- }).catch((err) => {
6839
- if (err.message.includes("checkVisibility is not a function")) {
6823
+ }).then((result) => {
6824
+ if (result === null) {
6840
6825
  hadToFallback = true;
6841
6826
  return browser2.execute(isElementDisplayedLegacyScript, this);
6842
6827
  }
6843
- throw err;
6828
+ return result;
6844
6829
  }),
6845
6830
  /**
6846
6831
  * don't fail if element is not existing
@@ -1 +1 @@
1
- {"version":3,"file":"isElementClickable.d.ts","sourceRoot":"","sources":["../../src/scripts/isElementClickable.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAE,IAAI,EAAE,WAAW,WAwJ5D"}
1
+ {"version":3,"file":"isElementClickable.d.ts","sourceRoot":"","sources":["../../src/scripts/isElementClickable.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAE,IAAI,EAAE,WAAW,WA4J5D"}
@@ -88,8 +88,8 @@ function isElementClickable(elem) {
88
88
  function getViewportScrollPositions() {
89
89
  return {
90
90
  // Cross-browser compatibility
91
- x: window.scrollX ?? window.pageXOffset,
92
- y: window.scrollY ?? window.pageYOffset
91
+ x: window.scrollX !== null && window.scrollX !== void 0 ? window.scrollX : window.pageXOffset,
92
+ y: window.scrollY !== null && window.scrollY !== void 0 ? window.scrollY : window.pageYOffset
93
93
  };
94
94
  }
95
95
  let _isFullyDisplayedInViewport = isFullyDisplayedInViewport(elem);
@@ -1 +1 @@
1
- {"version":3,"file":"polyfill.d.ts","sourceRoot":"","sources":["../../src/session/polyfill.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAG7C,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,mBAE9D;AAID;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,YAQtB,CAAA;AAED;;GAEG;AACH,qBAAa,eAAgB,SAAQ,cAAc;;gBAKnC,OAAO,EAAE,WAAW,CAAC,OAAO;IA4BxC,eAAe;IAiCT,UAAU;CAGnB"}
1
+ {"version":3,"file":"polyfill.d.ts","sourceRoot":"","sources":["../../src/session/polyfill.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAG7C,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,WAAW,CAAC,OAAO,mBAE9D;AAID;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,YAQtB,CAAA;AAED;;GAEG;AACH,qBAAa,eAAgB,SAAQ,cAAc;;gBAKnC,OAAO,EAAE,WAAW,CAAC,OAAO;IA4BxC,eAAe;IA0CT,UAAU;CAGnB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/interception/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,EAAE,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,MAAM,WAAW,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAKhD,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAC3F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAMpD,KAAK,WAAW,GAAG,MAAM,GAAG,cAAc,GAAG,MAAM,CAAA;AAOnD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,qBAAqB;;gBAclC,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,iBAAiB,EAChC,OAAO,EAAE,W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,MAAM,CAAC,sBAU7G"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils/interception/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAExE,KAAK,SAAS,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,SAAS,kBAAkB,GAAG,MAAM,CAAC,gCAAgC,GAAG,MAAM,CAAC,iCAAiC,EAAE,SAAS,CAAC,CAAA;AAEtJ;;;;GAIG;AACH,wBAAgB,cAAc,CAC1B,CAAC,SAAS,kBAAkB,GAAG,kBAAkB,EAEjD,SAAS,EAAE,CAAC,EACZ,OAAO,EAAE,KAAK,CAAC,kCAAkC,GAAG,KAAK,CAAC,kCAAkC,GAC7F,SAAS,CAAC,CAAC,CAAC,CA8Dd;AAED,wBAAgB,eAAe,CAAE,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,IAAI,CAAC,MAAM,CAAC,wBAAwB,EAAE,MAAM,CAAC,sBAU7G"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "webdriverio",
3
3
  "description": "Next-gen browser and mobile automation test framework for Node.js",
4
- "version": "9.12.4",
4
+ "version": "9.12.6",
5
5
  "homepage": "https://webdriver.io",
6
6
  "author": "Christian Bromann <mail@bromann.dev>",
7
7
  "license": "MIT",
@@ -77,12 +77,12 @@
77
77
  "dependencies": {
78
78
  "@types/node": "^20.11.30",
79
79
  "@types/sinonjs__fake-timers": "^8.1.5",
80
- "@wdio/config": "9.12.3",
80
+ "@wdio/config": "9.12.6",
81
81
  "@wdio/logger": "9.4.4",
82
- "@wdio/protocols": "9.12.3",
82
+ "@wdio/protocols": "9.12.5",
83
83
  "@wdio/repl": "9.4.4",
84
- "@wdio/types": "9.12.3",
85
- "@wdio/utils": "9.12.3",
84
+ "@wdio/types": "9.12.6",
85
+ "@wdio/utils": "9.12.6",
86
86
  "archiver": "^7.0.1",
87
87
  "aria-query": "^5.3.0",
88
88
  "cheerio": "^1.0.0-rc.12",
@@ -99,15 +99,15 @@
99
99
  "rgb2hex": "0.2.5",
100
100
  "serialize-error": "^11.0.3",
101
101
  "urlpattern-polyfill": "^10.0.0",
102
- "webdriver": "9.12.4"
102
+ "webdriver": "9.12.6"
103
103
  },
104
104
  "peerDependencies": {
105
- "puppeteer-core": "^22.3.0"
105
+ "puppeteer-core": ">=22.x || <=24.x"
106
106
  },
107
107
  "peerDependenciesMeta": {
108
108
  "puppeteer-core": {
109
109
  "optional": true
110
110
  }
111
111
  },
112
- "gitHead": "fb6a67317881a8d5702fa32091c15ade940dc992"
112
+ "gitHead": "a5811faee284a67819b8f979f6e32eb6c9752046"
113
113
  }