webdriverio 8.23.3 → 8.23.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.
@@ -10,6 +10,13 @@
10
10
  *
11
11
  * :::
12
12
  *
13
+ * WebdriverIO, when conducting browser tests, utilizes a [custom script](https://github.com/webdriverio/webdriverio/blob/59d349ca847950354d02b9e548f60cc50e7871f0/packages/webdriverio/src/scripts/isElementDisplayed.ts)
14
+ * specifically designed to assess the visibility of elements. This script is key in determining whether an
15
+ * element is displayed on the page. Conversely, for native mobile testing scenarios with Appium, WebdriverIO
16
+ * defers to the [`isElementDisplayed`](https://appium.io/docs/en/2.1/reference/interfaces/appium_types.ExternalDriver/#elementdisplayed)
17
+ * command provided by Appium. This command evaluates the visibility of elements using criteria established by the
18
+ * underlying Appium driver, ensuring accurate and driver-specific assessments for mobile applications.
19
+ *
13
20
  * <example>
14
21
  :index.html
15
22
  <div id="noSize"></div>
@@ -1 +1 @@
1
- {"version":3,"file":"isDisplayed.d.ts","sourceRoot":"","sources":["../../../src/commands/element/isDisplayed.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,wBAAsB,WAAW,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,oBAW3D"}
1
+ {"version":3,"file":"isDisplayed.d.ts","sourceRoot":"","sources":["../../../src/commands/element/isDisplayed.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,wBAAsB,WAAW,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,oBAoB3D"}
@@ -13,6 +13,13 @@ import isElementDisplayedScript from '../../scripts/isElementDisplayed.js';
13
13
  *
14
14
  * :::
15
15
  *
16
+ * WebdriverIO, when conducting browser tests, utilizes a [custom script](https://github.com/webdriverio/webdriverio/blob/59d349ca847950354d02b9e548f60cc50e7871f0/packages/webdriverio/src/scripts/isElementDisplayed.ts)
17
+ * specifically designed to assess the visibility of elements. This script is key in determining whether an
18
+ * element is displayed on the page. Conversely, for native mobile testing scenarios with Appium, WebdriverIO
19
+ * defers to the [`isElementDisplayed`](https://appium.io/docs/en/2.1/reference/interfaces/appium_types.ExternalDriver/#elementdisplayed)
20
+ * command provided by Appium. This command evaluates the visibility of elements using criteria established by the
21
+ * underlying Appium driver, ensuring accurate and driver-specific assessments for mobile applications.
22
+ *
16
23
  * <example>
17
24
  :index.html
18
25
  <div id="noSize"></div>
@@ -64,6 +71,14 @@ export async function isDisplayed() {
64
71
  if (!await hasElementId(this)) {
65
72
  return false;
66
73
  }
74
+ /**
75
+ * For mobile sessions with Appium we continue to use the elementDisplayed command
76
+ * as we can't run JS in native apps
77
+ */
78
+ const isNativeApplication = !browser.capabilities.browserName;
79
+ if (browser.isMobile && isNativeApplication) {
80
+ return await this.isElementDisplayed(this.elementId);
81
+ }
67
82
  return await browser.execute(isElementDisplayedScript, {
68
83
  [ELEMENT_KEY]: this.elementId,
69
84
  ELEMENT: this.elementId // jsonwp compatible
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": "8.23.3",
4
+ "version": "8.23.4",
5
5
  "homepage": "https://webdriver.io",
6
6
  "author": "Christian Bromann <mail@bromann.dev>",
7
7
  "license": "MIT",
@@ -100,5 +100,5 @@
100
100
  "optional": true
101
101
  }
102
102
  },
103
- "gitHead": "7a5d7baa075b3f0adc3a9615e5b23f0c27ab4d62"
103
+ "gitHead": "8549f43c3d788cab575ee83727126cf549025785"
104
104
  }