webdriverio 9.14.0 → 9.16.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.
Files changed (58) hide show
  1. package/build/commands/browser/action.d.ts +1 -1
  2. package/build/commands/browser/custom$.d.ts.map +1 -1
  3. package/build/commands/browser/debug.d.ts +1 -1
  4. package/build/commands/browser/debug.d.ts.map +1 -1
  5. package/build/commands/browser/execute.d.ts +2 -1
  6. package/build/commands/browser/execute.d.ts.map +1 -1
  7. package/build/commands/browser/executeAsync.d.ts +16 -1
  8. package/build/commands/browser/executeAsync.d.ts.map +1 -1
  9. package/build/commands/browser/getWindowSize.d.ts.map +1 -1
  10. package/build/commands/browser/keys.d.ts +2 -2
  11. package/build/commands/browser/keys.d.ts.map +1 -1
  12. package/build/commands/browser/mockClearAll.d.ts.map +1 -1
  13. package/build/commands/browser/mockRestoreAll.d.ts.map +1 -1
  14. package/build/commands/browser/pause.d.ts +1 -1
  15. package/build/commands/browser/pause.d.ts.map +1 -1
  16. package/build/commands/browser/react$$.d.ts.map +1 -1
  17. package/build/commands/browser/react$.d.ts.map +1 -1
  18. package/build/commands/browser/reloadSession.d.ts.map +1 -1
  19. package/build/commands/browser/restore.d.ts.map +1 -1
  20. package/build/commands/browser/savePDF.d.ts.map +1 -1
  21. package/build/commands/browser/saveRecordingScreen.d.ts.map +1 -1
  22. package/build/commands/browser/saveScreenshot.d.ts.map +1 -1
  23. package/build/commands/browser/scroll.d.ts +1 -1
  24. package/build/commands/browser/scroll.d.ts.map +1 -1
  25. package/build/commands/browser/setCookies.d.ts.map +1 -1
  26. package/build/commands/browser/setViewport.d.ts.map +1 -1
  27. package/build/commands/browser/setWindowSize.d.ts.map +1 -1
  28. package/build/commands/browser/switchFrame.d.ts.map +1 -1
  29. package/build/commands/browser/switchWindow.d.ts.map +1 -1
  30. package/build/commands/browser/throttle.d.ts.map +1 -1
  31. package/build/commands/browser/throttleCPU.d.ts.map +1 -1
  32. package/build/commands/browser/throttleNetwork.d.ts +1 -1
  33. package/build/commands/browser/throttleNetwork.d.ts.map +1 -1
  34. package/build/commands/browser/touchAction.d.ts.map +1 -1
  35. package/build/commands/element/addValue.d.ts +3 -1
  36. package/build/commands/element/addValue.d.ts.map +1 -1
  37. package/build/commands/element/execute.d.ts +2 -1
  38. package/build/commands/element/execute.d.ts.map +1 -1
  39. package/build/commands/element/executeAsync.d.ts +24 -1
  40. package/build/commands/element/executeAsync.d.ts.map +1 -1
  41. package/build/commands/element/getHTML.d.ts.map +1 -1
  42. package/build/commands/element/isStable.d.ts +20 -2
  43. package/build/commands/element/isStable.d.ts.map +1 -1
  44. package/build/commands/element/setValue.d.ts +3 -1
  45. package/build/commands/element/setValue.d.ts.map +1 -1
  46. package/build/commands/element/shadow$$.d.ts +1 -1
  47. package/build/index.d.ts.map +1 -1
  48. package/build/index.js +131 -125
  49. package/build/node.js +104 -105
  50. package/build/scripts/polyfill.d.ts +10 -0
  51. package/build/scripts/polyfill.d.ts.map +1 -0
  52. package/build/scripts/polyfill.js +12 -0
  53. package/build/session/polyfill.d.ts +0 -9
  54. package/build/session/polyfill.d.ts.map +1 -1
  55. package/build/types.d.ts +14 -5
  56. package/build/types.d.ts.map +1 -1
  57. package/build/utils/index.d.ts +1 -1
  58. package/package.json +8 -8
@@ -19,7 +19,7 @@ import { KeyAction, PointerAction, WheelAction } from '../../utils/actions/index
19
19
  *
20
20
  * Support for this command and specific actions can differ based on the environment. Progress on the development
