appium-xcuitest-driver 10.14.2 → 10.14.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/build/lib/commands/alert.d.ts +26 -31
  3. package/build/lib/commands/alert.d.ts.map +1 -1
  4. package/build/lib/commands/alert.js +20 -29
  5. package/build/lib/commands/alert.js.map +1 -1
  6. package/build/lib/commands/appearance.d.ts +7 -9
  7. package/build/lib/commands/appearance.d.ts.map +1 -1
  8. package/build/lib/commands/appearance.js +13 -19
  9. package/build/lib/commands/appearance.js.map +1 -1
  10. package/build/lib/commands/biometric.d.ts +12 -14
  11. package/build/lib/commands/biometric.d.ts.map +1 -1
  12. package/build/lib/commands/biometric.js +10 -19
  13. package/build/lib/commands/biometric.js.map +1 -1
  14. package/build/lib/commands/content-size.d.ts +16 -19
  15. package/build/lib/commands/content-size.d.ts.map +1 -1
  16. package/build/lib/commands/content-size.js +14 -22
  17. package/build/lib/commands/content-size.js.map +1 -1
  18. package/build/lib/commands/geolocation.d.ts +16 -36
  19. package/build/lib/commands/geolocation.d.ts.map +1 -1
  20. package/build/lib/commands/geolocation.js +8 -25
  21. package/build/lib/commands/geolocation.js.map +1 -1
  22. package/build/lib/commands/iohid.d.ts +6 -1359
  23. package/build/lib/commands/iohid.d.ts.map +1 -1
  24. package/build/lib/commands/iohid.js +5 -10
  25. package/build/lib/commands/iohid.js.map +1 -1
  26. package/build/lib/commands/keyboard.d.ts +16 -13
  27. package/build/lib/commands/keyboard.d.ts.map +1 -1
  28. package/build/lib/commands/keyboard.js +14 -18
  29. package/build/lib/commands/keyboard.js.map +1 -1
  30. package/build/lib/commands/notifications.d.ts +10 -10
  31. package/build/lib/commands/notifications.d.ts.map +1 -1
  32. package/build/lib/commands/notifications.js +8 -12
  33. package/build/lib/commands/notifications.js.map +1 -1
  34. package/build/lib/commands/permissions.d.ts +15 -17
  35. package/build/lib/commands/permissions.d.ts.map +1 -1
  36. package/build/lib/commands/permissions.js +12 -18
  37. package/build/lib/commands/permissions.js.map +1 -1
  38. package/build/lib/commands/proxy-helper.d.ts +11 -11
  39. package/build/lib/commands/proxy-helper.d.ts.map +1 -1
  40. package/build/lib/commands/proxy-helper.js +15 -24
  41. package/build/lib/commands/proxy-helper.js.map +1 -1
  42. package/build/lib/commands/simctl.d.ts +16 -22
  43. package/build/lib/commands/simctl.d.ts.map +1 -1
  44. package/build/lib/commands/simctl.js +8 -17
  45. package/build/lib/commands/simctl.js.map +1 -1
  46. package/build/lib/commands/timeouts.d.ts +25 -32
  47. package/build/lib/commands/timeouts.d.ts.map +1 -1
  48. package/build/lib/commands/timeouts.js +18 -14
  49. package/build/lib/commands/timeouts.js.map +1 -1
  50. package/lib/commands/alert.ts +98 -0
  51. package/lib/commands/appearance.ts +70 -0
  52. package/lib/commands/biometric.ts +52 -0
  53. package/lib/commands/content-size.ts +67 -0
  54. package/lib/commands/geolocation.ts +55 -0
  55. package/lib/commands/{iohid.js → iohid.ts} +15 -13
  56. package/lib/commands/keyboard.ts +70 -0
  57. package/lib/commands/{notifications.js → notifications.ts} +22 -14
  58. package/lib/commands/permissions.ts +90 -0
  59. package/lib/commands/{proxy-helper.js → proxy-helper.ts} +26 -26
  60. package/lib/commands/{simctl.js → simctl.ts} +27 -21
  61. package/lib/commands/timeouts.ts +95 -0
  62. package/npm-shrinkwrap.json +5 -5
  63. package/package.json +1 -1
  64. package/lib/commands/alert.js +0 -88
  65. package/lib/commands/appearance.js +0 -71
  66. package/lib/commands/biometric.js +0 -52
  67. package/lib/commands/content-size.js +0 -68
  68. package/lib/commands/geolocation.js +0 -56
  69. package/lib/commands/keyboard.js +0 -62
  70. package/lib/commands/permissions.js +0 -85
  71. package/lib/commands/timeouts.js +0 -68
