webdriverio 7.23.0 → 7.24.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.
@@ -1 +1 @@
1
- {"version":3,"file":"setCookies.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/setCookies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,wBAA8B,UAAU,CACpC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,iBAWhC"}
1
+ {"version":3,"file":"setCookies.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/setCookies.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AACH,wBAA8B,UAAU,CACpC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,iBAYhC"}
@@ -59,8 +59,9 @@ async function setCookies(cookieObjs) {
59
59
  if (cookieObjsList.some(obj => (typeof obj !== 'object'))) {
60
60
  throw new Error('Invalid input (see https://webdriver.io/docs/api/browser/setCookies for documentation)');
61
61
  }
62
- await Promise.all(cookieObjsList
63
- .map(cookieObj => this.addCookie(cookieObj)));
62
+ for (const cookieObj of cookieObjsList) {
63
+ await this.addCookie(cookieObj);
64
+ }
64
65
  return;
65
66
  }
66
67
  exports.default = setCookies;
@@ -10,5 +10,6 @@ export declare const DRIVER_DEFAULT_ENDPOINT: {
10
10
  };
11
11
  export declare const FF_REMOTE_DEBUG_ARG = "-remote-debugging-port";
12
12
  export declare const DEEP_SELECTOR = ">>>";
13
+ export declare const ARIA_SELECTOR = "aria/";
13
14
  export declare const ERROR_REASON: string[];
14
15
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAqC,MAAM,aAAa,CAAA;AA4B7E,eAAO,MAAM,WAAW,wCAAwC,CAAA;AAEhE,eAAO,MAAM,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,UAAU,CAuQtF,CAAA;AAED,eAAO,MAAM,uBAAuB,UAA0E,CAAA;AAE9G,eAAO,MAAM,uBAAuB;;;;;CAKnC,CAAA;AAED,eAAO,MAAM,mBAAmB,2BAA2B,CAAA;AAC3D,eAAO,MAAM,aAAa,QAAQ,CAAA;AAElC,eAAO,MAAM,YAAY,UAKxB,CAAA"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAqC,MAAM,aAAa,CAAA;AA4B7E,eAAO,MAAM,WAAW,wCAAwC,CAAA;AAEhE,eAAO,MAAM,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,UAAU,CAuQtF,CAAA;AAED,eAAO,MAAM,uBAAuB,UAA0E,CAAA;AAE9G,eAAO,MAAM,uBAAuB;;;;;CAKnC,CAAA;AAED,eAAO,MAAM,mBAAmB,2BAA2B,CAAA;AAC3D,eAAO,MAAM,aAAa,QAAQ,CAAA;AAClC,eAAO,MAAM,aAAa,UAAU,CAAA;AAEpC,eAAO,MAAM,YAAY,UAKxB,CAAA"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ERROR_REASON = exports.DEEP_SELECTOR = exports.FF_REMOTE_DEBUG_ARG = exports.DRIVER_DEFAULT_ENDPOINT = exports.W3C_SELECTOR_STRATEGIES = exports.WDIO_DEFAULTS = exports.ELEMENT_KEY = void 0;
3
+ exports.ERROR_REASON = exports.ARIA_SELECTOR = exports.DEEP_SELECTOR = exports.FF_REMOTE_DEBUG_ARG = exports.DRIVER_DEFAULT_ENDPOINT = exports.W3C_SELECTOR_STRATEGIES = exports.WDIO_DEFAULTS = exports.ELEMENT_KEY = void 0;
4
4
  /* istanbul ignore next */
