webdriverio 8.0.13 → 8.0.14

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.
Files changed (37) hide show
  1. package/build/commands/browser/action.d.ts +2 -1
  2. package/build/commands/browser/action.d.ts.map +1 -1
  3. package/build/commands/browser/actions.d.ts +1 -1
  4. package/build/commands/browser/actions.d.ts.map +1 -1
  5. package/build/commands/browser/getPuppeteer.d.ts +1 -1
  6. package/build/commands/browser/getPuppeteer.d.ts.map +1 -1
  7. package/build/commands/browser/savePDF.js +1 -1
  8. package/build/commands/browser/uploadFile.js +2 -2
  9. package/build/commands/browser/waitUntil.js +1 -1
  10. package/build/commands/constant.d.ts.map +1 -1
  11. package/build/commands/constant.js +6 -3
  12. package/build/commands/element/click.js +1 -1
  13. package/build/commands/element/dragAndDrop.d.ts.map +1 -1
  14. package/build/commands/element/dragAndDrop.js +3 -6
  15. package/build/commands/element/getSize.d.ts.map +1 -1
  16. package/build/commands/element/getSize.js +3 -7
  17. package/build/commands/element/scrollIntoView.d.ts.map +1 -1
  18. package/build/commands/element/scrollIntoView.js +23 -8
  19. package/build/index.js +2 -2
  20. package/build/multiremote.js +1 -1
  21. package/build/scripts/isElementClickable.js +1 -1
  22. package/build/scripts/isElementDisplayed.d.ts.map +1 -1
  23. package/build/scripts/isElementDisplayed.js +14 -12
  24. package/build/utils/Timer.js +2 -2
  25. package/build/utils/actions/key.d.ts +2 -1
  26. package/build/utils/actions/key.d.ts.map +1 -1
  27. package/build/utils/actions/pointer.d.ts +3 -2
  28. package/build/utils/actions/pointer.d.ts.map +1 -1
  29. package/build/utils/actions/wheel.d.ts +2 -1
  30. package/build/utils/actions/wheel.d.ts.map +1 -1
  31. package/build/utils/detectBackend.js +1 -1
  32. package/build/utils/findStrategy.d.ts.map +1 -1
  33. package/build/utils/findStrategy.js +4 -3
  34. package/build/utils/index.js +7 -7
  35. package/build/utils/refetchElement.js +1 -1
  36. package/build/utils/thirdParty/querySelectorShadowDom.js +3 -2
  37. package/package.json +12 -12
@@ -1,4 +1,5 @@
1
- import { KeyAction, PointerAction, WheelAction, BaseActionParams } from '../../utils/actions/index.js';
1
+ import type { BaseActionParams } from '../../utils/actions/index.js';
2
+ import { KeyAction, PointerAction, WheelAction } from '../../utils/actions/index.js';
2
3
  /**
3
4
  * The action command is a low-level interface for providing virtualized device input actions to the web browser.
4
5
  *
@@ -1 +1 @@
1
- {"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/action.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAc,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAElH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmJG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAC1B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,IAAI,EAAE,KAAK,EACX,IAAI,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,GACpC,SAAS,CAAA;AACZ,MAAM,CAAC,OAAO,UAAU,MAAM,CAC1B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,IAAI,EAAE,SAAS,EACf,IAAI,CAAC,EAAE,gBAAgB,GACxB,aAAa,CAAA;AAChB,MAAM,CAAC,OAAO,UAAU,MAAM,CAC1B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,IAAI,EAAE,OAAO,EACb,IAAI,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,GACpC,WAAW,CAAA"}
1
+ {"version":3,"file":"action.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/action.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAChF,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAEpF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmJG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAC1B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,IAAI,EAAE,KAAK,EACX,IAAI,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,GACpC,SAAS,CAAA;AACZ,MAAM,CAAC,OAAO,UAAU,MAAM,CAC1B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,IAAI,EAAE,SAAS,EACf,IAAI,CAAC,EAAE,gBAAgB,GACxB,aAAa,CAAA;AAChB,MAAM,CAAC,OAAO,UAAU,MAAM,CAC1B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,IAAI,EAAE,OAAO,EACb,IAAI,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,GACpC,WAAW,CAAA"}
@@ -1,4 +1,4 @@
1
- import { KeyAction, PointerAction, WheelAction } from '../../utils/actions/index.js';
1
+ import type { KeyAction, PointerAction, WheelAction } from '../../utils/actions/index.js';
2
2
  /**
3
3
  * Allows to run multiple action interaction at once, e.g. to simulate a pinch zoom.
4
4
  * For more information on the `action` command, check out the [docs](/docs/api/browser/action).
@@ -1 +1 @@
1
- {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAEpF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAA8B,OAAO,CACjC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,OAAO,EAAE,CAAC,SAAS,GAAG,aAAa,GAAG,WAAW,CAAC,EAAE,GACrD,OAAO,CAAC,IAAI,CAAC,CAGf"}
1
+ {"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/actions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AAEzF;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAA8B,OAAO,CACjC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,OAAO,EAAE,CAAC,SAAS,GAAG,aAAa,GAAG,WAAW,CAAC,EAAE,GACrD,OAAO,CAAC,IAAI,CAAC,CAGf"}
@@ -1,4 +1,4 @@
1
- import { Browser as PuppeteerBrowser } from 'puppeteer-core/lib/cjs/puppeteer/api/Browser.js';
1
+ import type { Browser as PuppeteerBrowser } from 'puppeteer-core/lib/cjs/puppeteer/api/Browser.js';
2
2
  /**
3
3
  * Get the [Puppeteer Browser instance](https://pptr.dev/#?product=Puppeteer&version=v5.1.0&show=api-class-browser)
4
4
  * to run commands with Puppeteer. Note that all Puppeteer commands are
@@ -1 +1 @@
1
- {"version":3,"file":"getPuppeteer.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/getPuppeteer.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,iDAAiD,CAAA;AAO7F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAA8B,YAAY,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,6BAgGpE"}
1
+ {"version":3,"file":"getPuppeteer.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/getPuppeteer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,iDAAiD,CAAA;AAOlG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAA8B,YAAY,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,6BAgGpE"}
@@ -33,7 +33,7 @@ export default async function savePDF(filepath, options) {
33
33
  /**
34
34
  * type check
35
35
  */
