webdriverio 8.23.4 → 8.24.0

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 +1 @@
1
- {"version":3,"file":"isElementDisplayed.d.ts","sourceRoot":"","sources":["../../src/scripts/isElementDisplayed.ts"],"names":[],"mappings":"AAyBA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAwOrE"}
1
+ {"version":3,"file":"isElementDisplayed.d.ts","sourceRoot":"","sources":["../../src/scripts/isElementDisplayed.ts"],"names":[],"mappings":"AAyBA;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,kBAAkB,CAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CA0OrE"}
@@ -105,7 +105,7 @@ export default function isElementDisplayed(element) {
105
105
  }
106
106
  // If the container's overflow is not hidden and it has zero size, consider the
107
107
  // container to have non-zero dimensions if a child node has non-zero dimensions.
108
- return Array.from(element.childNodes).some((childNode) => {
108
+ return Array.from(element.childNodes).some(function (childNode) {
109
109
  if (childNode.nodeType === Node.TEXT_NODE) {
110
110
  return true;
111
111
  }
@@ -136,7 +136,7 @@ export default function isElementDisplayed(element) {
136
136
  return false;
137
137
  }
138
138
  // This element's subtree is hidden by overflow if all child subtrees are as well.
139
- return Array.from(element.childNodes).every((childNode) => {
139
+ return Array.from(element.childNodes).every(function (childNode) {
140
140
  // Returns true if the child node is overflowed or otherwise hidden.
141
141
  // Base case: not an element, has zero size, scrolled out, or doesn't overflow container.
142
142
  // Visibility of text nodes is controlled by parent
@@ -166,7 +166,7 @@ export default function isElementDisplayed(element) {
166
166
  // This is a partial reimplementation of Selenium's "element is displayed" algorithm.
167
167
  // When the W3C specification's algorithm stabilizes, we should implement that.
168
168
  // If this command is misdirected to the wrong document (and is NOT inside a shadow root), treat it as not shown.
169
- if (!isElementInsideShadowRoot(element) && !document.contains(element)) {
169
+ if (!isElementInsideShadowRoot(element) && !document.body.contains(element)) {
170
170
  return false;
171
171
  }
172
172
  // Special cases for specific tag names.
@@ -179,7 +179,9 @@ export default function isElementDisplayed(element) {
179
179
  case 'OPTGROUP':
180
180
  case 'OPTION': {
181
181
  // Option/optgroup are considered shown if the containing <select> is shown.
182
- const enclosingSelectElement = enclosingNodeOrSelfMatchingPredicate(element, (e) => e.tagName.toUpperCase() === 'SELECT');
182
+ const enclosingSelectElement = enclosingNodeOrSelfMatchingPredicate(element, function (e) {
183
+ return e.tagName.toUpperCase() === 'SELECT';
184
+ });
183
185
  return isElementDisplayed(enclosingSelectElement);
184
186
  }
185
187
  case 'INPUT':
@@ -196,10 +198,10 @@ export default function isElementDisplayed(element) {
196
198
  if (cascadedStylePropertyForElement(element, 'visibility') !== 'visible') {
197
199
  return false;
198
200
  }
199
- const hasAncestorWithZeroOpacity = !!enclosingElementOrSelfMatchingPredicate(element, (e) => {
201
+ const hasAncestorWithZeroOpacity = !!enclosingElementOrSelfMatchingPredicate(element, function (e) {
200
202
  return Number(cascadedStylePropertyForElement(e, 'opacity')) === 0;
201
203
  });
202
- const hasAncestorWithDisplayNone = !!enclosingElementOrSelfMatchingPredicate(element, (e) => {
204
+ const hasAncestorWithDisplayNone = !!enclosingElementOrSelfMatchingPredicate(element, function (e) {
203
205
  return cascadedStylePropertyForElement(e, 'display') === 'none';
204
206
  });
205
207
  if (hasAncestorWithZeroOpacity || hasAncestorWithDisplayNone) {
@@ -1 +1 @@
1
- {"version":3,"file":"resq.d.ts","sourceRoot":"","sources":["../../src/scripts/resq.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,eAAe,YAE3B,CAAA;AAED,eAAO,MAAM,MAAM,aACL,MAAM,SACT,GAAG,EAAE,SACL,OAAO,MAAM,EAAE,GAAG,CAAC,gBACZ,WAAW;;QA0B5B,CAAA;AAED,eAAO,MAAM,OAAO,aACN,MAAM,SACT,GAAG,EAAE,SACL,OAAO,MAAM,EAAE,MAAM,CAAC,gBACf,WAAW,kBAkC5B,CAAA"}
1
+ {"version":3,"file":"resq.d.ts","sourceRoot":"","sources":["../../src/scripts/resq.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,eAAe,YAE3B,CAAA;AAED,eAAO,MAAM,MAAM,aACL,MAAM,SACT,GAAG,EAAE,SACL,OAAO,MAAM,EAAE,GAAG,CAAC,gBACZ,WAAW;;QA0B5B,CAAA;AAED,eAAO,MAAM,OAAO,aACN,MAAM,SACT,GAAG,EAAE,SACL,OAAO,MAAM,EAAE,MAAM,CAAC,gBACf,WAAW,kBAgC5B,CAAA"}
@@ -39,13 +39,12 @@ export const react$$ = function react$$(selector, props, state, reactElement) {
39
39
  // this avoids having nested arrays of nodes which the driver does not understand
40
40
  // [[div, div], [div, div]] => [div, div, div, div]
41
41
  let nodes = [];
42
- elements.forEach(element => {
43
- const { node, isFragment } = element;
44
- if (isFragment) {
45
- nodes = nodes.concat(node || []);
42
+ elements.forEach(function (element) {
43
+ if (element.isFragment) {
44
+ nodes = nodes.concat(element.node || []);
46
45
  }
47
- else if (node) {
48
- nodes.push(node);
46
+ else if (element.node) {
47
+ nodes.push(element.node);
49
48
  }
50
49
  });
51
50
  return [...nodes];
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.4",
4
+ "version": "8.24.0",
5
5
  "homepage": "https://webdriver.io",
6
6
  "author": "Christian Bromann <mail@bromann.dev>",
7
7
  "license": "MIT",
@@ -68,12 +68,12 @@
68
68
  },
69
69
  "dependencies": {
70
70
  "@types/node": "^20.1.0",
71
- "@wdio/config": "8.23.1",
71
+ "@wdio/config": "8.24.0",
72
72
  "@wdio/logger": "8.16.17",
73
73
  "@wdio/protocols": "8.23.0",
74
74
  "@wdio/repl": "8.23.1",
75
- "@wdio/types": "8.23.1",
76
- "@wdio/utils": "8.23.1",
75
+ "@wdio/types": "8.24.0",
76
+ "@wdio/utils": "8.24.0",
77
77
  "archiver": "^6.0.0",
78
78
  "aria-query": "^5.0.0",
79
79
  "css-shorthand-properties": "^1.1.1",
@@ -90,7 +90,7 @@
90
90
  "resq": "^1.9.1",
91
91
  "rgb2hex": "0.2.5",
92
92
  "serialize-error": "^11.0.1",
93
- "webdriver": "8.23.1"
93
+ "webdriver": "8.24.0"
94
94
  },
95
95
  "peerDependencies": {
96
96
  "devtools": "^8.14.0"
@@ -100,5 +100,5 @@
100
100
  "optional": true
101
101
  }
102
102
  },
103
- "gitHead": "8549f43c3d788cab575ee83727126cf549025785"
103
+ "gitHead": "5fe7908a837461102ada6edf71c160f2c66dd88f"
104
104
  }