@@ -1 +1 @@
1
- {"version":3,"file":"iohid.d.ts","sourceRoot":"","sources":["../../../lib/commands/iohid.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAEZ,MAAM,GAAC,MAAM,oBAiBvB;6BAhCyC,aAAa"}
1
+ {"version":3,"file":"iohid.d.ts","sourceRoot":"","sources":["../../../lib/commands/iohid.ts"],"names":[],"mappings":"AACA,OAAO,EAAgB,YAAY,EAAC,MAAM,aAAa,CAAC;AACxD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAE9C;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,YAAY,EAClB,KAAK,EAAE,MAAM,EACb,eAAe,EAAE,MAAM,GAAG,MAAM,GAC/B,OAAO,CAAC,IAAI,CAAC,CAcf"}
@@ -14,10 +14,9 @@ const hid_event_1 = require("./hid-event");
14
14
  * - `kHIDUsage_Csmr_Power` = `0x30` (Power)
15
15
  * - `kHIDUsage_Csmr_Snapshot` = `0x65` (Power + Home)
16
16
  *
17
- * @param {HIDPageEvent} page - The event page identifier
18
- * @param {HIDUsageEvent} usage - The event usage identifier (usages are defined per-page)
19
- * @param {number|string} durationSeconds - The event duration in float seconds (XCTest uses `0.005` for a single press event)
20
- * @this {import('../driver').XCUITestDriver}
17
+ * @param page - The event page identifier
18
+ * @param usage - The event usage identifier (usages are defined per-page)
19
+ * @param durationSeconds - The event duration in float seconds (XCTest uses `0.005` for a single press event)
21
20
  */
22
21
  async function mobilePerformIoHidEvent(page, usage, durationSeconds) {
23
22
  if (!isHIDPageEvent(page)) {
@@ -30,12 +29,10 @@ async function mobilePerformIoHidEvent(page, usage, durationSeconds) {
30
29
  if (Number.isNaN(duration)) {
31
30
  throw new driver_1.errors.InvalidArgumentError(`'durationSeconds' argument must be a valid number`);
32
31
  }
33
- return await this.proxyCommand('/wda/performIoHidEvent', 'POST', { page, usage, duration });
32
+ await this.proxyCommand('/wda/performIoHidEvent', 'POST', { page, usage, duration });
34
33
  }
35
34
  /**
36
35
  * Type guard for {@linkcode HIDUsageEvent}
37
- * @param {any} value
38
- * @returns {value is HIDUsageEvent}
39
36
  */
40
37
  function isHIDUsageEvent(value) {
41
38
  if (typeof value === 'string') {
@@ -48,9 +45,7 @@ function isHIDUsageEvent(value) {
48
45
  }
49
46
  /**
50
47
  * Type guard for {@linkcode HIDPageEvent}
51
- * @param {any} value
52
- * @returns {value is HIDPageEvent}
53
- **/
48
+ */
54
49
  function isHIDPageEvent(value) {
55
50
  if (typeof value === 'string') {
56
51
  value = parseInt(value, 10);
@@ -1 +1 @@
1
- {"version":3,"file":"iohid.js","sourceRoot":"","sources":["../../../lib/commands/iohid.js"],"names":[],"mappings":";;AAmBA,0DAcC;AAjCD,0CAAqC;AACrC,2CAAwD;AAExD;;;;;;;;;;;;;;;GAeG;AACI,KAAK,UAAU,uBAAuB,CAAC,IAAI,EAAE,KAAK,EAAE,eAAe;IACxE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1B,MAAM,IAAI,eAAM,CAAC,oBAAoB,CACnC,yDAAyD,CAC1D,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,MAAM,IAAI,eAAM,CAAC,oBAAoB,CAAC,kDAAkD,CAAC,CAAC;IAC5F,CAAC;IACD,MAAM,QAAQ,GAAG,UAAU,CAAC,MAAM,CAAC,eAAe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AY,CAAC;AAC/B,CAAC"}
@@ -1,32 +1,35 @@
1
+ import type { XCUITestDriver } from '../driver';
2
+ import type { KeyboardKey } from './types';
1
3
  /**
2
- * @this {XCUITestDriver}
4
+ * Hides the keyboard.
5
+ *
3
6
  * @deprecated
4
7
  */
5
- export function hideKeyboard(this: import("../driver").XCUITestDriver, strategy: any, ...possibleKeys: any[]): Promise<boolean>;
8
+ export declare function hideKeyboard(this: XCUITestDriver, strategy?: string, ...possibleKeys: string[]): Promise<boolean>;
6
9
  /**
7
- * @this {XCUITestDriver}
8
- * @param {string[]} keys
10
+ * Hides the keyboard using the specified key names.
11
+ *
12
+ * @param keys - Array of key names to use for dismissing the keyboard
9
13
  */
10
- export function mobileHideKeyboard(this: import("../driver").XCUITestDriver, keys?: string[]): Promise<void>;
14
+ export declare function mobileHideKeyboard(this: XCUITestDriver, keys?: string[]): Promise<void>;
11
15
  /**
12
- * @this {XCUITestDriver}
16
+ * Checks whether the keyboard is currently shown.
17
+ *
18
+ * @returns `true` if the keyboard is shown, `false` otherwise
13
19
  */
14
- export function isKeyboardShown(this: import("../driver").XCUITestDriver): Promise<boolean>;
20
+ export declare function isKeyboardShown(this: XCUITestDriver): Promise<boolean>;
15
21
  /**
16
22
  * Send keys to the given element or to the application under test.
17
23
  * This API is not supported on tvOS
18
24
  *
19
25
  * @since Xcode 15/iOS 17
20
- * @this {import('../driver').XCUITestDriver}
21
- * @param {(Key|string)[]} keys Array of keys to type.
26
+ * @param keys - Array of keys to type.
22
27
  * Each item could either be a string, that represents a key itself (see
23
28
  * https://developer.apple.com/documentation/xctest/xcuielement/1500604-typekey?language=objc
24
29
  * and https://developer.apple.com/documentation/xctest/xcuikeyboardkey?language=objc)
25
30
  * or a dictionary, if the key should also be entered with modifiers.
26
- * @param {string?} [elementId=null] uuid of the element to send keys to.
31
+ * @param elementId - UUID of the element to send keys to.
27
32
  * If the element is not provided then the keys will be sent to the current application.
28
33
  */
29
- export function mobileKeys(this: import("../driver").XCUITestDriver, keys: (Key | string)[], elementId?: string | null): Promise<unknown>;
30
- export type XCUITestDriver = import("../driver").XCUITestDriver;
31
- export type Key = import("./types").KeyboardKey;
34
+ export declare function mobileKeys(this: XCUITestDriver, keys: (KeyboardKey | string)[], elementId?: string | null): Promise<void>;
32
35
  //# sourceMappingURL=keyboard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../../lib/commands/keyboard.js"],"names":[],"mappings":"AAEA;;;GAGG;AACH,gIAKC;AAED;;;GAGG;AACH,oFAFW,MAAM,EAAE,iBAOlB;AAED;;GAEG;AACH,4FAOC;AAED;;;;;;;;;;;;;GAaG;AACH,2EARW,CAAC,GAAG,GAAC,MAAM,CAAC,EAAE,cAKd,MAAM,OAAC,oBAMjB;6BAGY,OAAO,WAAW,EAAE,cAAc;kBAIlC,OAAO,SAAS,EAAE,WAAW"}
1
+ {"version":3,"file":"keyboard.d.ts","sourceRoot":"","sources":["../../../lib/commands/keyboard.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,SAAS,CAAC;AAEzC;;;;GAIG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,cAAc,EACpB,QAAQ,CAAC,EAAE,MAAM,EACjB,GAAG,YAAY,EAAE,MAAM,EAAE,GACxB,OAAO,CAAC,OAAO,CAAC,CAKlB;AAED;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,cAAc,EACpB,IAAI,GAAE,MAAM,EAAO,GAClB,OAAO,CAAC,IAAI,CAAC,CAIf;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAO5E;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,CAAC,WAAW,GAAG,MAAM,CAAC,EAAE,EAC9B,SAAS,GAAE,MAAM,GAAG,IAAW,GAC9B,OAAO,CAAC,IAAI,CAAC,CAGf"}
@@ -9,7 +9,8 @@ exports.isKeyboardShown = isKeyboardShown;
9
9
  exports.mobileKeys = mobileKeys;
10
10
  const lodash_1 = __importDefault(require("lodash"));
11
11
  /**
12
- * @this {XCUITestDriver}
12
+ * Hides the keyboard.
13
+ *
13
14
  * @deprecated
14
15
  */
15
16
  async function hideKeyboard(strategy, ...possibleKeys) {
@@ -19,17 +20,19 @@ async function hideKeyboard(strategy, ...possibleKeys) {
19
20
  return true;
20
21
  }
21
22
  /**
22
- * @this {XCUITestDriver}
23
- * @param {string[]} keys
23
+ * Hides the keyboard using the specified key names.
24
+ *
25
+ * @param keys - Array of key names to use for dismissing the keyboard
24
26
  */
25
27
  async function mobileHideKeyboard(keys = []) {
26
- if (!keys.includes('done')) {
27
- keys.push('done');
28
- }
29
- await this.proxyCommand('/wda/keyboard/dismiss', 'POST', { keyNames: keys });
28
+ await this.proxyCommand('/wda/keyboard/dismiss', 'POST', {
29
+ keyNames: keys.includes('done') ? keys : [...keys, 'done'],
30
+ });
30
31
  }
31
32
  /**
32
- * @this {XCUITestDriver}
33
+ * Checks whether the keyboard is currently shown.
34
+ *
35
+ * @returns `true` if the keyboard is shown, `false` otherwise
33
36
  */
34
37
  async function isKeyboardShown() {
35
38
  try {
@@ -45,23 +48,16 @@ async function isKeyboardShown() {
45
48
  * This API is not supported on tvOS
46
49
  *
47
50
  * @since Xcode 15/iOS 17
48
- * @this {import('../driver').XCUITestDriver}
49
- * @param {(Key|string)[]} keys Array of keys to type.
51
+ * @param keys - Array of keys to type.
50
52
  * Each item could either be a string, that represents a key itself (see
51
53
  * https://developer.apple.com/documentation/xctest/xcuielement/1500604-typekey?language=objc
52
54
  * and https://developer.apple.com/documentation/xctest/xcuikeyboardkey?language=objc)
53
55
  * or a dictionary, if the key should also be entered with modifiers.
54
- * @param {string?} [elementId=null] uuid of the element to send keys to.
56
+ * @param elementId - UUID of the element to send keys to.
55
57
  * If the element is not provided then the keys will be sent to the current application.
56
58
  */
57
59
  async function mobileKeys(keys, elementId = null) {
58
60
  const url = `/wda/element/${elementId || 0}/keyboardInput`;
59
- return await this.proxyCommand(url, 'POST', { keys });
61
+ await this.proxyCommand(url, 'POST', { keys });
60
62
  }
61
- /**
62
- * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
63
- */
64
- /**
65
- * @typedef {import('./types').KeyboardKey} Key
66
- */
67
63
  //# sourceMappingURL=keyboard.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"keyboard.js","sourceRoot":"","sources":["../../../lib/commands/keyboard.js"],"names":[],"mappings":";;;;;AAMA,oCAKC;AAMD,gDAKC;AAKD,0CAOC;AAgBD,gCAGC;AArDD,oDAAuB;AAEvB;;;GAGG;AACI,KAAK,UAAU,YAAY,CAAC,QAAQ,EAAE,GAAG,YAAY;IAC1D,mCAAmC;IACnC,MAAM,QAAQ,GAAG,gBAAC,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACzE,MAAM,IAAI,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACxC,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,kBAAkB,CAAC,IAAI,GAAG,EAAE;IAChD,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QAC3B,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACpB,CAAC;IACD,MAAM,IAAI,CAAC,YAAY,CAAC,uBAAuB,EAAE,MAAM,EAAE,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC;AAC7E,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,eAAe;IACnC,IAAI,CA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AAM,CAAC;KAC3D,CAAC,CAAC;AACL,CAAC;AAED;;;;GAIG;AACI,KAAK,UAAU,eAAe;IACnC,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,2BAA2B,CAAC,YAAY,EAAE,yBAAyB,EAAE,KAAK,CAAC,CAAC;QACvF,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;;;;;;;;;;GAYG;AACI,KAAK,UAAU,UAAU,CAE9B,IAA8B,EAC9B,YAA2B,IAAI;IAE/B,MAAM,GAAG,GAAG,gBAAgB,SAAS,IAAI,CAAC,gBAAgB,CAAC;IAC3D,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC;AACjD,CAAC"}
@@ -1,15 +1,17 @@
1
+ import type { XCUITestDriver } from '../driver';
2
+ import type { PushPayload, NotificationType } from './types';
1
3
  /**
2
4
  * Simulates push notification delivery to a simulated device.
3
5
  *
4
6
  * **Only "remote" push notifications are supported.** VoIP, Complication, File Provider, and other types are unsupported.
5
7
  *
6
8
  * Supported in Xcode SDK 11.4+.
7
- * @param {string} bundleId - The bundle identifier of the target application
8
- * @param {import('./types').PushPayload} payload - Valid push payload.
9
+ *
10
+ * @param bundleId - The bundle identifier of the target application
11
+ * @param payload - Valid push payload.
9
12
  * @group Simulator Only
10
- * @this {XCUITestDriver}
11
13
  */
12
- export function mobilePushNotification(this: import("../driver").XCUITestDriver, bundleId: string, payload: import("./types").PushPayload): Promise<void>;
14
+ export declare function mobilePushNotification(this: XCUITestDriver, bundleId: string, payload: PushPayload): Promise<void>;
13
15
  /**
14
16
  * Blocks until the expected notification is delivered.
15
17
  *
@@ -17,12 +19,10 @@ export function mobilePushNotification(this: import("../driver").XCUITestDriver,
17
19
  * [`XCTNSNotificationExpectation`](https://developer.apple.com/documentation/xctest/xctnsnotificationexpectation?language=objc) and
18
20
  * [`XCTDarwinNotificationExpectation`](https://developer.apple.com/documentation/xctest/xctdarwinnotificationexpectation?language=objc) entities.
19
21
  *
20
- * @param {string} name - The name of the notification to expect
21
- * @param {import('./types').NotificationType} type - Which notification type to expect.
22
- * @param {number} timeoutSeconds - For how long to wait until the notification is delivered (in float seconds).
22
+ * @param name - The name of the notification to expect
23
+ * @param type - Which notification type to expect.
24
+ * @param timeoutSeconds - For how long to wait until the notification is delivered (in float seconds).
23
25
  * @throws A [`TimeoutError`](https://www.selenium.dev/selenium/docs/api/javascript/module/selenium-webdriver/lib/error_exports_TimeoutError.html) if the expected notification has not been delivered within the given timeout.
24
- * @this {XCUITestDriver}
25
26
  */
26
- export function mobileExpectNotification(this: import("../driver").XCUITestDriver, name: string, type?: import("./types").NotificationType, timeoutSeconds?: number): Promise<unknown>;
27
- export type XCUITestDriver = import("../driver").XCUITestDriver;
27
+ export declare function mobileExpectNotification(this: XCUITestDriver, name: string, type?: NotificationType, timeoutSeconds?: number): Promise<void>;
28
28
  //# sourceMappingURL=notifications.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../lib/commands/notifications.js"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,2FALW,MAAM,WACN,OAAO,SAAS,EAAE,WAAW,iBA8BvC;AAED;;;;;;;;;;;;GAYG;AACH,yFANW,MAAM,SACN,OAAO,SAAS,EAAE,gBAAgB,mBAClC,MAAM,oBAUhB;6BAGY,OAAO,WAAW,EAAE,cAAc"}
1
+ {"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../lib/commands/notifications.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAC,WAAW,EAAE,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAG3D;;;;;;;;;;GAUG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,IAAI,CAAC,CA0Bf;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,cAAc,EACpB,IAAI,EAAE,MAAM,EACZ,IAAI,GAAE,gBAA0B,EAChC,cAAc,GAAE,MAAW,GAC1B,OAAO,CAAC,IAAI,CAAC,CAMf"}
@@ -13,10 +13,10 @@ const lodash_1 = __importDefault(require("lodash"));
13
13
  * **Only "remote" push notifications are supported.** VoIP, Complication, File Provider, and other types are unsupported.
14
14
  *
15
15
  * Supported in Xcode SDK 11.4+.
16
- * @param {string} bundleId - The bundle identifier of the target application
17
- * @param {import('./types').PushPayload} payload - Valid push payload.
16
+ *
17
+ * @param bundleId - The bundle identifier of the target application
18
+ * @param payload - Valid push payload.
18
19
  * @group Simulator Only
19
- * @this {XCUITestDriver}
20
20
  */
21
21
  async function mobilePushNotification(bundleId, payload) {
22
22
  if (!this.isSimulator()) {
@@ -33,7 +33,7 @@ async function mobilePushNotification(bundleId, payload) {
33
33
  throw new driver_1.errors.InvalidArgumentError(`The 'payload.aps' value must be a valid dictionary. ` +
34
34
  `Got ${JSON.stringify(payload.aps)} instead`);
35
35
  }
36
- return await /** @type {import('appium-ios-simulator').Simulator} */ (this.device).pushNotification({
36
+ await this.device.pushNotification({
37
37
  ...payload,
38
38
  'Simulator Target Bundle': bundleId,
39
39
  });
@@ -45,20 +45,16 @@ async function mobilePushNotification(bundleId, payload) {
45
45
  * [`XCTNSNotificationExpectation`](https://developer.apple.com/documentation/xctest/xctnsnotificationexpectation?language=objc) and
46
46
  * [`XCTDarwinNotificationExpectation`](https://developer.apple.com/documentation/xctest/xctdarwinnotificationexpectation?language=objc) entities.
47
47
  *
48
- * @param {string} name - The name of the notification to expect
49
- * @param {import('./types').NotificationType} type - Which notification type to expect.
50
- * @param {number} timeoutSeconds - For how long to wait until the notification is delivered (in float seconds).
48
+ * @param name - The name of the notification to expect
49
+ * @param type - Which notification type to expect.
50
+ * @param timeoutSeconds - For how long to wait until the notification is delivered (in float seconds).
51
51
  * @throws A [`TimeoutError`](https://www.selenium.dev/selenium/docs/api/javascript/module/selenium-webdriver/lib/error_exports_TimeoutError.html) if the expected notification has not been delivered within the given timeout.
52
- * @this {XCUITestDriver}
53
52
  */
54
53
  async function mobileExpectNotification(name, type = 'plain', timeoutSeconds = 60) {
55
- return await this.proxyCommand('/wda/expectNotification', 'POST', {
54
+ await this.proxyCommand('/wda/expectNotification', 'POST', {
56
55
  name,
57
56
  type,
58
57
  timeout: timeoutSeconds,
59
58
  });
60
59
  }
61
- /**
62
- * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
63
- */
64
60
  //# sourceMappingURL=notifications.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../../lib/commands/notifications.js"],"names":[],"mappings":";;;;;AAcA,wDA0BC;AAeD,4DAMC;AA7DD,0CAAqC;AACrC,oDAAuB;AAEvB;;;;;;;;;;GAUG;AACI,KAAK,UAAU,sBAAsB,CAAC,QAAQ,EAAE,OAAO;IAC5D,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IAED,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,eAAM,CAAC,oBAAoB,CACnC,8DAA8D,CAC/D,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,gBAAC,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,eAAM,CAAC,oBAAoB,CACnC,2DAA2D;YACzD,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAC3C,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,gBAAC,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,eAAM,CAAC,oB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AC,GAAG,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,eAAM,CAAC,oBAAoB,CACnC,sDAAsD;YACpD,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAC/C,CAAC;IACJ,CAAC;IACD,MAAO,IAAI,CAAC,MAAoB,CAAC,gBAAgB,CAAC;QAChD,GAAG,OAAO;QACV,yBAAyB,EAAE,QAAQ;KACpC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,wBAAwB,CAE5C,IAAY,EACZ,OAAyB,OAAO,EAChC,iBAAyB,EAAE;IAE3B,MAAM,IAAI,CAAC,YAAY,CAAC,yBAAyB,EAAE,MAAM,EAAE;QACzD,IAAI;QACJ,IAAI;QACJ,OAAO,EAAE,cAAc;KACxB,CAAC,CAAC;AACL,CAAC"}
@@ -1,36 +1,34 @@
1
+ import { PermissionService } from './enum';
2
+ import type { XCUITestDriver } from '../driver';
3
+ import type { PermissionState } from './types';
1
4
  /**
2
5
  * Resets the given permission for the active application under test.
3
6
  * Works for both Simulator and real devices using Xcode SDK 11.4+
4
7
  *
5
- * @param {PermissionService|number} service - One of the available service names. This could also be an integer protected resource identifier; see [this list](https://developer.apple.com/documentation/xctest/xcuiprotectedresource?language=objc)
6
- * @throws {Error} If permission reset fails on the device.
7
- * @this {XCUITestDriver}
8
+ * @param service - One of the available service names. This could also be an integer protected resource identifier; see [this list](https://developer.apple.com/documentation/xctest/xcuiprotectedresource?language=objc)
9
+ * @throws If permission reset fails on the device.
8
10
  */
9
- export function mobileResetPermission(this: import("../driver").XCUITestDriver, service: PermissionService | number): Promise<void>;
11
+ export declare function mobileResetPermission(this: XCUITestDriver, service: PermissionService | number): Promise<void>;
10
12
  /**
11
13
  * Gets application permission state on a simulated device.
12
14
  *
13
15
  * **This method requires [WIX applesimutils](https://github.com/wix/AppleSimulatorUtils) to be installed on the Appium server host.**
14
16
  *
15
- * @param {string} bundleId - Bundle identifier of the target application
16
- * @param {import('./enum').PermissionService} service - Service name
17
- * @returns {Promise<import('./types').PermissionState>} Either 'yes', 'no', 'unset' or 'limited'
18
- * @throws {Error} If permission getting fails or the device is not a Simulator.
19
- * @this {XCUITestDriver}
17
+ * @param bundleId - Bundle identifier of the target application
18
+ * @param service - Service name
19
+ * @returns Either 'yes', 'no', 'unset' or 'limited'
20
+ * @throws If permission getting fails or the device is not a Simulator.
20
21
  * @group Simulator Only
21
22
  */
22
- export function mobileGetPermission(this: import("../driver").XCUITestDriver, bundleId: string, service: import("./enum").PermissionService): Promise<import("./types").PermissionState>;
23
+ export declare function mobileGetPermission(this: XCUITestDriver, bundleId: string, service: PermissionService): Promise<PermissionState>;
23
24
  /**
24
25
  * Set application permission state on Simulator.
25
26
  *
26
- * @param {Record<Partial<import('./types').AccessRule>, import('./types').PermissionState>} access - One or more access rules to set.
27
- * @param {string} bundleId - Bundle identifier of the target application
27
+ * @param access - One or more access rules to set.
28
+ * @param bundleId - Bundle identifier of the target application
28
29
  * @since Xcode SDK 11.4
29
- * @throws {Error} If permission setting fails or the device is not a Simulator.
30
+ * @throws If permission setting fails or the device is not a Simulator.
30
31
  * @group Simulator Only
31
- * @this {XCUITestDriver}
32
32
  */
33
- export function mobileSetPermissions(this: import("../driver").XCUITestDriver, access: Record<Partial<import("./types").AccessRule>, import("./types").PermissionState>, bundleId: string): Promise<void>;
34
- export type XCUITestDriver = import("../driver").XCUITestDriver;
35
- import { PermissionService } from './enum';
33
+ export declare function mobileSetPermissions(this: XCUITestDriver, access: Record<string, PermissionState>, bundleId: string): Promise<void>;
36
34
  //# sourceMappingURL=permissions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../lib/commands/permissions.js"],"names":[],"mappings":"AAMA;;;;;;;GAOG;AACH,yFAJW,iBAAiB,GAAC,MAAM,iBA0BlC;AAED;;;;;;;;;;;GAWG;AACH,wFAPW,MAAM,WACN,OAAO,QAAQ,EAAE,iBAAiB,GAChC,OAAO,CAAC,OAAO,SAAS,EAAE,eAAe,CAAC,CAgBtD;AAED;;;;;;;;;GASG;AACH,uFAPW,MAAM,CAAC,OAAO,CAAC,OAAO,SAAS,EAAE,UAAU,CAAC,EAAE,OAAO,SAAS,EAAE,eAAe,CAAC,YAChF,MAAM,iBAahB;6BAGY,OAAO,WAAW,EAAE,cAAc;kCAlFf,QAAQ"}
1
+ {"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../../lib/commands/permissions.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,iBAAiB,EAAC,MAAM,QAAQ,CAAC;AAEzC,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,SAAS,CAAC;AAG7C;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,iBAAiB,GAAG,MAAM,GAClC,OAAO,CAAC,IAAI,CAAC,CAsBf;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,eAAe,CAAC,CAS1B;AAED;;;;;;;;GAQG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,cAAc,EACpB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,EACvC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC,CAOf"}
@@ -9,14 +9,12 @@ exports.mobileSetPermissions = mobileSetPermissions;
9
9
  const lodash_1 = __importDefault(require("lodash"));
10
10
  const enum_1 = require("./enum");
11
11
  const utils_1 = require("../utils");
12
- const assertSimulator = (driver) => utils_1.assertSimulator.call(driver, 'Permission-related operations');
13
12
  /**
14
13
  * Resets the given permission for the active application under test.
15
14
  * Works for both Simulator and real devices using Xcode SDK 11.4+
16
15
  *
17
- * @param {PermissionService|number} service - One of the available service names. This could also be an integer protected resource identifier; see [this list](https://developer.apple.com/documentation/xctest/xcuiprotectedresource?language=objc)
18
- * @throws {Error} If permission reset fails on the device.
19
- * @this {XCUITestDriver}
16
+ * @param service - One of the available service names. This could also be an integer protected resource identifier; see [this list](https://developer.apple.com/documentation/xctest/xcuiprotectedresource?language=objc)
17
+ * @throws If permission reset fails on the device.
20
18
  */
21
19
  async function mobileResetPermission(service) {
22
20
  if (!service) {
@@ -43,11 +41,10 @@ async function mobileResetPermission(service) {
43
41
  *
44
42
  * **This method requires [WIX applesimutils](https://github.com/wix/AppleSimulatorUtils) to be installed on the Appium server host.**
45
43
  *
46
- * @param {string} bundleId - Bundle identifier of the target application
47
- * @param {import('./enum').PermissionService} service - Service name
48
- * @returns {Promise<import('./types').PermissionState>} Either 'yes', 'no', 'unset' or 'limited'
49
- * @throws {Error} If permission getting fails or the device is not a Simulator.
50
- * @this {XCUITestDriver}
44
+ * @param bundleId - Bundle identifier of the target application
45
+ * @param service - Service name
46
+ * @returns Either 'yes', 'no', 'unset' or 'limited'
47
+ * @throws If permission getting fails or the device is not a Simulator.
51
48
  * @group Simulator Only
52
49
  */
53
50
  async function mobileGetPermission(bundleId, service) {
@@ -55,26 +52,23 @@ async function mobileGetPermission(bundleId, service) {
55
52
  throw new Error(`The 'service' option is expected to be present`);
56
53
  }
57
54
  assertSimulator(this);
58
- return /** @type {import('./types').PermissionState} */ (await /** @type {import('appium-ios-simulator').Simulator} */ (this.device).getPermission(bundleId, String(service)));
55
+ return await this.device.getPermission(bundleId, String(service));
59
56
  }
60
57
  /**
61
58
  * Set application permission state on Simulator.
62
59
  *
63
- * @param {Record<Partial<import('./types').AccessRule>, import('./types').PermissionState>} access - One or more access rules to set.
64
- * @param {string} bundleId - Bundle identifier of the target application
60
+ * @param access - One or more access rules to set.
61
+ * @param bundleId - Bundle identifier of the target application
65
62
  * @since Xcode SDK 11.4
66
- * @throws {Error} If permission setting fails or the device is not a Simulator.
63
+ * @throws If permission setting fails or the device is not a Simulator.
67
64
  * @group Simulator Only
68
- * @this {XCUITestDriver}
69
65
  */
70
66
  async function mobileSetPermissions(access, bundleId) {
71
67
  if (!lodash_1.default.isPlainObject(access)) {
72
68
  throw new Error(`The 'access' option is expected to be a map`);
73
69
  }
74
70
  assertSimulator(this);
75
- await /** @type {import('appium-ios-simulator').Simulator} */ (this.device).setPermissions(bundleId, access);
71
+ await this.device.setPermissions(bundleId, access);
76
72
  }
77
- /**
78
- * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
79
- */
73
+ const assertSimulator = (driver) => utils_1.assertSimulator.call(driver, 'Permission-related operations');
80
74
  //# sourceMappingURL=permissions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"permissions.js","sourceRoot":"","sources":["../../../lib/commands/permissions.js"],"names":[],"mappings":";;;;;AAcA,sDAsBC;AAcD,kDAWC;AAYD,oDAOC;AAhFD,oDAAuB;AACvB,iCAAyC;AACzC,oCAA6D;AAE7D,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,EAAE,CAAC,uBAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,+BAA+B,CAAC,CAAC;AAEnG;;;;;;;GAOG;AACI,KAAK,UAAU,qBAAqB,CAAC,OAAO;IACjD,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;IACpE,CAAC;IACD,IAAI,QAAQ,CAAC;IACb,IAAI,gBAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACxB,QAAQ,GAAG,wBAAiB,CAAC,gBAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC;QACjD,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CACb,qCAAqC,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,gBAAC,CAAC,IAAI,CAAC,wBAAiB,CAAC,CAAC,EAAE,CACvF,CAAC;QACJ,C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IAEhB,IAAI,CAAC,gBAAC,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC;QAC7B,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IACjE,CAAC;IACD,eAAe,CAAC,IAAI,CAAC,CAAC;IAEtB,MAAO,IAAI,CAAC,MAAoB,CAAC,cAAc,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AACpE,CAAC;AAED,MAAM,eAAe,GAAG,CAAC,MAAsB,EAAE,EAAE,CAAC,uBAAgB,CAAC,IAAI,CAAC,MAAM,EAAE,+BAA+B,CAAC,CAAC"}
@@ -1,15 +1,15 @@
1
+ import type { XCUITestDriver } from '../driver';
2
+ export type AllowedHttpMethod = 'GET' | 'POST' | 'DELETE';
1
3
  /**
2
4
  * Proxies a command to WebDriverAgent
3
- * @template [TReq=any]
4
- * @template [TRes=unknown]
5
- * @param {string} url
6
- * @param {AllowedHttpMethod} method
7
- * @param {TReq} [body]
8
- * @param {boolean} isSessionCommand
9
- * @this {import('../driver').XCUITestDriver}
10
- * @returns {Promise<TRes>}
5
+ *
6
+ * @template TReq - Request body type
7
+ * @template TRes - Response type
8
+ * @param url - The endpoint URL
9
+ * @param method - HTTP method to use
10
+ * @param body - Optional request body
11
+ * @param isSessionCommand - Whether this is a session command (default: true)
12
+ * @returns Promise resolving to the response
11
13
  */
12
- export function proxyCommand<TReq = any, TRes = unknown>(this: import("../driver").XCUITestDriver, url: string, method: AllowedHttpMethod, body?: TReq, isSessionCommand?: boolean): Promise<TRes>;
13
- export type XCUITestDriver = import("../driver").XCUITestDriver;
14
- export type AllowedHttpMethod = "GET" | "POST" | "DELETE";
14
+ export declare function proxyCommand<TReq = any, TRes = unknown>(this: XCUITestDriver, url: string, method: AllowedHttpMethod, body?: TReq, isSessionCommand?: boolean): Promise<TRes>;
15
15
  //# sourceMappingURL=proxy-helper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"proxy-helper.d.ts","sourceRoot":"","sources":["../../../lib/commands/proxy-helper.js"],"names":[],"mappings":"AA+CA;;;;;;;;;;GAUG;AACH,6BATc,IAAI,QACJ,IAAI,2DACP,MAAM,UACN,iBAAiB,SACjB,IAAI,qBACJ,OAAO,GAEL,OAAO,CAAC,IAAI,CAAC,CA8CzB;6BAcY,OAAO,WAAW,EAAE,cAAc;gCAClC,KAAK,GAAC,MAAM,GAAC,QAAQ"}
1
+ {"version":3,"file":"proxy-helper.d.ts","sourceRoot":"","sources":["../../../lib/commands/proxy-helper.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AA8C9C,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE1D;;;;;;;;;;GAUG;AACH,wBAAsB,YAAY,CAAC,IAAI,GAAG,GAAG,EAAE,IAAI,GAAG,OAAO,EAC3D,IAAI,EAAE,cAAc,EACpB,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,iBAAiB,EACzB,IAAI,CAAC,EAAE,IAAI,EACX,gBAAgB,GAAE,OAAc,GAC/B,OAAO,CAAC,IAAI,CAAC,CA4Cf"}
@@ -9,8 +9,8 @@ const bluebird_1 = __importDefault(require("bluebird"));
9
9
  const GET = 'GET';
10
10
  const POST = 'POST';
11
11
  const DELETE = 'DELETE';
12
- const SUPPORTED_METHODS = Object.freeze(new Set(/** @type {const} */ ([GET, POST, DELETE])));
13
- const WDA_ROUTES = /** @type {const} */ ({
12
+ const SUPPORTED_METHODS = Object.freeze(new Set([GET, POST, DELETE]));
13
+ const WDA_ROUTES = {
14
14
  '/wda/screen': {
15
15
  GET: 'getScreenInfo',
16
16
  },
@@ -47,21 +47,21 @@ const WDA_ROUTES = /** @type {const} */ ({
47
47
  '/wda/locked': {
48
48
  GET: 'isLocked',
49
49
  },
50
- });
50
+ };
51
51
  /**
52
52
  * Proxies a command to WebDriverAgent
53
- * @template [TReq=any]
54
- * @template [TRes=unknown]
55
- * @param {string} url
56
- * @param {AllowedHttpMethod} method
57
- * @param {TReq} [body]
58
- * @param {boolean} isSessionCommand
59
- * @this {import('../driver').XCUITestDriver}
60
- * @returns {Promise<TRes>}
53
+ *
54
+ * @template TReq - Request body type
55
+ * @template TRes - Response type
56
+ * @param url - The endpoint URL
57
+ * @param method - HTTP method to use
58
+ * @param body - Optional request body
59
+ * @param isSessionCommand - Whether this is a session command (default: true)
60
+ * @returns Promise resolving to the response
61
61
  */
62
62
  async function proxyCommand(url, method, body, isSessionCommand = true) {
63
63
  if (this.shutdownUnexpectedly) {
64
- return /** @type {TRes} */ (undefined);
64
+ return undefined;
65
65
  }
66
66
  if (!url) {
67
67
  throw this.log.errorWithException('Proxying requires an endpoint');
@@ -81,11 +81,11 @@ async function proxyCommand(url, method, body, isSessionCommand = true) {
81
81
  this.log.info(`Proxying to WDA with an unknown route: ${method} ${url}`);
82
82
  }
83
83
  if (!timeout) {
84
- return /** @type {TRes} */ (await proxy.command(url, method, body));
84
+ return await proxy.command(url, method, body);
85
85
  }
86
86
  this.log.debug(`Setting custom timeout to ${timeout} ms for '${cmdName}' command`);
87
87
  try {
88
- return /** @type {TRes} */ (await bluebird_1.default.resolve(proxy.command(url, method, body)).timeout(timeout));
88
+ return await bluebird_1.default.resolve(proxy.command(url, method, body)).timeout(timeout);
89
89
  }
90
90
  catch (e) {
91
91
  if (!(e instanceof bluebird_1.default.Promise.TimeoutError)) {
@@ -97,18 +97,9 @@ async function proxyCommand(url, method, body, isSessionCommand = true) {
97
97
  throw error;
98
98
  }
99
99
  }
100
- /**
101
- * @param {string} endpoint
102
- * @param {AllowedHttpMethod} method
103
- * @returns {string|undefined}
104
- */
105
100
  function wdaRouteToCommandName(endpoint, method) {
106
101
  if (endpoint in WDA_ROUTES) {
107
- return WDA_ROUTES[endpoint][method];
102
+ return WDA_ROUTES[endpoint]?.[method];
108
103
  }
109
104
  }
110
- /**
111
- * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
112
- * @typedef {'GET'|'POST'|'DELETE'} AllowedHttpMethod
113
- */
114
105
  //# sourceMappingURL=proxy-helper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"proxy-helper.js","sourceRoot":"","sources":["../../../lib/commands/proxy-helper.js"],"names":[],"mappings":";;;;;AA0DA,oCA4CC;AAtGD,0CAAyD;AACzD,wDAAyB;AAEzB,MAAM,GAAG,GAAG,KAAK,CAAC;AAClB,MAAM,IAAI,GAAG,MAAM,CAAC;AACpB,MAAM,MAAM,GAAG,QAAQ,CAAC;AACxB,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAE7F,MAAM,UAAU,GAAG,oBAAoB,CAAC,CAAC;IACvC,aAAa,EAAE;QACb,GAAG,EAAE,eAAe;KACrB;IACD,oBAAoB,EAAE;QACpB,GAAG,EAAE,iBAAiB;KACvB;IACD,kBAAkB,EAAE;QAClB,IAAI,EAAE,iBAAiB;KACxB;IACD,qBAAqB,EAAE;QACrB,IAAI,EAAE,oBAAoB;KAC3B;IACD,oBAAoB,EAAE;QACpB,IAAI,EAAE,mBAAmB;KAC1B;IACD,iBAAiB,EAAE;QACjB,IAAI,EAAE,qBAAqB;KAC5B;IACD,WAAW,EAAE;QACX,IAAI,EAAE,MAAM;KACb;IACD,eAAe,EAAE;QACf,IAAI,EAAE,SAAS;KAChB;IACD,uBAAuB,EAAE;QACvB,IAAI,EAAE,cAAc;KACrB;IACD,WAAW,EAAE;QACX,IAAI,EAAE,MAAM;KACb;IACD,aAAa,EAAE;QACb,IAAI,EAAE,QAAQ;KACf;IACD,aAAa,EAAE;QACb,GAAG,EAAE,UAAU;KAChB;CACF,CAAC,CAAC;AAEH;;;;;;;;;;GAUG;AACI,KAAK,UAAU,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,GAAG,IAAI;IAC3E,I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AAC,KAAK,CAAC,CAAC;QAC1C,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC;AAED,SAAS,qBAAqB,CAAC,QAAgB,EAAE,MAAyB;IACxE,IAAI,QAAQ,IAAI,UAAU,EAAE,CAAC;QAC3B,OAAO,UAAU,CAAC,QAAmC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;IACnE,CAAC;AACH,CAAC"}
@@ -1,27 +1,21 @@
1
+ import type { XCUITestDriver } from '../driver';
2
+ export interface SimctlExecResponse {
3
+ /** The output of standard out. */
4
+ stdout: string;
5
+ /** The output of standard error. */
6
+ stderr: string;
7
+ /** Return code. */
8
+ code: number;
9
+ }
1
10
  /**
2
11
  * Run the given command with arguments as `xcrun simctl` subcommand.
3
12
  * This method works behind the 'simctl' security flag.
4
- * @this {XCUITestDriver}
5
- * @param {string} command Subcommand to run with `xcrun simctl`
6
- * @param {string[]} [args=[]] arguments for the subcommand. The arguments should be after <device> in the help.
7
- * @param {number|undefined} timeout - The maximum number of milliseconds
8
- * @returns {Promise<SimctlExecResponse>}
9
- * @throws {Error} If the simctl subcommand command returns non-zero return code, or the given subcommand was invalid.
13
+ *
14
+ * @param command - Subcommand to run with `xcrun simctl`. Must be one of the supported commands.
15
+ * @param args - Arguments for the subcommand. The arguments should be after <device> in the help.
16
+ * @param timeout - The maximum number of milliseconds
17
+ * @returns The execution result with stdout, stderr, and return code
18
+ * @throws If the simctl subcommand command returns non-zero return code, or the given subcommand was invalid.
10
19
  */
11
- export function mobileSimctl(this: import("../driver").XCUITestDriver, command: string, args?: string[], timeout?: number | undefined): Promise<SimctlExecResponse>;
12
- export type SimctlExecResponse = {
13
- /**
14
- * The output of standard out.
15
- */
16
- stdout: string;
17
- /**
18
- * The output of standard error.
19
- */
20
- stderr: string;
21
- /**
22
- * Return code.
23
- */
24
- code: number;
25
- };
26
- export type XCUITestDriver = import("../driver").XCUITestDriver;
20
+ export declare function mobileSimctl(this: XCUITestDriver, command: string, args?: string[], timeout?: number): Promise<SimctlExecResponse>;
27
21
  //# sourceMappingURL=simctl.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"simctl.d.ts","sourceRoot":"","sources":["../../../lib/commands/simctl.js"],"names":[],"mappings":"AA+BA;;;;;;;;;GASG;AACH,gFANW,MAAM,SACN,MAAM,EAAE,YACR,MAAM,GAAC,SAAS,GACd,OAAO,CAAC,kBAAkB,CAAC,CA0BvC;;;;;YAIa,MAAM;;;;YACN,MAAM;;;;UACN,MAAM;;6BAIP,OAAO,WAAW,EAAE,cAAc"}
1
+ {"version":3,"file":"simctl.d.ts","sourceRoot":"","sources":["../../../lib/commands/simctl.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAgC9C,MAAM,WAAW,kBAAkB;IACjC,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;;GASG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,cAAc,EACpB,OAAO,EAAE,MAAM,EACf,IAAI,GAAE,MAAM,EAAO,EACnB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,kBAAkB,CAAC,CAuB7B"}