36
- if (typeof filepath != 'string' || !filepath.endsWith('.pdf')) {
36
+ if (typeof filepath !== 'string' || !filepath.endsWith('.pdf')) {
37
37
  throw new Error('savePDF expects a filepath of type string and ".pdf" file ending');
38
38
  }
39
39
  const absoluteFilepath = getAbsoluteFilepath(filepath);
@@ -44,8 +44,8 @@ export default async function uploadFile(localPath) {
44
44
  if (typeof this.file !== 'function') {
45
45
  throw new Error(`The uploadFile command is not available in ${this.capabilities.browserName}`);
46
46
  }
47
- let zipData = [];
48
- let source = fs.createReadStream(localPath);
47
+ const zipData = [];
48
+ const source = fs.createReadStream(localPath);
49
49
  return new Promise((resolve, reject) => {
50
50
  archiver('zip')
51
51
  .on('error', (err) => reject(err))
@@ -53,7 +53,7 @@ export default function waitUntil(condition, { timeout = this.options.waitforTim
53
53
  interval = this.options.waitforInterval;
54
54
  }
55
55
  const fn = condition.bind(this);
56
- let timer = new Timer(interval, timeout, fn, true);
56
+ const timer = new Timer(interval, timeout, fn, true);
57
57
  return timer.catch((e) => {
58
58
  if (e.message === 'timeout') {
59
59
  if (typeof timeoutMsg === 'string') {
@@ -1 +1 @@
1
- {"version":3,"file":"constant.d.ts","sourceRoot":"","sources":["../../src/commands/constant.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AASzD,UAAU,oBAAqB,SAAQ,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,UAAU,gBAAgB;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,oBAAoB,CAAA;CACjC;AAED,eAAO,MAAM,UAAU,UACZ,YAAY,OAAO,GAAG,mBAAmB,WACvC,YAAY,EAAE,KACxB,gBAAgB,EAsClB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,WAAY,gBAAgB,SA8B1D,CAAA;AAED,eAAO,MAAM,WAAW,SACd,YAAY,OAAO,GAAG,mBAAmB,WACtC,YAAY,kBAgBxB,CAAA"}
1
+ {"version":3,"file":"constant.d.ts","sourceRoot":"","sources":["../../src/commands/constant.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AASzD,UAAU,oBAAqB,SAAQ,IAAI,CAAC,WAAW,EAAE,SAAS,CAAC;IAC/D,OAAO,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,UAAU,gBAAgB;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,oBAAoB,CAAA;CACjC;AAED,eAAO,MAAM,UAAU,UACZ,YAAY,OAAO,GAAG,mBAAmB,WACvC,YAAY,EAAE,KACxB,gBAAgB,EA4ClB,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,WAAY,gBAAgB,SA8B1D,CAAA;AAED,eAAO,MAAM,WAAW,SACd,YAAY,OAAO,GAAG,mBAAmB,WACtC,YAAY,kBAgBxB,CAAA"}
@@ -25,12 +25,15 @@ export const formatArgs = function (scope, actions) {
25
25
  if (POS_ACTIONS.includes(action.action) && formattedAction.options && actionElement) {
26
26
  formattedAction.options.element = actionElement;
27
27
  }
28
- if (formattedAction.options && typeof action.x === 'number' && isFinite(action.x))
28
+ if (formattedAction.options && typeof action.x === 'number' && isFinite(action.x)) {
29
29
  formattedAction.options.x = action.x;
30
- if (formattedAction.options && typeof action.y === 'number' && isFinite(action.y))
30
+ }
31
+ if (formattedAction.options && typeof action.y === 'number' && isFinite(action.y)) {
31
32
  formattedAction.options.y = action.y;
32
- if (formattedAction.options && action.ms)
33
+ }
34
+ if (formattedAction.options && action.ms) {
33
35
  formattedAction.options.ms = action.ms;
36
+ }
34
37
  /**
35
38
  * remove options property if empty
36
39
  */
@@ -86,7 +86,7 @@ export default async function click(options) {
86
86
  throw new TypeError('Options must be an object');
87
87
  }
88
88
  let button = (options.button || 0);
89
- let { x: xoffset = 0, y: yoffset = 0, skipRelease = false } = options || {};
89
+ const { x: xoffset = 0, y: yoffset = 0, skipRelease = false } = options || {};
90
90
  if (typeof xoffset !== 'number'
91
91
  || typeof yoffset !== 'number'
92
92
  || !Number.isInteger(xoffset)
@@ -1 +1 @@
1
- {"version":3,"file":"dragAndDrop.d.ts","sourceRoot":"","sources":["../../../src/commands/element/dragAndDrop.ts"],"names":[],"mappings":"AAQA,KAAK,kBAAkB,GAAG;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,KAAK,kBAAkB,GAAG;IACtB,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,CAAC,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAA8B,WAAW,CACrC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,MAAM,EAAE,WAAW,CAAC,OAAO,GAAG,kBAAkB,EAChD,EAAE,QAAa,EAAE,GAAE,kBAAuB,iBAqE7C"}
1
+ {"version":3,"file":"dragAndDrop.d.ts","sourceRoot":"","sources":["../../../src/commands/element/dragAndDrop.ts"],"names":[],"mappings":"AAQA,KAAK,kBAAkB,GAAG;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,KAAK,kBAAkB,GAAG;IACtB,CAAC,CAAC,EAAE,MAAM,CAAA;IACV,CAAC,CAAC,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAA8B,WAAW,CACrC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,MAAM,EAAE,WAAW,CAAC,OAAO,GAAG,kBAAkB,EAChD,EAAE,QAAa,EAAE,GAAE,kBAAuB,iBAmE7C"}
@@ -63,12 +63,9 @@ export default async function dragAndDrop(target, { duration = 10 } = {}) {
63
63
  if (!this.isW3C) {
64
64
  await this.moveTo();
65
65
  await this.buttonDown(ACTION_BUTTON);
66
- if (isMovingToElement) {
67
- await moveToElement.moveTo();
68
- }
69
- else {
70
- await this.moveToElement(null, moveToCoordinates.x, moveToCoordinates.y);
71
- }
66
+ isMovingToElement
67
+ ? await moveToElement.moveTo()
68
+ : await this.moveToElement(null, moveToCoordinates.x, moveToCoordinates.y);
72
69
  await sleep(duration);
73
70
  return this.buttonUp(ACTION_BUTTON);
74
71
  }
@@ -1 +1 @@
1
- {"version":3,"file":"getSize.d.ts","sourceRoot":"","sources":["../../../src/commands/element/getSize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAIjD,MAAM,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC;AAExD,iBAAS,OAAO,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE5D,iBAAS,OAAO,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAmDtF,eAAe,OAAO,CAAA"}
1
+ {"version":3,"file":"getSize.d.ts","sourceRoot":"","sources":["../../../src/commands/element/getSize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAIjD,MAAM,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,QAAQ,CAAC,CAAC;AAExD,iBAAS,OAAO,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAE5D,iBAAS,OAAO,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AA+CtF,eAAe,OAAO,CAAA"}
@@ -27,13 +27,9 @@ import { getElementRect } from '../../utils/index.js';
27
27
  *
28
28
  */
29
29
  async function getSize(prop) {
30
- let rect = {};
31
- if (this.isW3C) {
32
- rect = await getElementRect(this);
33
- }
34
- else {
35
- rect = await this.getElementSize(this.elementId);
36
- }
30
+ const rect = this.isW3C
31
+ ? await getElementRect(this)
32
+ : await this.getElementSize(this.elementId);
37
33
  if (prop && typeof rect[prop] === 'number') {
38
34
  return rect[prop];
39
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"scrollIntoView.d.ts","sourceRoot":"","sources":["../../../src/commands/element/scrollIntoView.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAA8B,cAAc,CACxC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,OAAO,GAAE,qBAAqB,GAAG,OAA+C,iBA0CnF"}
1
+ {"version":3,"file":"scrollIntoView.d.ts","sourceRoot":"","sources":["../../../src/commands/element/scrollIntoView.ts"],"names":[],"mappings":"AAsBA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAA8B,cAAc,CACxC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,OAAO,GAAE,qBAAqB,GAAG,OAA+C,iBA6CnF"}
@@ -1,5 +1,14 @@
1
+ import logger from '@wdio/logger';
1
2
  import { ELEMENT_KEY } from '../../constants.js';
2
3
  import { getBrowserObject } from '../../utils/index.js';
4
+ const log = logger('webdriverio');
5
+ function scrollIntoViewWeb(options = { block: 'start', inline: 'nearest' }) {
6
+ const browser = getBrowserObject(this);
7
+ return browser.execute((elem, options) => elem.scrollIntoView(options), {
8
+ [ELEMENT_KEY]: this.elementId,
9
+ ELEMENT: this.elementId, // jsonwp compatible
10
+ }, options);
11
+ }
3
12
  /**
4
13
  *
5
14
  * Scroll element into viewport ([MDN Reference](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView)).
@@ -23,12 +32,11 @@ import { getBrowserObject } from '../../utils/index.js';
23
32
  */
24
33
  export default async function scrollIntoView(options = { block: 'start', inline: 'nearest' }) {
25
34
  const browser = getBrowserObject(this);
26
- // Appium does not support the "wheel" action
35
+ /**
36
+ * Appium does not support the "wheel" action
37
+ */
27
38
  if (browser.isMobile) {
28
- return browser.execute((elem, options) => elem.scrollIntoView(options), {
29
- [ELEMENT_KEY]: this.elementId,
30
- ELEMENT: this.elementId, // jsonwp compatible
31
- }, options);
39
+ return scrollIntoViewWeb.call(this, options);
32
40
  }
33
41
  let deltaX = 0;
34
42
  let deltaY = 0;
@@ -54,7 +62,14 @@ export default async function scrollIntoView(options = { block: 'start', inline:
54
62
  deltaX += Math.round((viewport.height - elemSize.height) / 2);
55
63
  }
56
64
  }
57
- return browser.action('wheel')
58
- .scroll({ origin: this, duration: 200, deltaY, deltaX })
59
- .perform();
65
+ try {
66
+ return await browser.action('wheel')
67
+ .scroll({ origin: this, duration: 200, deltaY, deltaX })
68
+ .perform();
69
+ }
70
+ catch (err) {
71
+ log.warn(`Failed to execute "scrollIntoView" using WebDriver Actions API: ${err.message}!\n` +
72
+ 'Re-attempting using `Element.scrollIntoView` via Web API.');
73
+ return scrollIntoViewWeb.call(this, options);
74
+ }
60
75
  }
package/build/index.js CHANGED
@@ -31,7 +31,7 @@ export const remote = async function (params, remoteModifier) {
31
31
  * package (without undefined properties)
32
32
  */
33
33
  Object.assign(options, Object.entries(config)
34
- .reduce((a, [k, v]) => (v == null ? a : { ...a, [k]: v }), {}));
34
+ .reduce((a, [k, v]) => (typeof v === 'undefined' ? a : { ...a, [k]: v }), {}));
35
35
  if (typeof remoteModifier === 'function') {
36
36
  client = remoteModifier(client, options);
37
37
  }
@@ -65,7 +65,7 @@ export const attach = async function (attachOptions) {
65
65
  requestedCapabilities: attachOptions.requestedCapabilities
66
66
  };
67
67
  const prototype = getPrototype('browser');
68
- let automationProtocol = await getAutomationProtocol(params);
68
+ const automationProtocol = await getAutomationProtocol(params);
69
69
  const ProtocolDriver = (await import(automationProtocol)).default;
70
70
  return ProtocolDriver.attachToSession(params, undefined, prototype, wrapCommand);
71
71
  };
@@ -30,7 +30,7 @@ export default class MultiRemote {
30
30
  configurable: true
31
31
  };
32
32
  }
33
- propertiesObject['__propertiesObject__'] = {
33
+ propertiesObject.__propertiesObject__ = {
34
34
  value: propertiesObject
35
35
  };
36
36
  this.baseInstance = new MultiRemoteDriver(this.instances, propertiesObject);
@@ -72,7 +72,7 @@ export default function isElementClickable(elem) {
72
72
  // getOverlappingElements of every element with shadowRoot
73
73
  let shadowElementsFromPoint = [];
74
74
  for (let i = 0; i < elemsWithShadowRoot.length; ++i) {
75
- let shadowElement = elemsWithShadowRoot[i];
75
+ const shadowElement = elemsWithShadowRoot[i];
76
76
  shadowElementsFromPoint = shadowElementsFromPoint.concat(getOverlappingElements(elem, shadowElement.shadowRoot));
77
77
  }
78
78
  // remove duplicates and parents
@@ -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,CAsOrE"}
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"}
@@ -48,17 +48,19 @@ export default function isElementDisplayed(element) {
48
48
  return enclosingNodeOrSelfMatchingPredicate(element.parentNode, nodeIsElement);
49
49
  }
50
50
  function enclosingNodeOrSelfMatchingPredicate(targetNode, predicate) {
51
- for (let node = targetNode; node && node !== targetNode.ownerDocument; node = node.parentNode)
51
+ for (let node = targetNode; node && node !== targetNode.ownerDocument; node = node.parentNode) {
52
52
  if (predicate(node)) {
53
53
  return node;
54
54
  }
55
+ }
55
56
  return null;
56
57
  }
57
58
  function enclosingElementOrSelfMatchingPredicate(targetElement, predicate) {
58
- for (let element = targetElement; element && element !== targetElement.ownerDocument; element = parentElementForElement(element))
59
+ for (let element = targetElement; element && element !== targetElement.ownerDocument; element = parentElementForElement(element)) {
59
60
  if (predicate(element)) {
60
61
  return element;
61
62
  }
63
+ }
62
64
  return null;
63
65
  }
64
66
  function cascadedStylePropertyForElement(element, property) {
@@ -71,8 +73,8 @@ export default function isElementDisplayed(element) {
71
73
  if (element instanceof window.ShadowRoot) {
72
74
  element = element.host;
73
75
  }
74
- let computedStyle = window.getComputedStyle(element);
75
- let computedStyleProperty = computedStyle.getPropertyValue(property);
76
+ const computedStyle = window.getComputedStyle(element);
77
+ const computedStyleProperty = computedStyle.getPropertyValue(property);
76
78
  if (computedStyleProperty && computedStyleProperty !== 'inherit') {
77
79
  return computedStyleProperty;
78
80
  }
@@ -84,20 +86,20 @@ export default function isElementDisplayed(element) {
84
86
  // I think all important non-inheritable properties (width, height, etc.)
85
87
  // for our purposes here are specially resolved, so this may not be an issue.
86
88
  // Specification is here: https://drafts.csswg.org/cssom/#resolved-values
87
- let parentElement = parentElementForElement(element);
89
+ const parentElement = parentElementForElement(element);
88
90
  return cascadedStylePropertyForElement(parentElement, property);
89
91
  }
90
92
  function elementSubtreeHasNonZeroDimensions(element) {
91
- let boundingBox = element.getBoundingClientRect();
93
+ const boundingBox = element.getBoundingClientRect();
92
94
  if (boundingBox.width > 0 && boundingBox.height > 0) {
93
95
  return true;
94
96
  }
95
97
  // Paths can have a zero width or height. Treat them as shown if the stroke width is positive.
96
98
  if (element.tagName.toUpperCase() === 'PATH' && boundingBox.width + boundingBox.height > 0) {
97
- let strokeWidth = cascadedStylePropertyForElement(element, 'stroke-width');
99
+ const strokeWidth = cascadedStylePropertyForElement(element, 'stroke-width');
98
100
  return !!strokeWidth && (parseInt(strokeWidth, 10) > 0);
99
101
  }
100
- let cascadedOverflow = cascadedStylePropertyForElement(element, 'overflow');
102
+ const cascadedOverflow = cascadedStylePropertyForElement(element, 'overflow');
101
103
  if (cascadedOverflow === 'hidden') {
102
104
  return false;
103
105
  }
@@ -114,7 +116,7 @@ export default function isElementDisplayed(element) {
114
116
  });
115
117
  }
116
118
  function elementOverflowsContainer(element) {
117
- let cascadedOverflow = cascadedStylePropertyForElement(element, 'overflow');
119
+ const cascadedOverflow = cascadedStylePropertyForElement(element, 'overflow');
118
120
  if (cascadedOverflow !== 'hidden') {
119
121
  return false;
120
122
  }
@@ -177,7 +179,7 @@ export default function isElementDisplayed(element) {
177
179
  case 'OPTGROUP':
178
180
  case 'OPTION': {
179
181
  // Option/optgroup are considered shown if the containing <select> is shown.
180
- let enclosingSelectElement = enclosingNodeOrSelfMatchingPredicate(element, (e) => e.tagName.toUpperCase() === 'SELECT');
182
+ const enclosingSelectElement = enclosingNodeOrSelfMatchingPredicate(element, (e) => e.tagName.toUpperCase() === 'SELECT');
181
183
  return isElementDisplayed(enclosingSelectElement);
182
184
  }
183
185
  case 'INPUT':
@@ -194,10 +196,10 @@ export default function isElementDisplayed(element) {
194
196
  if (cascadedStylePropertyForElement(element, 'visibility') !== 'visible') {
195
197
  return false;
196
198
  }
197
- let hasAncestorWithZeroOpacity = !!enclosingElementOrSelfMatchingPredicate(element, (e) => {
199
+ const hasAncestorWithZeroOpacity = !!enclosingElementOrSelfMatchingPredicate(element, (e) => {
198
200
  return Number(cascadedStylePropertyForElement(e, 'opacity')) === 0;
199
201
  });
200
- let hasAncestorWithDisplayNone = !!enclosingElementOrSelfMatchingPredicate(element, (e) => {
202
+ const hasAncestorWithDisplayNone = !!enclosingElementOrSelfMatchingPredicate(element, (e) => {
201
203
  return cascadedStylePropertyForElement(e, 'display') === 'none';
202
204
  });
203
205
  if (hasAncestorWithZeroOpacity || hasAncestorWithDisplayNone) {
@@ -86,8 +86,8 @@ class Timer {
86
86
  return;
87
87
  }
88
88
  // autocorrect timer
89
- let diff = (Date.now() - (this._startTime || 0)) - (this._ticks++ * this._delay);
90
- let delay = Math.max(0, this._delay - diff);
89
+ const diff = (Date.now() - (this._startTime || 0)) - (this._ticks++ * this._delay);
90
+ const delay = Math.max(0, this._delay - diff);
91
91
  // clear old timeoutID
92
92
  this._stop();
93
93
  // check if we have time to one more tick
@@ -1,4 +1,5 @@
1
- import BaseAction, { BaseActionParams } from './base.js';
1
+ import type { BaseActionParams } from './base.js';
2
+ import BaseAction from './base.js';
2
3
  export default class KeyAction extends BaseAction {
3
4
  #private;
4
5
  constructor(instance: WebdriverIO.Browser, params?: BaseActionParams);
@@ -1 +1 @@
1
- {"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/key.ts"],"names":[],"mappings":"AAGA,OAAO,UAAU,EAAE,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAGxD,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,UAAU;;gBAChC,QAAQ,EAAE,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,gBAAgB;IA4BrE;;;OAGG;IACH,EAAE,CAAE,KAAK,EAAE,MAAM;IAKjB;;;OAGG;IACH,IAAI,CAAE,KAAK,EAAE,MAAM;CAItB"}
1
+ {"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/key.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACjD,OAAO,UAAU,MAAM,WAAW,CAAA;AAGlC,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,UAAU;;gBAChC,QAAQ,EAAE,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,gBAAgB;IA4BrE;;;OAGG;IACH,EAAE,CAAE,KAAK,EAAE,MAAM;IAKjB;;;OAGG;IACH,IAAI,CAAE,KAAK,EAAE,MAAM;CAItB"}
@@ -1,5 +1,6 @@
1
- import { ElementReference } from '@wdio/protocols';
2
- import BaseAction, { BaseActionParams } from './base.js';
1
+ import type { ElementReference } from '@wdio/protocols';
2
+ import type { BaseActionParams } from './base.js';
3
+ import BaseAction from './base.js';
3
4
  import type { ChainablePromiseElement } from '../../types';
4
5
  export type ButtonNames = 'left' | 'middle' | 'right';
5
6
  export type Button = 0 | 1 | 2;
@@ -1 +1 @@
1
- {"version":3,"file":"pointer.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/pointer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,UAAU,EAAE,EAAE,gBAAgB,EAAiB,MAAM,WAAW,CAAA;AACvE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAE1D,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;AACrD,MAAM,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAC9B,MAAM,MAAM,MAAM,GAAG,SAAS,GAAG,UAAU,CAAA;AAM3C,UAAU,qBAAqB;IAC3B;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAA;CACjB;AAKD,QAAA,MAAM,cAAc;;;;;;;;;;;CAWnB,CAAA;AACD,QAAA,MAAM,mBAAmB;;;;;CAKxB,CAAA;AAED,KAAK,mBAAmB,GAAG,OAAO,CAAC,OAAO,cAAc,CAAC,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;AAC1F,KAAK,uBAAuB,GAAG,OAAO,CAAC,OAAO,mBAAmB,CAAC,GAAG,mBAAmB,CAAA;AAExF,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU;gBACpC,QAAQ,EAAE,WAAW,CAAC,OAAO,EAAE,MAAM,GAAE,gBAAqB;IAQzE;;;;;OAKG;IACH,IAAI,CAAE,MAAM,EAAE,uBAAuB,GAAG,aAAa;IACrD,IAAI,CAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,aAAa;IAoB1C;;;OAGG;IACH,EAAE,CAAE,MAAM,CAAC,EAAE,WAAW,GAAG,aAAa;IACxC,EAAE,CAAE,MAAM,CAAC,EAAE,qBAAqB,GAAG,aAAa;IAWlD;;;OAGG;IACH,IAAI,CAAE,MAAM,CAAC,EAAE,WAAW,GAAG,aAAa;IAC1C,IAAI,CAAE,MAAM,CAAC,EAAE,mBAAmB,GAAG,aAAa;IAalD;;OAEG;IACH,MAAM;CAIT"}
1
+ {"version":3,"file":"pointer.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/pointer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAiB,MAAM,WAAW,CAAA;AAChE,OAAO,UAAU,MAAM,WAAW,CAAA;AAClC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAE1D,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAA;AACrD,MAAM,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AAC9B,MAAM,MAAM,MAAM,GAAG,SAAS,GAAG,UAAU,CAAA;AAM3C,UAAU,qBAAqB;IAC3B;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAA;CACjB;AAKD,QAAA,MAAM,cAAc;;;;;;;;;;;CAWnB,CAAA;AACD,QAAA,MAAM,mBAAmB;;;;;CAKxB,CAAA;AAED,KAAK,mBAAmB,GAAG,OAAO,CAAC,OAAO,cAAc,CAAC,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;AAC1F,KAAK,uBAAuB,GAAG,OAAO,CAAC,OAAO,mBAAmB,CAAC,GAAG,mBAAmB,CAAA;AAExF,MAAM,CAAC,OAAO,OAAO,aAAc,SAAQ,UAAU;gBACpC,QAAQ,EAAE,WAAW,CAAC,OAAO,EAAE,MAAM,GAAE,gBAAqB;IAQzE;;;;;OAKG;IACH,IAAI,CAAE,MAAM,EAAE,uBAAuB,GAAG,aAAa;IACrD,IAAI,CAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,aAAa;IAoB1C;;;OAGG;IACH,EAAE,CAAE,MAAM,CAAC,EAAE,WAAW,GAAG,aAAa;IACxC,EAAE,CAAE,MAAM,CAAC,EAAE,qBAAqB,GAAG,aAAa;IAWlD;;;OAGG;IACH,IAAI,CAAE,MAAM,CAAC,EAAE,WAAW,GAAG,aAAa;IAC1C,IAAI,CAAE,MAAM,CAAC,EAAE,mBAAmB,GAAG,aAAa;IAalD;;OAEG;IACH,MAAM;CAIT"}
@@ -1,4 +1,5 @@
1
- import BaseAction, { BaseActionParams } from './base.js';
1
+ import type { BaseActionParams } from './base.js';
2
+ import BaseAction from './base.js';
2
3
  import type { ChainablePromiseElement } from '../../types';
3
4
  export interface ScrollParams {
4
5
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"wheel.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/wheel.ts"],"names":[],"mappings":"AAAA,OAAO,UAAU,EAAE,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACxD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAE1D,MAAM,WAAW,YAAY;IACzB;;OAEG;IACH,CAAC,EAAE,MAAM,CAAA;IACT;;OAEG;IACH,CAAC,EAAE,MAAM,CAAA;IACT;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC,OAAO,GAAG,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;IAC3E;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;CACnB;AAUD,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,UAAU;gBACnC,QAAQ,EAAE,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,gBAAgB;IAIpE;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC;CAIxC"}
1
+ {"version":3,"file":"wheel.d.ts","sourceRoot":"","sources":["../../../src/utils/actions/wheel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACjD,OAAO,UAAU,MAAM,WAAW,CAAA;AAClC,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAE1D,MAAM,WAAW,YAAY;IACzB;;OAEG;IACH,CAAC,EAAE,MAAM,CAAA;IACT;;OAEG;IACH,CAAC,EAAE,MAAM,CAAA;IACT;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,MAAM,EAAE,MAAM,CAAA;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC,OAAO,GAAG,uBAAuB,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;IAC3E;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAA;CACnB;AAUD,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,UAAU;gBACnC,QAAQ,EAAE,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,gBAAgB;IAIpE;;OAEG;IACH,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC;CAIxC"}
@@ -25,7 +25,7 @@ function getSauceEndpoint(region, { isRDC, isVisual } = {}) {
25
25
  * helper to detect the Selenium backend according to given capabilities
26
26
  */
27
27
  export default function detectBackend(options = {}) {
28
- let { port, hostname, user, key, protocol, region, headless, path, capabilities } = options;
28
+ const { port, hostname, user, key, protocol, region, headless, path, capabilities } = options;
29
29
  /**
30
30
  * browserstack
31
31
  * e.g. zHcv9sZ39ip8ZPsxBVJ2
@@ -1 +1 @@
1
- {"version":3,"file":"findStrategy.d.ts","sourceRoot":"","sources":["../../src/utils/findStrategy.ts"],"names":[],"mappings":"AA2BA,KAAK,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"}
1
+ {"version":3,"file":"findStrategy.d.ts","sourceRoot":"","sources":["../../src/utils/findStrategy.ts"],"names":[],"mappings":"AA4BA,KAAK,gBAAgB,GAAG,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAA;AA4F/D,eAAO,MAAM,YAAY,aAAuB,gBAAgB,UAAU,OAAO,aAAa,OAAO;;;CAuKpG,CAAA"}
@@ -28,8 +28,9 @@ const defineStrategy = function (selector) {
28
28
  // an error like "selector.match is not a function"
29
29
  // Use '-android datamatcher' or '-android viewmatcher' strategy if selector is a plain object (Android only)
30
30
  if (typeof selector === 'object') {
31
- if (JSON.stringify(selector).indexOf('test.espresso.matcher.ViewMatchers') < 0)
31
+ if (JSON.stringify(selector).indexOf('test.espresso.matcher.ViewMatchers') < 0) {
32
32
  return '-android datamatcher';
33
+ }
33
34
  return '-android viewmatcher';
34
35
  }
35
36
  const stringSelector = selector;
@@ -270,8 +271,8 @@ const createRoleBaseXpathSelector = (role) => {
270
271
  const locatorArr = [];
271
272
  roleElements.get(role)?.forEach((value) => {
272
273
  let locator;
273
- let tagname, tagAttribute, tagAttributevalue;
274
- tagname = value.name;
274
+ let tagAttribute, tagAttributevalue;
275
+ const tagname = value.name;
275
276
  if (value.attributes instanceof Array) {
276
277
  value.attributes.forEach((val) => {
277
278
  tagAttribute = val.name;
@@ -102,16 +102,16 @@ export function parseCSS(cssPropertyValue, cssProperty) {
102
102
  /**
103
103
  * parse color values
104
104
  */
105
- let color = parsedValue.value;
105
+ const color = parsedValue.value;
106
106
  parsedValue.parsed = rgb2hex(parsedValue.value);
107
107
  parsedValue.parsed.type = 'color';
108
108
  const colorType = /[rgba]+/g.exec(color) || [];
109
109
  parsedValue.parsed[colorType[0]] = color;
110
110
  }
111
111
  else if (parsedValue.property === 'font-family') {
112
- let font = cssValue(cssPropertyValue);
113
- let string = parsedValue.value;
114
- let value = cssPropertyValue.split(/,/).map(sanitizeCSS);
112
+ const font = cssValue(cssPropertyValue);
113
+ const string = parsedValue.value;
114
+ const value = cssPropertyValue.split(/,/).map(sanitizeCSS);
115
115
  parsedValue.value = sanitizeCSS(font[0].value || font[0].string);
116
116
  parsedValue.parsed = { value, type: 'font', string };
117
117
  }
@@ -301,12 +301,12 @@ export function verifyArgsAndStripIfElement(args) {
301
301
  */
302
302
  export async function getElementRect(scope) {
303
303
  const rect = await scope.getElementRect(scope.elementId);
304
- let defaults = { x: 0, y: 0, width: 0, height: 0 };
304
+ const defaults = { x: 0, y: 0, width: 0, height: 0 };
305
305
  /**
306
306
  * getElementRect workaround for Safari 12.0.3
307
307
  * if one of [x, y, height, width] is undefined get rect with javascript
308
308
  */
309
- if (Object.keys(defaults).some((key) => rect[key] == null)) {
309
+ if (Object.keys(defaults).some((key) => !rect[key])) {
310
310
  /* istanbul ignore next */
311
311
  const rectJs = await getBrowserObject(scope).execute(function (el) {
312
312
  if (!el || !el.getBoundingClientRect) {
@@ -322,7 +322,7 @@ export async function getElementRect(scope) {
322
322
  }, scope);
323
323
  // try set proper value
324
324
  Object.keys(defaults).forEach((key) => {
325
- if (rect[key] != null) {
325
+ if (typeof rect[key] !== 'undefined') {
326
326
  return;
327
327
  }
328
328
  if (rectJs && typeof rectJs[key] === 'number') {
@@ -4,7 +4,7 @@ import implicitWait from './implicitWait.js';
4
4
  * into stale element exception errors
5
5
  */
6
6
  export default async function refetchElement(currentElement, commandName) {
7
- let selectors = [];
7
+ const selectors = [];
8
8
  //Crawl back to the browser object, and cache all selectors
9
9
  while (currentElement.elementId && currentElement.parent) {
10
10
  selectors.push({ selector: currentElement.selector, index: currentElement.index || 0 });
@@ -18,13 +18,14 @@ export default function querySelectorAllDeep(findMany, s, r) {
18
18
  tokens.push(unmatched);
19
19
  }
20
20
  }
21
- var tokens = [], match, unmatched, regex, state = [0], next_match_idx = 0, prev_match_idx, not_escaped_pattern = /(?:[^\\]|(?:^|[^\\])(?:\\\\)+)$/, whitespace_pattern = /^\s+$/, state_patterns = [
21
+ const tokens = [], state = [0], not_escaped_pattern = /(?:[^\\]|(?:^|[^\\])(?:\\\\)+)$/, whitespace_pattern = /^\s+$/, state_patterns = [
22
22
  /\s+|\/\*|["'>~+[(]/g,
23
23
  /\s+|\/\*|["'[\]()]/g,
24
24
  /\s+|\/\*|["'[\]()]/g,
25
25
  null,
26
26
  /\*\//g, // comment
27
27
  ];
28
+ let match, unmatched, regex, next_match_idx = 0, prev_match_idx;
28
29
  sel = sel.trim();
29
30
  // eslint-disable-next-line no-constant-condition
30
31
  while (true) {
@@ -124,7 +125,7 @@ export default function querySelectorAllDeep(findMany, s, r) {
124
125
  }
125
126
  function _querySelectorDeep(selector, root, allElements = null) {
126
127
  selector = normalizeSelector(selector);
127
- let lightElement = root.querySelector(selector);
128
+ const lightElement = root.querySelector(selector);
128
129
  // @ts-expect-error createShadowRoot does not exist in head
129
130
  if (document.head.createShadowRoot || document.head.attachShadow) {
130
131
  // no need to do any special if selector matches something specific in light-dom
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.0.13",
4
+ "version": "8.0.14",
5
5
  "homepage": "https://webdriver.io",
6
6
  "author": "Christian Bromann <mail@bromann.dev>",
7
7
  "license": "MIT",
@@ -66,31 +66,31 @@
66
66
  "dependencies": {
67
67
  "@types/aria-query": "^5.0.0",
68
68
  "@types/node": "^18.0.0",
69
- "@wdio/config": "8.0.13",
70
- "@wdio/globals": "8.0.13",
71
- "@wdio/logger": "8.0.0",
69
+ "@wdio/config": "8.0.14",
70
+ "@wdio/globals": "8.0.14",
71
+ "@wdio/logger": "8.0.14",
72
72
  "@wdio/protocols": "8.0.0",
73
- "@wdio/repl": "8.0.0",
74
- "@wdio/types": "8.0.11",
75
- "@wdio/utils": "8.0.13",
73
+ "@wdio/repl": "8.0.14",
74
+ "@wdio/types": "8.0.14",
75
+ "@wdio/utils": "8.0.14",
76
76
  "archiver": "^5.0.0",
77
77
  "aria-query": "^5.0.0",
78
78
  "css-shorthand-properties": "^1.1.1",
79
79
  "css-value": "^0.0.1",
80
- "devtools": "8.0.13",
81
- "devtools-protocol": "^0.0.1081726",
80
+ "devtools": "8.0.14",
81
+ "devtools-protocol": "^0.0.1085790",
82
82
  "grapheme-splitter": "^1.0.2",
83
83
  "import-meta-resolve": "^2.1.0",
84
84
  "is-plain-obj": "^4.1.0",
85
85
  "lodash.clonedeep": "^4.5.0",
86
86
  "lodash.zip": "^4.2.0",
87
87
  "minimatch": "^5.0.0",
88
- "puppeteer-core": "19.4.0",
88
+ "puppeteer-core": "19.4.1",
89
89
  "query-selector-shadow-dom": "^1.0.0",
90
90
  "resq": "^1.9.1",
91
91
  "rgb2hex": "0.2.5",
92
92
  "serialize-error": "^8.0.0",
93
- "webdriver": "8.0.13"
93
+ "webdriver": "8.0.14"
94
94
  },
95
- "gitHead": "912db21d2cd4552a02b776ba74cae05440b076de"
95
+ "gitHead": "ab58bc79c1df2e146d02a68ee444766ec371e6d2"
96
96
  }