webdriverio 9.18.3 → 9.18.4

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.
@@ -1,4 +1,26 @@
1
1
  import type { WaitForOptions } from '../../types.js';
2
+ interface WaitForDisplayedParams extends WaitForOptions {
3
+ /**
4
+ * `true` to check if the element is within the viewport. false by default.
5
+ */
6
+ withinViewport?: boolean;
7
+ /**
8
+ * `true` to check if the element content-visibility property has (or inherits) the value auto,
9
+ * and it is currently skipping its rendering. `true` by default.
10
+ * @default true
11
+ */
12
+ contentVisibilityAuto?: boolean;
13
+ /**
14
+ * `true` to check if the element opacity property has (or inherits) a value of 0. `true` by default.
15
+ * @default true
16
+ */
17
+ opacityProperty?: boolean;
18
+ /**
19
+ * `true` to check if the element is invisible due to the value of its visibility property. `true` by default.
20
+ * @default true
21
+ */
22
+ visibilityProperty?: boolean;
23
+ }
2
24
  /**
3
25
  *
4
26
  * Wait for an element for the provided amount of milliseconds to be displayed or not displayed.
@@ -17,11 +39,15 @@ import type { WaitForOptions } from '../../types.js';
17
39
  * @param {String=} options.timeoutMsg if exists it overrides the default error message
18
40
  * @param {Number=} options.interval interval between checks (default: `waitforInterval`)
19
41
  * @param {Boolean=} options.withinViewport set to `true` to wait until element is displayed within viewport (default: `false`)
42
+ * @param {Boolean=} options.contentVisibilityAuto set to `true` to check if the element content-visibility property has (or inherits) the value auto, and it is currently skipping its rendering. `true` by default.
43
+ * @param {Boolean=} options.opacityProperty set to `true` to check if the element opacity property has (or inherits) a value of 0. `true` by default.
44
+ * @param {Boolean=} options.visibilityProperty set to `true` to check if the element is invisible due to the value of its visibility property. `true` by default.
20
45
  * @return {Boolean} true if element is displayed (or doesn't if flag is set)
21
46
  * @uses utility/waitUntil, state/isDisplayed
22
47
  * @example https://github.com/webdriverio/example-recipes/blob/0bfb2b8d212b627a2659b10f4449184b657e1d59/waitForDisplayed/index.html#L3-L8
23
48
  * @example https://github.com/webdriverio/example-recipes/blob/9ac16b4d4cf4bc8ec87f6369439a2d0bcaae4483/waitForDisplayed/waitForDisplayedExample.js#L6-L14
24
49
  * @type utility
25
50
  */
26
- export declare function waitForDisplayed(this: WebdriverIO.Element, { timeout, interval, reverse, withinViewport, timeoutMsg, }?: WaitForOptions): Promise<true>;
51
+ export declare function waitForDisplayed(this: WebdriverIO.Element, { timeout, interval, reverse, withinViewport, contentVisibilityAuto, opacityProperty, visibilityProperty, timeoutMsg, }?: WaitForDisplayedParams): Promise<true>;
52
+ export {};
27
53
  //# sourceMappingURL=waitForDisplayed.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"waitForDisplayed.d.ts","sourceRoot":"","sources":["../../../src/commands/element/waitForDisplayed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,gBAAgB,CAC5B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,EACI,OAAqC,EACrC,QAAuC,EACvC,OAAe,EACf,cAAsB,EACtB,UAAiJ,GACpJ,GAAE,cAAmB,iBAMzB"}
1
+ {"version":3,"file":"waitForDisplayed.d.ts","sourceRoot":"","sources":["../../../src/commands/element/waitForDisplayed.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAEpD,UAAU,sBAAuB,SAAQ,cAAc;IACnD;;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;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,gBAAgB,CAC5B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,EACI,OAAqC,EACrC,QAAuC,EACvC,OAAe,EACf,cAAsB,EACtB,qBAA4B,EAC5B,eAAsB,EACtB,kBAAyB,EACzB,UAAiJ,GACpJ,GAAE,sBAA2B,iBAOjC"}
package/build/index.js CHANGED
@@ -7946,10 +7946,13 @@ function waitForDisplayed({
7946
7946
  interval = this.options.waitforInterval,
7947
7947
  reverse = false,
7948
7948
  withinViewport = false,
7949
+ contentVisibilityAuto = true,
7950
+ opacityProperty = true,
7951
+ visibilityProperty = true,
7949
7952
  timeoutMsg = 'element ("'.concat(this.selector, '") still ').concat(reverse ? "" : "not ", "displayed").concat(withinViewport ? " within viewport" : "", " after ").concat(timeout, "ms")
7950
7953
  } = {}) {
7951
7954
  return this.waitUntil(
7952
- async () => reverse !== await this.isDisplayed({ withinViewport }),
7955
+ async () => reverse !== await this.isDisplayed({ withinViewport, contentVisibilityAuto, opacityProperty, visibilityProperty }),
7953
7956
  { timeout, interval, timeoutMsg }
7954
7957
  );
7955
7958
  }
package/build/node.js CHANGED
@@ -7672,10 +7672,13 @@ function waitForDisplayed({
7672
7672
  interval = this.options.waitforInterval,
7673
7673
  reverse = false,
7674
7674
  withinViewport = false,
7675
+ contentVisibilityAuto = true,
7676
+ opacityProperty = true,
7677
+ visibilityProperty = true,
7675
7678
  timeoutMsg = `element ("${this.selector}") still ${reverse ? "" : "not "}displayed${withinViewport ? " within viewport" : ""} after ${timeout}ms`
7676
7679
  } = {}) {
7677
7680
  return this.waitUntil(
7678
- async () => reverse !== await this.isDisplayed({ withinViewport }),
7681
+ async () => reverse !== await this.isDisplayed({ withinViewport, contentVisibilityAuto, opacityProperty, visibilityProperty }),
7679
7682
  { timeout, interval, timeoutMsg }
7680
7683
  );
7681
7684
  }
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.18.3",
4
+ "version": "9.18.4",
5
5
  "homepage": "https://webdriver.io",
6
6
  "author": "Christian Bromann <mail@bromann.dev>",
7
7
  "license": "MIT",
@@ -109,5 +109,5 @@
109
109
  "optional": true
110
110
  }
111
111
  },
112
- "gitHead": "fc1d8576f1ccd4f4b7b99f8d01cda3fe29642c5c"
112
+ "gitHead": "a319103a2aa58659d427c7e475a97ffadab5df60"
113
113
  }