21
21
  * can be followed on [wpt.fyi](https://wpt.fyi/results/webdriver/tests/perform_actions?label=experimental&label=master&aligned).
22
- * For mobile you might want to use Appium specific gesture commands on [iOS](https://github.com/appium/appium-xcuitest-driver#mobile-pinch)
22
+ * For mobile you might want to use Appium specific gesture commands on [iOS](https://appium.github.io/appium-xcuitest-driver/latest/guides/gestures/)
23
23
  * and [Android](https://github.com/appium/appium-uiautomator2-driver#mobile-gesture-commands).
24
24
  *
25
25
  * :::
@@ -1 +1 @@
1
- {"version":3,"file":"custom$.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/custom$.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,OAAO,CACzB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,YAAY,EAAE,MAAM,EACpB,GAAG,iBAAiB,EAAE,OAAO,EAAE,gCA0BlC"}
1
+ {"version":3,"file":"custom$.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/custom$.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,OAAO,CACzB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,YAAY,EAAE,MAAM,EACpB,GAAG,iBAAiB,EAAE,OAAO,EAAE,GAC/B,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAyB/B"}
@@ -28,5 +28,5 @@
28
28
  * @type utility
29
29
  *
30
30
  */
31
- export declare function debug(this: WebdriverIO.Browser, commandTimeout?: number): Promise<unknown>;
31
+ export declare function debug(this: WebdriverIO.Browser, commandTimeout?: number): Promise<void | unknown>;
32
32
  //# sourceMappingURL=debug.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/debug.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,KAAK,CACjB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,cAAc,SAAO,oBA+ExB"}
1
+ {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/debug.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,KAAK,CACjB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,cAAc,SAAO,GACtB,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC,CA8EzB"}
@@ -1,3 +1,4 @@
1
+ import type { TransformElement, TransformReturn } from '../../types.js';
1
2
  /**
2
3
  *
3
4
  * Inject a snippet of JavaScript into the page for execution in the context of the currently selected frame.
@@ -33,5 +34,5 @@
33
34
  * @type protocol
34
35
  *
35
36
  */
36
- export declare function execute<ReturnValue, InnerArguments extends unknown[]>(this: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser, script: string | ((...innerArgs: InnerArguments) => ReturnValue), ...args: InnerArguments): Promise<ReturnValue>;
37
+ export declare function execute<ReturnValue, InnerArguments extends unknown[]>(this: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser, script: string | ((...innerArgs: TransformElement<InnerArguments>) => ReturnValue), ...args: InnerArguments): Promise<TransformReturn<ReturnValue>>;
37
38
  //# sourceMappingURL=execute.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/execute.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAsB,OAAO,CAAC,WAAW,EAAE,cAAc,SAAS,OAAO,EAAE,EACvE,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB,EAC1D,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,SAAS,EAAE,cAAc,KAAK,WAAW,CAAC,EAChE,GAAG,IAAI,EAAE,cAAc,GACxB,OAAO,CAAC,WAAW,CAAC,CAuCtB"}
1
+ {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/execute.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAsB,OAAO,CAAC,WAAW,EAAE,cAAc,SAAS,OAAO,EAAE,EACvE,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB,EAC1D,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,SAAS,EAAE,gBAAgB,CAAC,cAAc,CAAC,KAAK,WAAW,CAAC,EAClF,GAAG,IAAI,EAAE,cAAc,GACxB,OAAO,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAuCvC"}
@@ -1,3 +1,4 @@
1
+ import type { TransformElement } from '../../types.js';
1
2
  /**
2
3
  * :::warning
3
4
  * The `executeAsync` command is deprecated and will be removed in a future version.
@@ -35,6 +36,15 @@
35
36
  // node.js context - client and console are available
36
37
  console.log(result) // outputs: 10
37
38
  });
39
+
40
+ :executeAsync.ts
41
+ // explicitly type the return value of the script to ensure type safety
42
+ const result: number = await browser.executeAsync(function(a, b, c, d, done) {
43
+ // browser context - you may not access client or console
44
+ setTimeout(() => {
45
+ done(a + b + c + d)
46
+ }, 3000);
47
+ }, 1, 2, 3, 4)
38
48
  * </example>
39
49
  *
40
50
  * @param {String|Function} script The script to execute.
@@ -46,5 +56,10 @@
46
56
  * @type protocol
47
57
  * @deprecated Please use `execute` instead
48
58
  */
49
- export declare function executeAsync<ReturnValue, InnerArguments extends unknown[]>(this: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser, script: string | ((...args: [...innerArgs: InnerArguments, callback: (result?: ReturnValue) => void]) => void), ...args: InnerArguments): Promise<ReturnValue>;
59
+ export declare function executeAsync<ReturnValue, InnerArguments extends unknown[]>(this: WebdriverIO.Browser | WebdriverIO.MultiRemoteBrowser, script: string | ((...args: [
60
+ ...innerArgs: {
61
+ [K in keyof InnerArguments]: TransformElement<InnerArguments[K]>;
62
+ },
63
+ callback: (result?: TransformElement<ReturnValue>) => void
64
+ ]) => void), ...args: InnerArguments): Promise<ReturnValue>;
50
65
  //# sourceMappingURL=executeAsync.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"executeAsync.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/executeAsync.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAsB,YAAY,CAAC,WAAW,EAAE,cAAc,SAAS,OAAO,EAAE,EAC5E,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB,EAC1D,MAAM,EACF,MAAM,GACN,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,SAAS,EAAE,cAAc,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC,KAAK,IAAI,CAAC,EACjG,GAAG,IAAI,EAAE,cAAc,GACxB,OAAO,CAAC,WAAW,CAAC,CAiDtB"}
1
+ {"version":3,"file":"executeAsync.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/executeAsync.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,wBAAsB,YAAY,CAAC,WAAW,EAAE,cAAc,SAAS,OAAO,EAAE,EAC5E,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,kBAAkB,EAC1D,MAAM,EACF,MAAM,GACN,CACI,CACI,GAAG,IAAI,EAAE;IAAC,GAAG,SAAS,EAAE;SAAG,CAAC,IAAI,MAAM,cAAc,GAAG,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;KAAE;IAC5F,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,gBAAgB,CAAC,WAAW,CAAC,KAAK,IAAI;CAAC,KAC1D,IAAI,CACZ,EACL,GAAG,IAAI,EAAE,cAAc,GACxB,OAAO,CAAC,WAAW,CAAC,CAiDtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"getWindowSize.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/getWindowSize.ts"],"names":[],"mappings":"AAEA,UAAU,WAAW;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACjB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,WAAW,CAAC,OAAO,wBAK5D"}
1
+ {"version":3,"file":"getWindowSize.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/getWindowSize.ts"],"names":[],"mappings":"AAEA,UAAU,WAAW;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACjB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,OAAO,CAAC,WAAW,CAAC,CAKnF"}
@@ -3,8 +3,8 @@
3
3
  * Send a sequence of key strokes to the "active" element. You can make an input element active by just clicking
4
4
  * on it. To use characters like "Left arrow" or "Back space", import the `Key` object from the WebdriverIO package.
5
5
  *
6
- * Modifier like `Control`, `Shift`, `Alt` and `Command` will stay pressed so you need to trigger them again to release
7
- * them. Modifying a click however requires you to use the WebDriver Actions API through the
6
+ * Modifier like `Control`, `Shift`, `Alt` and `Command` will stay pressed throughout the sequence and will be released
7
+ * at the end. Modifying a click requires you to use the WebDriver Actions API through the
8
8
  * [performActions](https://webdriver.io/docs/api/webdriver#performactions) method.
9
9
  *
10
10
  * :::info
@@ -1 +1 @@
1
- {"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/keys.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,IAAI,CACtB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,iBAkC3B"}
1
+ {"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/keys.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,IAAI,CACtB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GACzB,OAAO,CAAC,IAAI,CAAC,CAiCf"}
@@ -1 +1 @@
1
- {"version":3,"file":"mockClearAll.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/mockClearAll.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,YAAY,kBAOjC"}
1
+ {"version":3,"file":"mockClearAll.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/mockClearAll.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,YAAY,IAAK,OAAO,CAAC,IAAI,CAAC,CAOnD"}
@@ -1 +1 @@
1
- {"version":3,"file":"mockRestoreAll.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/mockRestoreAll.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,cAAc,kBAOnC"}
1
+ {"version":3,"file":"mockRestoreAll.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/mockRestoreAll.ts"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,cAAc,IAAK,OAAO,CAAC,IAAI,CAAC,CAOrD"}
@@ -19,5 +19,5 @@
19
19
  * @type utility
20
20
  *
21
21
  */
22
- export declare function pause(this: WebdriverIO.Browser, milliseconds?: number): Promise<unknown>;
22
+ export declare function pause(this: WebdriverIO.Browser, milliseconds?: number): Promise<void>;
23
23
  //# sourceMappingURL=pause.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pause.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/pause.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,KAAK,CACjB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,YAAY,SAAO,oBAGtB"}
1
+ {"version":3,"file":"pause.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/pause.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,KAAK,CACjB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,YAAY,SAAO,GACpB,OAAO,CAAC,IAAI,CAAC,CAEf"}
@@ -1 +1 @@
1
- {"version":3,"file":"react$$.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/react$$.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAsB,OAAO,CACzB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,QAAQ,EAAE,MAAM,EAChB,EAAE,KAAU,EAAE,KAAU,EAAE,GAAE,oBAAyB,qCAUxD"}
1
+ {"version":3,"file":"react$$.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/react$$.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAsB,OAAO,CACzB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,QAAQ,EAAE,MAAM,EAChB,EAAE,KAAU,EAAE,KAAU,EAAE,GAAE,oBAAyB,GACtD,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,CASnC"}
@@ -1 +1 @@
1
- {"version":3,"file":"react$.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/react$.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAsB,MAAM,CACxB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,QAAQ,EAAE,MAAM,EAChB,EAAE,KAAU,EAAE,KAAU,EAAE,GAAE,oBAAyB,gCASxD"}
1
+ {"version":3,"file":"react$.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/react$.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAsB,MAAM,CACxB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,QAAQ,EAAE,MAAM,EAChB,EAAE,KAAU,EAAE,KAAU,EAAE,GAAE,oBAAyB,GACtD,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,CAQ9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"reloadSession.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/reloadSession.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAsB,aAAa,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,EAAE,eAAe,CAAC,EAAE,WAAW,CAAC,YAAY,mBAqCzG"}
1
+ {"version":3,"file":"reloadSession.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/reloadSession.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiDG;AACH,wBAAsB,aAAa,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,EAAE,eAAe,CAAC,EAAE,WAAW,CAAC,YAAY,GAAG,OAAO,CAAC,MAAM,CAAC,CAqC3H"}
@@ -1 +1 @@
1
- {"version":3,"file":"restore.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/restore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAGrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,OAAO,CACzB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,MAAM,CAAC,EAAE,eAAe,GAAG,eAAe,EAAE,iBAc/C"}
1
+ {"version":3,"file":"restore.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/restore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAGrD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,OAAO,CACzB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,MAAM,CAAC,EAAE,eAAe,GAAG,eAAe,EAAE,GAC7C,OAAO,CAAC,IAAI,CAAC,CAaf"}
@@ -1 +1 @@
1
- {"version":3,"file":"savePDF.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/savePDF.ts"],"names":[],"mappings":"AAEA,KAAK,eAAe,GAAG;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CACxB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAsB,OAAO,CACzB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,eAAe,gCAM5B"}
1
+ {"version":3,"file":"savePDF.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/savePDF.ts"],"names":[],"mappings":"AAEA,KAAK,eAAe,GAAG;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;CACxB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAsB,OAAO,CACzB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,eAAe,GAC1B,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAK9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"saveRecordingScreen.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/saveRecordingScreen.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,mBAAmB,CACrC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,QAAQ,EAAE,MAAM,gCAMnB"}
1
+ {"version":3,"file":"saveRecordingScreen.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/saveRecordingScreen.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,mBAAmB,CACrC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,QAAQ,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAK9B"}
@@ -1 +1 @@
1
- {"version":3,"file":"saveScreenshot.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/saveScreenshot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAsB,cAAc,CAChC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,qBAAqB,gCAMlC"}
1
+ {"version":3,"file":"saveScreenshot.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/saveScreenshot.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAE3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,wBAAsB,cAAc,CAChC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,qBAAqB,GAChC,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAK9B"}
@@ -21,5 +21,5 @@
21
21
  * @type utility
22
22
  *
23
23
  */
24
- export declare function scroll(this: WebdriverIO.Browser, x?: number, y?: number): void | Promise<void>;
24
+ export declare function scroll(this: WebdriverIO.Browser, x?: number, y?: number): Promise<void>;
25
25
  //# sourceMappingURL=scroll.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/scroll.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,MAAM,CAClB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,CAAC,SAAI,EACL,CAAC,SAAI,wBAkBR"}
1
+ {"version":3,"file":"scroll.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/scroll.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,MAAM,CAClB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,CAAC,SAAI,EACL,CAAC,SAAI,GACN,OAAO,CAAC,IAAI,CAAC,CAkBf"}
@@ -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,wBAAsB,UAAU,CAC5B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,iBAqChC"}
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,wBAAsB,UAAU,CAC5B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,GAC9B,OAAO,CAAC,IAAI,CAAC,CAoCf"}
@@ -1 +1 @@
1
- {"version":3,"file":"setViewport.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/setViewport.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,kBAAkB;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,WAAW,CAC7B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,OAAO,EAAE,kBAAkB,iBA+B9B"}
1
+ {"version":3,"file":"setViewport.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/setViewport.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,kBAAkB;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,WAAW,CAC7B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,OAAO,EAAE,kBAAkB,GAC5B,OAAO,CAAC,IAAI,CAAC,CA8Bf"}
@@ -1 +1 @@
1
- {"version":3,"file":"setWindowSize.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/setWindowSize.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,aAAa,CAC/B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,iBAmBjB"}
1
+ {"version":3,"file":"setWindowSize.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/setWindowSize.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,aAAa,CAC/B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAkBf"}
@@ -1 +1 @@
1
- {"version":3,"file":"switchFrame.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/switchFrame.ts"],"names":[],"mappings":"AAIA,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAIlF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AAI7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,wBAAsB,WAAW,CAC7B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,OAAO,EAAE,WAAW,CAAC,OAAO,GAAG,uBAAuB,GAAG,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,eAAe,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,0BAmPnI"}
1
+ {"version":3,"file":"switchFrame.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/switchFrame.ts"],"names":[],"mappings":"AAIA,OAAO,EAAqB,KAAK,eAAe,EAAE,MAAM,0BAA0B,CAAA;AAIlF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAA;AAI7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsDG;AACH,wBAAsB,WAAW,CAC7B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,OAAO,EAAE,WAAW,CAAC,OAAO,GAAG,uBAAuB,GAAG,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,eAAe,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,GACjI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAkPxB"}
@@ -1 +1 @@
1
- {"version":3,"file":"switchWindow.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/switchWindow.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAsB,YAAY,CAC9B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,OAAO,EAAE,MAAM,GAAG,MAAM,mBAwE3B"}
1
+ {"version":3,"file":"switchWindow.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/switchWindow.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAsB,YAAY,CAC9B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,OAAO,EAAE,MAAM,GAAG,MAAM,GACzB,OAAO,CAAC,MAAM,CAAC,CAuEjB"}
@@ -1 +1 @@
1
- {"version":3,"file":"throttle.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/throttle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAMrD;;GAEG;AACH,wBAAsB,QAAQ,CAC1B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,MAAM,EAAE,eAAe,iBAK1B"}
1
+ {"version":3,"file":"throttle.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/throttle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAMrD;;GAEG;AACH,wBAAsB,QAAQ,CAC1B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,MAAM,EAAE,eAAe,GACxB,OAAO,CAAC,IAAI,CAAC,CAIf"}
@@ -1 +1 @@
1
- {"version":3,"file":"throttleCPU.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/throttleCPU.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,wBAAsB,WAAW,CAC7B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,MAAM,EAAE,MAAM,iBAwBjB"}
1
+ {"version":3,"file":"throttleCPU.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/throttleCPU.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,wBAAsB,WAAW,CAC7B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,MAAM,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAuBf"}
@@ -1,3 +1,3 @@
1
1
  import type { ThrottleOptions } from '../../types.js';
2
- export declare function throttleNetwork(this: WebdriverIO.Browser, params: ThrottleOptions): Promise<null>;
2
+ export declare function throttleNetwork(this: WebdriverIO.Browser, params: ThrottleOptions): Promise<void>;
3
3
  //# sourceMappingURL=throttleNetwork.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"throttleNetwork.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/throttleNetwork.ts"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAmErD,wBAAsB,eAAe,CACjC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,MAAM,EAAE,eAAe,iBAiD1B"}
1
+ {"version":3,"file":"throttleNetwork.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/throttleNetwork.ts"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAmErD,wBAAsB,eAAe,CACjC,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,MAAM,EAAE,eAAe,GACxB,OAAO,CAAC,IAAI,CAAC,CAgDf"}
@@ -1 +1 @@
1
- {"version":3,"file":"touchAction.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/touchAction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AACH,wBAAgB,WAAW,CACvB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,OAAO,EAAE,YAAY,iBAGxB"}
1
+ {"version":3,"file":"touchAction.d.ts","sourceRoot":"","sources":["../../../src/commands/browser/touchAction.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AACH,wBAAgB,WAAW,CACvB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,OAAO,EAAE,YAAY,GACtB,OAAO,CAAC,IAAI,CAAC,CAEf"}
@@ -1,3 +1,4 @@
1
+ import type { InputOptions } from '../../types.js';
1
2
  /**
2
3
  *
3
4
  * Add a value to an input or textarea element found by given selector.
@@ -23,7 +24,8 @@
23
24
  *
24
25
  * @alias element.addValue
25
26
  * @param {string|number} value value to be added
27
+ * @param {InputOptions} additional options, exclusive to Webdriverio
26
28
  *
27
29
  */
28
- export declare function addValue(this: WebdriverIO.Element, value: string | number): Promise<void>;
30
+ export declare function addValue(this: WebdriverIO.Element, value: string | number, options?: InputOptions): Promise<void>;
29
31
  //# sourceMappingURL=addValue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"addValue.d.ts","sourceRoot":"","sources":["../../../src/commands/element/addValue.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,QAAQ,CACpB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,KAAK,EAAE,MAAM,GAAG,MAAM,iBAezB"}
1
+ {"version":3,"file":"addValue.d.ts","sourceRoot":"","sources":["../../../src/commands/element/addValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAKlD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAgB,QAAQ,CACpB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,KAAK,EAAE,MAAM,GAAG,MAAM,EACtB,OAAO,CAAC,EAAE,YAAY,iBAoBzB"}
@@ -1,3 +1,4 @@
1
+ import type { TransformElement, TransformReturn } from '../../types.js';
1
2
  /**
2
3
  *
3
4
  * Inject a snippet of JavaScript into the page for execution in the context of the currently selected
@@ -34,5 +35,5 @@
34
35
  * @type protocol
35
36
  *
36
37
  */
37
- export declare function execute<ReturnValue, InnerArguments extends unknown[]>(this: WebdriverIO.Element, script: string | ((...innerArgs: [WebdriverIO.Element, ...InnerArguments]) => ReturnValue), ...args: InnerArguments): Promise<ReturnValue>;
38
+ export declare function execute<ReturnValue, InnerArguments extends unknown[]>(this: WebdriverIO.Element, script: string | ((...innerArgs: TransformElement<[WebdriverIO.Element, ...InnerArguments]>) => ReturnValue), ...args: InnerArguments): Promise<TransformReturn<ReturnValue>>;
38
39
  //# sourceMappingURL=execute.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/commands/element/execute.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAsB,OAAO,CAAC,WAAW,EAAE,cAAc,SAAS,OAAO,EAAE,EACvE,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,SAAS,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,cAAc,CAAC,KAAK,WAAW,CAAC,EAC1F,GAAG,IAAI,EAAE,cAAc,GACxB,OAAO,CAAC,WAAW,CAAC,CAItB"}
1
+ {"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../../src/commands/element/execute.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAEvE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAsB,OAAO,CAAC,WAAW,EAAE,cAAc,SAAS,OAAO,EAAE,EACvE,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,GAAG,SAAS,EAAE,gBAAgB,CAAC,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,cAAc,CAAC,CAAC,KAAK,WAAW,CAAC,EAC5G,GAAG,IAAI,EAAE,cAAc,GACxB,OAAO,CAAC,eAAe,CAAC,WAAW,CAAC,CAAC,CAKvC"}
@@ -1,3 +1,4 @@
1
+ import type { TransformElement } from '../../types.js';
1
2
  /**
2
3
  * :::warning
3
4
  * The `executeAsync` command is deprecated and will be removed in a future version.
@@ -34,7 +35,23 @@
34
35
  done(elem.textContent + a + b + c + d)
35
36
  }, 3000);
36
37
  }, 1, 2, 3, 4);
38
+
37
39
  // node.js context - client and console are available
40
+ console.log(text); // outputs "Hello World1234"
41
+ });
42
+
43
+ :executeAsync.ts
44
+ it('should wait for the element to exist, then executes async javascript on the page with the element as first argument', async () => {
45
+ await browser.setTimeout({ script: 5000 })
46
+
47
+ // explicitly type the return value of the script to ensure type safety
48
+ const text: number = await $('div').execute((elem, a, b, c, d) => {
49
+ // browser context - you may not access client or console
50
+ setTimeout(() => {
51
+ done(elem.textContent + a + b + c + d)
52
+ }, 3000);
53
+ }, 1, 2, 3, 4);
54
+
38
55
  // node.js context - client and console are available
39
56
  console.log(text); // outputs "Hello World1234"
40
57
  });
@@ -49,5 +66,11 @@
49
66
  * @type protocol
50
67
  * @deprecated Please use `execute` instead
51
68
  */
52
- export declare function executeAsync<ReturnValue, InnerArguments extends unknown[]>(this: WebdriverIO.Browser | WebdriverIO.Element, script: string | ((...args: [...innerArgs: [WebdriverIO.Element, ...InnerArguments], callback: (result?: ReturnValue) => void]) => void), ...args: InnerArguments): Promise<ReturnValue>;
69
+ export declare function executeAsync<ReturnValue, InnerArguments extends unknown[]>(this: WebdriverIO.Browser | WebdriverIO.Element, script: string | ((...args: [
70
+ element: HTMLElement,
71
+ ...innerArgs: {
72
+ [K in keyof InnerArguments]: TransformElement<InnerArguments[K]>;
73
+ },
74
+ callback: (result?: TransformElement<ReturnValue>) => void
75
+ ]) => void), ...args: InnerArguments): Promise<ReturnValue>;
53
76
  //# sourceMappingURL=executeAsync.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"executeAsync.d.ts","sourceRoot":"","sources":["../../../src/commands/element/executeAsync.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH,wBAAsB,YAAY,CAAC,WAAW,EAAE,cAAc,SAAS,OAAO,EAAE,EAC5E,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,OAAO,EAC/C,MAAM,EACF,MAAM,GACN,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,cAAc,CAAC,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,IAAI,CAAC,KAAK,IAAI,CAAC,EAC3H,GAAG,IAAI,EAAE,cAAc,GACxB,OAAO,CAAC,WAAW,CAAC,CAGtB"}
1
+ {"version":3,"file":"executeAsync.d.ts","sourceRoot":"","sources":["../../../src/commands/element/executeAsync.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkEG;AACH,wBAAsB,YAAY,CAAC,WAAW,EAAE,cAAc,SAAS,OAAO,EAAE,EAC5E,IAAI,EAAE,WAAW,CAAC,OAAO,GAAG,WAAW,CAAC,OAAO,EAC/C,MAAM,EACF,MAAM,GACN,CACI,CACI,GAAG,IAAI,EAAE;IACL,OAAO,EAAE,WAAW;IACpB,GAAG,SAAS,EAAE;SAAG,CAAC,IAAI,MAAM,cAAc,GAAG,gBAAgB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC;KAAE;IAClF,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,gBAAgB,CAAC,WAAW,CAAC,KAAK,IAAI;CAC7D,KACA,IAAI,CACZ,EACL,GAAG,IAAI,EAAE,cAAc,GACxB,OAAO,CAAC,WAAW,CAAC,CAItB"}
@@ -1 +1 @@
1
- {"version":3,"file":"getHTML.d.ts","sourceRoot":"","sources":["../../../src/commands/element/getHTML.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,wBAAsB,OAAO,CACzB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,OAAO,GAAE,cAAmB,gBAsF/B;AAmED,MAAM,WAAW,cAAc;IAC3B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAC7B"}
1
+ {"version":3,"file":"getHTML.d.ts","sourceRoot":"","sources":["../../../src/commands/element/getHTML.ts"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4DG;AACH,wBAAsB,OAAO,CACzB,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,OAAO,GAAE,cAAmB,gBAqF/B;AAmED,MAAM,WAAW,cAAc;IAC3B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;IAC5B;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAC7B"}
@@ -1,8 +1,26 @@
1
1
  /**
2
2
  *
3
- * Will return true when stable (in animation) or when unstable (not in animation).
3
+ * Will return true when the element is stable (not animating) or false when unstable (currently animating).
4
+ * We generally recommend disabling animations in your test environment instead of using this command,
5
+ * but this method is provided for cases where that's not feasible.
4
6
  *
5
- * __Note:__ it's best to disable animations instead of using this command.
7
+ * __Background/Inactive Tab Issue:__ This command will fail with an error if the browser tab is inactive
8
+ * (minimized, in background, or hidden) because animations don't run in inactive tabs due to browser
9
+ * performance optimizations. To work around this issue, you can add Chrome options to prevent background
10
+ * throttling:
11
+ *
12
+ * ```js
13
+ * // In your wdio.conf.js
14
+ * capabilities: [{
15
+ * browserName: 'chrome',
16
+ * 'goog:chromeOptions': {
17
+ * args: [
18
+ * '--disable-backgrounding-occluded-windows',
19
+ * '--disable-renderer-backgrounding'
20
+ * ]
21
+ * }
22
+ * }]
23
+ * ```
6
24
  *
7
25
  * <example>
8
26
  :index.html
@@ -1 +1 @@
1
- {"version":3,"file":"isStable.d.ts","sourceRoot":"","sources":["../../../src/commands/element/isStable.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,wBAAsB,QAAQ,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,oBAMxD"}
1
+ {"version":3,"file":"isStable.d.ts","sourceRoot":"","sources":["../../../src/commands/element/isStable.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqEG;AACH,wBAAsB,QAAQ,CAAE,IAAI,EAAE,WAAW,CAAC,OAAO,oBAMxD"}
@@ -1,3 +1,4 @@
1
+ import type { InputOptions } from '../../types.js';
1
2
  /**
2
3
  * Send a sequence of key strokes to an element after the input has been cleared before. If the element doesn't need
3
4
  * to be cleared first then use [`addValue`](/docs/api/element/addValue).
@@ -22,7 +23,8 @@
22
23
  *
23
24
  * @alias element.setValue
24
25
  * @param {string|number} value value to be added
26
+ * @param {InputOptions} additional options, exclusive to Webdriverio
25
27
  *
26
28
  */
27
- export declare function setValue(this: WebdriverIO.Element, value: string | number): Promise<void>;
29
+ export declare function setValue(this: WebdriverIO.Element, value: string | number, options?: InputOptions): Promise<void>;
28
30
  //# sourceMappingURL=setValue.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"setValue.d.ts","sourceRoot":"","sources":["../../../src/commands/element/setValue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAsB,QAAQ,CAC1B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,KAAK,EAAE,MAAM,GAAG,MAAM,iBAIzB"}
1
+ {"version":3,"file":"setValue.d.ts","sourceRoot":"","sources":["../../../src/commands/element/setValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,QAAQ,CAC1B,IAAI,EAAE,WAAW,CAAC,OAAO,EACzB,KAAK,EAAE,MAAM,GAAG,MAAM,EACtB,OAAO,CAAC,EAAE,YAAY,iBAIzB"}
@@ -26,5 +26,5 @@
26
26
  * @type utility
27
27
  *
28
28
  */
29
- export declare function shadow$$(this: WebdriverIO.Element, selector: string): Promise<WebdriverIO.ElementArray | import("../../types.js").ChainablePromiseArray>;
29
+ export declare function shadow$$(this: WebdriverIO.Element, selector: string): Promise<import("../../types.js").ChainablePromiseArray | WebdriverIO.ElementArray>;
30
30
  //# sourceMappingURL=shadow$$.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAW,YAAY,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,KAAK,KAAK,cAAc,MAAM,WAAW,CAAA;AAGhD,OAAO,wBAAwB,MAAM,+BAA+B,CAAA;AAOpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAG/C,cAAc,YAAY,CAAA;AAC1B,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAc,CAAA;AAC9B,eAAO,MAAM,kBAAkB,iCAA2B,CAAA;AAE1D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,MAAM,WACP,YAAY,CAAC,iBAAiB,mBACrB,CAAC,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,CAAC,iBAAiB,KAAK,cAAc,CAAC,MAAM,KACnH,OAAO,CAAC,WAAW,CAAC,OAAO,CA4C7B,CAAA;AAED,eAAO,MAAM,MAAM,kBAAkC,aAAa,KAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CA8B/F,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,WAAW,WACZ,YAAY,CAAC,gCAAgC,2BAC7B;IAAE,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAAE,KACxD,OAAO,CAAC,WAAW,CAAC,kBAAkB,CAoExC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAW,YAAY,EAAE,MAAM,aAAa,CAAA;AACxD,OAAO,KAAK,KAAK,cAAc,MAAM,WAAW,CAAA;AAGhD,OAAO,wBAAwB,MAAM,+BAA+B,CAAA;AAOpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAA;AAG/C,cAAc,YAAY,CAAA;AAC1B,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAc,CAAA;AAC9B,eAAO,MAAM,kBAAkB,iCAA2B,CAAA;AAE1D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,MAAM,WACP,YAAY,CAAC,iBAAiB,mBACrB,CAAC,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,YAAY,CAAC,iBAAiB,KAAK,cAAc,CAAC,MAAM,KACnH,OAAO,CAAC,WAAW,CAAC,OAAO,CAsC7B,CAAA;AAED,eAAO,MAAM,MAAM,kBAAkC,aAAa,KAAG,OAAO,CAAC,WAAW,CAAC,OAAO,CA8B/F,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,WAAW,WACZ,YAAY,CAAC,gCAAgC,2BAC7B;IAAE,kBAAkB,CAAC,EAAE,MAAM,CAAA;CAAE,KACxD,OAAO,CAAC,WAAW,CAAC,kBAAkB,CAoExC,CAAA"}