5
5
  const HOOK_DEFINITION = {
6
6
  type: 'object',
@@ -279,6 +279,7 @@ exports.DRIVER_DEFAULT_ENDPOINT = {
279
279
  };
280
280
  exports.FF_REMOTE_DEBUG_ARG = '-remote-debugging-port';
281
281
  exports.DEEP_SELECTOR = '>>>';
282
+ exports.ARIA_SELECTOR = 'aria/';
282
283
  exports.ERROR_REASON = [
283
284
  'Failed', 'Aborted', 'TimedOut', 'AccessDenied', 'ConnectionClosed',
284
285
  'ConnectionReset', 'ConnectionRefused', 'ConnectionAborted',
@@ -70,7 +70,7 @@ function isElementDisplayed(element) {
70
70
  // if document-fragment, skip it and use element.host instead. This happens
71
71
  // when the element is inside a shadow root.
72
72
  // window.getComputedStyle errors on document-fragment.
73
- if (element instanceof DocumentFragment) {
73
+ if (element instanceof ShadowRoot) {
74
74
  element = element.host;
75
75
  }
76
76
  let computedStyle = window.getComputedStyle(element);
@@ -1 +1 @@
1
- {"version":3,"file":"findStrategy.d.ts","sourceRoot":"","sources":["../../src/utils/findStrategy.ts"],"names":[],"mappings":"AA4BA,aAAK,gBAAgB,GAAG,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AAuF/D,eAAO,MAAM,YAAY,aAAuB,gBAAgB,UAAU,OAAO,aAAa,OAAO;;;CAoIpG,CAAA"}
1
+ {"version":3,"file":"findStrategy.d.ts","sourceRoot":"","sources":["../../src/utils/findStrategy.ts"],"names":[],"mappings":"AA4BA,aAAK,gBAAgB,GAAG,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AA2F/D,eAAO,MAAM,YAAY,aAAuB,gBAAgB,UAAU,OAAO,aAAa,OAAO;;;CAuKpG,CAAA"}
@@ -71,6 +71,10 @@ const defineStrategy = function (selector) {
71
71
  if (stringSelector.startsWith(constants_1.DEEP_SELECTOR)) {
72
72
  return 'shadow';
73
73
  }
74
+ // use aria selector
75
+ if (stringSelector.startsWith(constants_1.ARIA_SELECTOR)) {
76
+ return 'aria';
77
+ }
74
78
  // Recursive element search using the UiAutomator library (Android only)
75
79
  if (stringSelector.startsWith('android=')) {
76
80
  return '-android uiautomator';
@@ -151,6 +155,41 @@ const findStrategy = function (selector, isW3C, isMobile) {
151
155
  using = 'shadow';
152
156
  value = stringSelector.slice(constants_1.DEEP_SELECTOR.length);
153
157
  break;
158
+ case 'aria': {
159
+ const label = stringSelector.slice(constants_1.ARIA_SELECTOR.length);
160
+ const conditions = [
161
+ // aria label is recevied by other element with aria-labelledBy
162
+ // https://www.w3.org/TR/accname-1.1/#step2B
163
+ `.//*[@aria-labelledby=(//*[normalize-space() = "${label}"]/@id)]`,
164
+ // aria label is recevied by other element with aria-labelledBy
165
+ // https://www.w3.org/TR/accname-1.1/#step2B
166
+ `.//*[@aria-describedby=(//*[normalize-space() = "${label}"]/@id)]`,
167
+ // element has direct aria label
168
+ // https://www.w3.org/TR/accname-1.1/#step2C
169
+ `.//*[@aria-label = "${label}"]`,
170
+ // inputs with a label
171
+ // https://www.w3.org/TR/accname-1.1/#step2D
172
+ `.//input[@id = (//label[normalize-space() = "${label}"]/@for)]`,
173
+ // aria label is received by an input placeholder
174
+ // https://www.w3.org/TR/accname-1.1/#step2D
175
+ `.//input[@placeholder="${label}"]`,
176
+ // aria label is received by an input placeholder
177
+ // https://www.w3.org/TR/accname-1.1/#step2D
178
+ `.//input[@aria-placeholder="${label}"]`,
179
+ // aria label is received by its title attribute
180
+ // https://www.w3.org/TR/accname-1.1/#step2D
181
+ `.//*[@title="${label}"]`,
182
+ // images with an alt tag
183
+ // https://www.w3.org/TR/accname-1.1/#step2D
184
+ `.//img[@alt="${label}"]`,
185
+ // aria label is received from element content
186
+ // https://www.w3.org/TR/accname-1.1/#step2G
187
+ `.//*[normalize-space() = "${label}"]`
188
+ ];
189
+ using = 'xpath';
190
+ value = `(${conditions.join(' | ')})[1]`;
191
+ break;
192
+ }
154
193
  case '-android uiautomator': {
155
194
  using = '-android uiautomator';
156
195
  value = stringSelector.slice(8);
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": "7.23.0",
4
+ "version": "7.24.1",
5
5
  "homepage": "https://webdriver.io",
6
6
  "author": "Christian Bromann <mail@bromann.dev>",
7
7
  "license": "MIT",
@@ -57,18 +57,18 @@
57
57
  "dependencies": {
58
58
  "@types/aria-query": "^5.0.0",
59
59
  "@types/node": "^18.0.0",
60
- "@wdio/config": "7.23.0",
60
+ "@wdio/config": "7.24.1",
61
61
  "@wdio/logger": "7.19.0",
62
62
  "@wdio/protocols": "7.22.0",
63
- "@wdio/repl": "7.23.0",
64
- "@wdio/types": "7.23.0",
65
- "@wdio/utils": "7.23.0",
63
+ "@wdio/repl": "7.24.1",
64
+ "@wdio/types": "7.24.1",
65
+ "@wdio/utils": "7.24.1",
66
66
  "archiver": "^5.0.0",
67
67
  "aria-query": "^5.0.0",
68
68
  "css-shorthand-properties": "^1.1.1",
69
69
  "css-value": "^0.0.1",
70
- "devtools": "7.23.0",
71
- "devtools-protocol": "^0.0.1034970",
70
+ "devtools": "7.24.1",
71
+ "devtools-protocol": "^0.0.1048352",
72
72
  "fs-extra": "^10.0.0",
73
73
  "grapheme-splitter": "^1.0.2",
74
74
  "lodash.clonedeep": "^4.5.0",
@@ -81,7 +81,7 @@
81
81
  "resq": "^1.9.1",
82
82
  "rgb2hex": "0.2.5",
83
83
  "serialize-error": "^8.0.0",
84
- "webdriver": "7.23.0"
84
+ "webdriver": "7.24.1"
85
85
  },
86
- "gitHead": "00407ba4e1b414c38195789c748bbad69df1b26d"
86
+ "gitHead": "07017366c8794841ab1c84c3a8fdd933922b27dc"
87
87
  }