@limrun/appium-xcuitest-driver 10.11.0-lim.4 → 10.14.6-lim.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/build/lib/commands/active-app-info.d.ts +4 -3
  3. package/build/lib/commands/active-app-info.d.ts.map +1 -1
  4. package/build/lib/commands/active-app-info.js +2 -3
  5. package/build/lib/commands/active-app-info.js.map +1 -1
  6. package/build/lib/commands/alert.d.ts +26 -31
  7. package/build/lib/commands/alert.d.ts.map +1 -1
  8. package/build/lib/commands/alert.js +20 -29
  9. package/build/lib/commands/alert.js.map +1 -1
  10. package/build/lib/commands/app-management.d.ts +99 -76
  11. package/build/lib/commands/app-management.d.ts.map +1 -1
  12. package/build/lib/commands/app-management.js +83 -73
  13. package/build/lib/commands/app-management.js.map +1 -1
  14. package/build/lib/commands/app-strings.d.ts +6 -7
  15. package/build/lib/commands/app-strings.d.ts.map +1 -1
  16. package/build/lib/commands/app-strings.js +3 -8
  17. package/build/lib/commands/app-strings.js.map +1 -1
  18. package/build/lib/commands/appearance.d.ts +7 -9
  19. package/build/lib/commands/appearance.d.ts.map +1 -1
  20. package/build/lib/commands/appearance.js +13 -19
  21. package/build/lib/commands/appearance.js.map +1 -1
  22. package/build/lib/commands/audit.d.ts +5 -33
  23. package/build/lib/commands/audit.d.ts.map +1 -1
  24. package/build/lib/commands/audit.js +3 -16
  25. package/build/lib/commands/audit.js.map +1 -1
  26. package/build/lib/commands/battery.d.ts +4 -4
  27. package/build/lib/commands/battery.d.ts.map +1 -1
  28. package/build/lib/commands/battery.js +3 -7
  29. package/build/lib/commands/battery.js.map +1 -1
  30. package/build/lib/commands/biometric.d.ts +12 -14
  31. package/build/lib/commands/biometric.d.ts.map +1 -1
  32. package/build/lib/commands/biometric.js +10 -19
  33. package/build/lib/commands/biometric.js.map +1 -1
  34. package/build/lib/commands/certificate.d.ts +14 -19
  35. package/build/lib/commands/certificate.d.ts.map +1 -1
  36. package/build/lib/commands/certificate.js +24 -31
  37. package/build/lib/commands/certificate.js.map +1 -1
  38. package/build/lib/commands/clipboard.d.ts +9 -11
  39. package/build/lib/commands/clipboard.d.ts.map +1 -1
  40. package/build/lib/commands/clipboard.js +8 -13
  41. package/build/lib/commands/clipboard.js.map +1 -1
  42. package/build/lib/commands/condition.d.ts +9 -72
  43. package/build/lib/commands/condition.d.ts.map +1 -1
  44. package/build/lib/commands/condition.js +5 -66
  45. package/build/lib/commands/condition.js.map +1 -1
  46. package/build/lib/commands/content-size.d.ts +16 -19
  47. package/build/lib/commands/content-size.d.ts.map +1 -1
  48. package/build/lib/commands/content-size.js +14 -22
  49. package/build/lib/commands/content-size.js.map +1 -1
  50. package/build/lib/commands/context.d.ts +130 -161
  51. package/build/lib/commands/context.d.ts.map +1 -1
  52. package/build/lib/commands/context.js +123 -108
  53. package/build/lib/commands/context.js.map +1 -1
  54. package/build/lib/commands/device-info.d.ts +13 -0
  55. package/build/lib/commands/device-info.d.ts.map +1 -0
  56. package/build/lib/commands/device-info.js +20 -0
  57. package/build/lib/commands/device-info.js.map +1 -0
  58. package/build/lib/commands/element.d.ts +83 -67
  59. package/build/lib/commands/element.d.ts.map +1 -1
  60. package/build/lib/commands/element.js +111 -134
  61. package/build/lib/commands/element.js.map +1 -1
  62. package/build/lib/commands/execute.d.ts +10 -22
  63. package/build/lib/commands/execute.d.ts.map +1 -1
  64. package/build/lib/commands/execute.js +13 -29
  65. package/build/lib/commands/execute.js.map +1 -1
  66. package/build/lib/commands/file-movement.d.ts +31 -42
  67. package/build/lib/commands/file-movement.d.ts.map +1 -1
  68. package/build/lib/commands/file-movement.js +146 -205
  69. package/build/lib/commands/file-movement.js.map +1 -1
  70. package/build/lib/commands/find.d.ts +20 -12
  71. package/build/lib/commands/find.d.ts.map +1 -1
  72. package/build/lib/commands/find.js +27 -65
  73. package/build/lib/commands/find.js.map +1 -1
  74. package/build/lib/commands/general.d.ts +84 -80
  75. package/build/lib/commands/general.d.ts.map +1 -1
  76. package/build/lib/commands/general.js +67 -54
  77. package/build/lib/commands/general.js.map +1 -1
  78. package/build/lib/commands/geolocation.d.ts +16 -36
  79. package/build/lib/commands/geolocation.d.ts.map +1 -1
  80. package/build/lib/commands/geolocation.js +8 -25
  81. package/build/lib/commands/geolocation.js.map +1 -1
  82. package/build/lib/commands/gesture.d.ts +103 -119
  83. package/build/lib/commands/gesture.d.ts.map +1 -1
  84. package/build/lib/commands/gesture.js +98 -138
  85. package/build/lib/commands/gesture.js.map +1 -1
  86. package/build/lib/commands/increase-contrast.d.ts +10 -13
  87. package/build/lib/commands/increase-contrast.d.ts.map +1 -1
  88. package/build/lib/commands/increase-contrast.js +8 -16
  89. package/build/lib/commands/increase-contrast.js.map +1 -1
  90. package/build/lib/commands/iohid.d.ts +6 -1359
  91. package/build/lib/commands/iohid.d.ts.map +1 -1
  92. package/build/lib/commands/iohid.js +5 -10
  93. package/build/lib/commands/iohid.js.map +1 -1
  94. package/build/lib/commands/keyboard.d.ts +16 -13
  95. package/build/lib/commands/keyboard.d.ts.map +1 -1
  96. package/build/lib/commands/keyboard.js +14 -18
  97. package/build/lib/commands/keyboard.js.map +1 -1
  98. package/build/lib/commands/keychains.d.ts +2 -2
  99. package/build/lib/commands/keychains.d.ts.map +1 -1
  100. package/build/lib/commands/keychains.js +1 -4
  101. package/build/lib/commands/keychains.js.map +1 -1
  102. package/build/lib/commands/localization.d.ts +7 -6
  103. package/build/lib/commands/localization.d.ts.map +1 -1
  104. package/build/lib/commands/localization.js +7 -8
  105. package/build/lib/commands/localization.js.map +1 -1
  106. package/build/lib/commands/location.d.ts +8 -11
  107. package/build/lib/commands/location.d.ts.map +1 -1
  108. package/build/lib/commands/location.js +7 -15
  109. package/build/lib/commands/location.js.map +1 -1
  110. package/build/lib/commands/lock.d.ts +6 -10
  111. package/build/lib/commands/lock.d.ts.map +1 -1
  112. package/build/lib/commands/lock.js +3 -10
  113. package/build/lib/commands/lock.js.map +1 -1
  114. package/build/lib/commands/log.d.ts +42 -44
  115. package/build/lib/commands/log.d.ts.map +1 -1
  116. package/build/lib/commands/log.js +32 -53
  117. package/build/lib/commands/log.js.map +1 -1
  118. package/build/lib/commands/memory.d.ts +4 -5
  119. package/build/lib/commands/memory.d.ts.map +1 -1
  120. package/build/lib/commands/memory.js +3 -8
  121. package/build/lib/commands/memory.js.map +1 -1
  122. package/build/lib/commands/navigation.d.ts +14 -26
  123. package/build/lib/commands/navigation.d.ts.map +1 -1
  124. package/build/lib/commands/navigation.js +22 -32
  125. package/build/lib/commands/navigation.js.map +1 -1
  126. package/build/lib/commands/notifications.d.ts +10 -10
  127. package/build/lib/commands/notifications.d.ts.map +1 -1
  128. package/build/lib/commands/notifications.js +8 -12
  129. package/build/lib/commands/notifications.js.map +1 -1
  130. package/build/lib/commands/pasteboard.d.ts +9 -10
  131. package/build/lib/commands/pasteboard.d.ts.map +1 -1
  132. package/build/lib/commands/pasteboard.js +8 -13
  133. package/build/lib/commands/pasteboard.js.map +1 -1
  134. package/build/lib/commands/pcap.d.ts +18 -38
  135. package/build/lib/commands/pcap.d.ts.map +1 -1
  136. package/build/lib/commands/pcap.js +9 -14
  137. package/build/lib/commands/pcap.js.map +1 -1
  138. package/build/lib/commands/performance.d.ts +36 -55
  139. package/build/lib/commands/performance.d.ts.map +1 -1
  140. package/build/lib/commands/performance.js +93 -86
  141. package/build/lib/commands/performance.js.map +1 -1
  142. package/build/lib/commands/permissions.d.ts +15 -17
  143. package/build/lib/commands/permissions.d.ts.map +1 -1
  144. package/build/lib/commands/permissions.js +12 -18
  145. package/build/lib/commands/permissions.js.map +1 -1
  146. package/build/lib/commands/proxy-helper.d.ts +11 -11
  147. package/build/lib/commands/proxy-helper.d.ts.map +1 -1
  148. package/build/lib/commands/proxy-helper.js +15 -24
  149. package/build/lib/commands/proxy-helper.js.map +1 -1
  150. package/build/lib/commands/record-audio.d.ts +25 -52
  151. package/build/lib/commands/record-audio.d.ts.map +1 -1
  152. package/build/lib/commands/record-audio.js +17 -19
  153. package/build/lib/commands/record-audio.js.map +1 -1
  154. package/build/lib/commands/recordscreen.d.ts +31 -62
  155. package/build/lib/commands/recordscreen.d.ts.map +1 -1
  156. package/build/lib/commands/recordscreen.js +29 -28
  157. package/build/lib/commands/recordscreen.js.map +1 -1
  158. package/build/lib/commands/screenshots.d.ts +15 -9
  159. package/build/lib/commands/screenshots.d.ts.map +1 -1
  160. package/build/lib/commands/screenshots.js +16 -16
  161. package/build/lib/commands/screenshots.js.map +1 -1
  162. package/build/lib/commands/simctl.d.ts +16 -22
  163. package/build/lib/commands/simctl.d.ts.map +1 -1
  164. package/build/lib/commands/simctl.js +13 -17
  165. package/build/lib/commands/simctl.js.map +1 -1
  166. package/build/lib/commands/source.d.ts +10 -8
  167. package/build/lib/commands/source.d.ts.map +1 -1
  168. package/build/lib/commands/source.js +11 -14
  169. package/build/lib/commands/source.js.map +1 -1
  170. package/build/lib/commands/timeouts.d.ts +25 -32
  171. package/build/lib/commands/timeouts.d.ts.map +1 -1
  172. package/build/lib/commands/timeouts.js +19 -15
  173. package/build/lib/commands/timeouts.js.map +1 -1
  174. package/build/lib/commands/types.d.ts +80 -0
  175. package/build/lib/commands/types.d.ts.map +1 -1
  176. package/build/lib/commands/web.d.ts +199 -202
  177. package/build/lib/commands/web.d.ts.map +1 -1
  178. package/build/lib/commands/web.js +216 -175
  179. package/build/lib/commands/web.js.map +1 -1
  180. package/build/lib/commands/xctest-record-screen.d.ts +17 -47
  181. package/build/lib/commands/xctest-record-screen.d.ts.map +1 -1
  182. package/build/lib/commands/xctest-record-screen.js +28 -59
  183. package/build/lib/commands/xctest-record-screen.js.map +1 -1
  184. package/build/lib/commands/xctest.d.ts +37 -37
  185. package/build/lib/commands/xctest.d.ts.map +1 -1
  186. package/build/lib/commands/xctest.js +38 -50
  187. package/build/lib/commands/xctest.js.map +1 -1
  188. package/build/lib/desired-caps.js +1 -1
  189. package/build/lib/device/log/ios-simulator-log.d.ts.map +1 -1
  190. package/build/lib/device/log/ios-simulator-log.js +2 -0
  191. package/build/lib/device/log/ios-simulator-log.js.map +1 -1
  192. package/build/lib/device/simulator-management.d.ts.map +1 -1
  193. package/build/lib/device/simulator-management.js +0 -2
  194. package/build/lib/device/simulator-management.js.map +1 -1
  195. package/build/lib/doctor/optional-checks.d.ts +0 -9
  196. package/build/lib/doctor/optional-checks.d.ts.map +1 -1
  197. package/build/lib/doctor/optional-checks.js +1 -30
  198. package/build/lib/doctor/optional-checks.js.map +1 -1
  199. package/build/lib/driver.d.ts +6 -5
  200. package/build/lib/driver.d.ts.map +1 -1
  201. package/build/lib/driver.js +16 -14
  202. package/build/lib/driver.js.map +1 -1
  203. package/build/lib/execute-method-map.d.ts.map +1 -1
  204. package/build/lib/execute-method-map.js +0 -9
  205. package/build/lib/execute-method-map.js.map +1 -1
  206. package/lib/commands/active-app-info.ts +15 -0
  207. package/lib/commands/alert.ts +98 -0
  208. package/lib/commands/app-management.ts +414 -0
  209. package/lib/commands/{app-strings.js → app-strings.ts} +10 -9
  210. package/lib/commands/appearance.ts +70 -0
  211. package/lib/commands/audit.ts +25 -0
  212. package/lib/commands/{battery.js → battery.ts} +10 -12
  213. package/lib/commands/biometric.ts +52 -0
  214. package/lib/commands/{certificate.js → certificate.ts} +55 -50
  215. package/lib/commands/clipboard.ts +37 -0
  216. package/lib/commands/{condition.js → condition.ts} +21 -77
  217. package/lib/commands/content-size.ts +67 -0
  218. package/lib/commands/{context.js → context.ts} +174 -146
  219. package/lib/commands/device-info.ts +24 -0
  220. package/lib/commands/element.ts +419 -0
  221. package/lib/commands/{execute.js → execute.ts} +42 -38
  222. package/lib/commands/{file-movement.js → file-movement.ts} +212 -235
  223. package/lib/commands/find.ts +277 -0
  224. package/lib/commands/{general.js → general.ts} +102 -77
  225. package/lib/commands/geolocation.ts +55 -0
  226. package/lib/commands/{gesture.js → gesture.ts} +225 -183
  227. package/lib/commands/increase-contrast.ts +49 -0
  228. package/lib/commands/{iohid.js → iohid.ts} +15 -13
  229. package/lib/commands/keyboard.ts +70 -0
  230. package/lib/commands/keychains.ts +16 -0
  231. package/lib/commands/{localization.js → localization.ts} +22 -12
  232. package/lib/commands/{location.js → location.ts} +19 -22
  233. package/lib/commands/lock.ts +43 -0
  234. package/lib/commands/{log.js → log.ts} +68 -68
  235. package/lib/commands/{memory.js → memory.ts} +9 -9
  236. package/lib/commands/{navigation.js → navigation.ts} +42 -39
  237. package/lib/commands/{notifications.js → notifications.ts} +22 -14
  238. package/lib/commands/pasteboard.ts +44 -0
  239. package/lib/commands/{pcap.js → pcap.ts} +28 -28
  240. package/lib/commands/{performance.js → performance.ts} +133 -114
  241. package/lib/commands/permissions.ts +90 -0
  242. package/lib/commands/{proxy-helper.js → proxy-helper.ts} +26 -26
  243. package/lib/commands/{record-audio.js → record-audio.ts} +35 -33
  244. package/lib/commands/{recordscreen.js → recordscreen.ts} +78 -50
  245. package/lib/commands/{screenshots.js → screenshots.ts} +27 -21
  246. package/lib/commands/simctl.ts +82 -0
  247. package/lib/commands/{source.js → source.ts} +23 -20
  248. package/lib/commands/timeouts.ts +95 -0
  249. package/lib/commands/types.ts +86 -0
  250. package/lib/commands/{web.js → web.ts} +314 -264
  251. package/lib/commands/{xctest-record-screen.js → xctest-record-screen.ts} +54 -71
  252. package/lib/commands/{xctest.js → xctest.ts} +78 -71
  253. package/lib/desired-caps.ts +1 -1
  254. package/lib/device/log/ios-simulator-log.ts +2 -0
  255. package/lib/device/simulator-management.ts +0 -2
  256. package/lib/doctor/optional-checks.ts +0 -33
  257. package/lib/driver.ts +19 -17
  258. package/lib/execute-method-map.ts +0 -9
  259. package/package.json +6 -6
  260. package/lib/commands/active-app-info.js +0 -12
  261. package/lib/commands/alert.js +0 -88
  262. package/lib/commands/app-management.js +0 -346
  263. package/lib/commands/appearance.js +0 -71
  264. package/lib/commands/audit.js +0 -31
  265. package/lib/commands/biometric.js +0 -52
  266. package/lib/commands/clipboard.js +0 -35
  267. package/lib/commands/content-size.js +0 -68
  268. package/lib/commands/deviceInfo.js +0 -27
  269. package/lib/commands/element.js +0 -423
  270. package/lib/commands/find.js +0 -205
  271. package/lib/commands/geolocation.js +0 -56
  272. package/lib/commands/increase-contrast.js +0 -50
  273. package/lib/commands/keyboard.js +0 -62
  274. package/lib/commands/keychains.js +0 -17
  275. package/lib/commands/lock.js +0 -46
  276. package/lib/commands/pasteboard.js +0 -43
  277. package/lib/commands/permissions.js +0 -85
  278. package/lib/commands/simctl.js +0 -71
  279. package/lib/commands/timeouts.js +0 -68
@@ -11,8 +11,9 @@ const lodash_1 = __importDefault(require("lodash"));
11
11
  const driver_1 = require("appium/driver");
12
12
  const support_1 = require("appium/support");
13
13
  /**
14
- * @this {XCUITestDriver}
15
- * @returns {Promise<string>}
14
+ * Takes a screenshot of the current screen.
15
+ *
16
+ * @returns Base64-encoded screenshot data
16
17
  */
17
18
  async function getScreenshot() {
18
19
  if (this.isWebContext()) {
@@ -20,8 +21,8 @@ async function getScreenshot() {
20
21
  switch (lodash_1.default.toLower(webScreenshotMode)) {
21
22
  case 'page':
22
23
  case 'viewport':
23
- return await ( /** @type {import('appium-remote-debugger').RemoteDebugger} */(this.remote)).captureScreenshot({
24
- coordinateSystem: /** @type {'Viewport'|'Page'} */ (lodash_1.default.capitalize(webScreenshotMode)),
24
+ return await this.remote.captureScreenshot({
25
+ coordinateSystem: lodash_1.default.capitalize(webScreenshotMode),
25
26
  });
26
27
  case 'native':
27
28
  case undefined:
@@ -60,17 +61,20 @@ async function getScreenshot() {
60
61
  // simulator attempt
61
62
  if (this.isSimulator()) {
62
63
  this.log.info(`Falling back to 'simctl io screenshot' API`);
63
- const payload = await /** @type {import('appium-ios-simulator').Simulator} */ (this.device).simctl.getScreenshot();
64
+ const payload = await this.device.simctl.getScreenshot();
64
65
  if (!payload) {
65
66
  throw new driver_1.errors.UnableToCaptureScreen();
66
67
  }
67
68
  return payload;
68
69
  }
69
70
  // Retry for real devices only. Fail fast on Simulator if simctl does not work as expected
70
- return /** @type {string} */ (await (0, asyncbox_1.retryInterval)(2, 1000, getScreenshotFromWDA));
71
+ return await (0, asyncbox_1.retryInterval)(2, 1000, getScreenshotFromWDA);
71
72
  }
72
73
  /**
73
- * @this {XCUITestDriver}
74
+ * Takes a screenshot of a specific element.
75
+ *
76
+ * @param el - Element to capture
77
+ * @returns Base64-encoded screenshot data
74
78
  */
75
79
  async function getElementScreenshot(el) {
76
80
  el = support_1.util.unwrapElement(el);
@@ -81,8 +85,7 @@ async function getElementScreenshot(el) {
81
85
  throw new driver_1.errors.UnableToCaptureScreen('Cannot take a screenshot of a zero-size element');
82
86
  }
83
87
  const { x, y } = await this.executeAtom('get_top_left_coordinates', [atomsElement]);
84
- return await ( /** @type {import('appium-remote-debugger').RemoteDebugger} */(this.remote))
85
- .captureScreenshot({ rect: { x, y, width, height } });
88
+ return await this.remote.captureScreenshot({ rect: { x, y, width, height } });
86
89
  }
87
90
  const data = await this.proxyCommand(`/element/${el}/screenshot`, 'GET');
88
91
  if (!lodash_1.default.isString(data)) {
@@ -91,13 +94,13 @@ async function getElementScreenshot(el) {
91
94
  return data;
92
95
  }
93
96
  /**
94
- * @this {XCUITestDriver}
95
- * @returns {Promise<string>}
97
+ * Takes a screenshot of the current viewport.
98
+ *
99
+ * @returns Base64-encoded screenshot data
96
100
  */
97
101
  async function getViewportScreenshot() {
98
102
  if (this.isWebContext()) {
99
- return await ( /** @type {import('appium-remote-debugger').RemoteDebugger} */(this.remote))
100
- .captureScreenshot();
103
+ return await this.remote.captureScreenshot();
101
104
  }
102
105
  const screenshot = await this.getScreenshot();
103
106
  // if we don't have a status bar, there's nothing to crop, so we can avoid
@@ -123,7 +126,4 @@ async function getViewportScreenshot() {
123
126
  this.log.debug(`Calculated viewport rect: ${JSON.stringify(region)}`);
124
127
  return await support_1.imageUtil.cropBase64Image(screenshot, region);
125
128
  }
126
- /**
127
- * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
128
- */
129
129
  //# sourceMappingURL=screenshots.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 /** 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,CAqBvC;;;;;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"}
@@ -33,14 +33,14 @@ const SUBCOMMANDS_HAS_DEVICE = [
33
33
  /**
34
34
  * Run the given command with arguments as `xcrun simctl` subcommand.
35
35
  * This method works behind the 'simctl' security flag.
36
- * @this {XCUITestDriver}
37
- * @param {string} command Subcommand to run with `xcrun simctl`
38
- * @param {string[]} [args=[]] arguments for the subcommand. The arguments should be after <device> in the help.
39
- * @param {number|undefined} timeout - The maximum number of milliseconds
40
- * @returns {Promise<SimctlExecResponse>}
41
- * @throws {Error} If the simctl subcommand command returns non-zero return code, or the given subcommand was invalid.
36
+ *
37
+ * @param command - Subcommand to run with `xcrun simctl`. Must be one of the supported commands.
38
+ * @param args - Arguments for the subcommand. The arguments should be after <device> in the help.
39
+ * @param timeout - The maximum number of milliseconds
40
+ * @returns The execution result with stdout, stderr, and return code
41
+ * @throws If the simctl subcommand command returns non-zero return code, or the given subcommand was invalid.
42
42
  */
43
- async function mobileSimctl(command, args = [], timeout = undefined) {
43
+ async function mobileSimctl(command, args = [], timeout) {
44
44
  if (!this.isSimulator()) {
45
45
  throw new driver_1.errors.UnsupportedOperationError(`Only simulator is supported.`);
46
46
  }
@@ -51,15 +51,11 @@ async function mobileSimctl(command, args = [], timeout = undefined) {
51
51
  throw new driver_1.errors.InvalidArgumentError(`The given command '${command}' is not supported. ` +
52
52
  `Available subcommands are ${SUBCOMMANDS_HAS_DEVICE.join(',')}`);
53
53
  }
54
- return await /** @type {import('appium-ios-simulator').Simulator} */ (this.device).simctl.exec(command, { args: [this.opts.udid, ...args], timeout });
54
+ const result = await this.device.simctl.exec(command, { args: [this.opts.udid, ...args], timeout });
55
+ return {
56
+ stdout: result?.stdout ?? '',
57
+ stderr: result?.stderr ?? '',
58
+ code: result?.code ?? 0
59
+ };
55
60
  }
56
- /**
57
- * @typedef {Object} SimctlExecResponse
58
- * @property {string} stdout The output of standard out.
59
- * @property {string} stderr The output of standard error.
60
- * @property {number} code Return code.
61
- */
62
- /**
63
- * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
64
- */
65
61
  //# sourceMappingURL=simctl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"simctl.js","sourceRoot":"","sources":["../../../lib/commands/simctl.js"],"names":[],"mappings":";;AAyCA,oCAkBC;AA3DD,0CAAuC;AAEvC;;;GAGG;AACH,MAAM,sBAAsB,GAAG;IAC7B,MAAM;IACN,mBAAmB;IACnB,QAAQ;IACR,aAAa;IACb,SAAS;IACT,kBAAkB;IAClB,IAAI;IACJ,UAAU;IACV,QAAQ;IACR,UAAU;IACV,YAAY;IACZ,SAAS;IACT,QAAQ;IACR,SAAS;IACT,SAAS;IACT,MAAM;IACN,UAAU;IACV,OAAO;IACP,YAAY;IACZ,WAAW;IACX,IAAI;IACJ,WAAW;CACZ,CAAC;AAEF;;;;;;;;;GASG;AACI,KAAK,UAAU,YAAY,CAAC,OAAO,EAAE,IAAI,GAAG,EAAE,EAAE,OAAO,GAAG,SAAS;IACxE,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;QACxB,MAAM,IAAI,eAAM,CAAC,yBAAyB,CAAC,8BAA8B,CAAC,CAAC;IAC7E,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,IAAI,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AC;IAC7E,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QACpB,MAAM,IAAI,eAAM,CAAC,oBAAoB,CAAC,sCAAsC,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC;IACjG,CAAC;IAED,IAAI,CAAE,sBAA4C,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QACrE,MAAM,IAAI,eAAM,CAAC,oBAAoB,CAAC,sBAAsB,OAAO,sBAAsB;YACvF,6BAA6B,sBAAsB,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACrE,CAAC;IAED,MAAM,MAAM,GAAG,MAAO,IAAI,CAAC,MAAoB,CAAC,MAAM,CAAC,IAAI,CACzD,OAAgD,EAChD,EAAC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,EAAE,OAAO,EAAC,CAC3C,CAAC;IACF,OAAO;QACL,MAAM,EAAE,MAAM,EAAE,MAAM,IAAI,EAAE;QAC5B,MAAM,EAAE,MAAM,EAAE,MAAM,IAAI,EAAE;QAC5B,IAAI,EAAE,MAAM,EAAE,IAAI,IAAI,CAAC;KACxB,CAAC;AACJ,CAAC"}
@@ -1,16 +1,18 @@
1
+ import type { XCUITestDriver } from '../driver';
2
+ import type { SourceFormat } from './types';
1
3
  /**
2
- * @this {XCUITestDriver}
4
+ * Retrieves the page source of the current application.
5
+ *
6
+ * @returns The page source as XML or HTML string
3
7
  */
4
- export function getPageSource(this: import("../driver").XCUITestDriver): Promise<any>;
8
+ export declare function getPageSource(this: XCUITestDriver): Promise<string>;
5
9
  /**
6
10
  * Retrieve the source tree of the current page in XML or JSON format.
7
11
  *
8
- * @param {import('./types').SourceFormat} format - Page tree source representation format.
9
- * @param {string} [excludedAttributes] A comma-separated string of attribute names to exclude from the output. Only works if `format` is `xml`.
12
+ * @param format - Page tree source representation format.
13
+ * @param excludedAttributes - A comma-separated string of attribute names to exclude from the output. Only works if `format` is `xml`.
10
14
  * @privateRemarks Why isn't `excludedAttributes` an array?
11
- * @returns {Promise<string>} The source tree of the current page in the given format.
12
- * @this {XCUITestDriver}
15
+ * @returns The source tree of the current page in the given format.
13
16
  */
14
- export function mobileGetSource(this: import("../driver").XCUITestDriver, format?: import("./types").SourceFormat, excludedAttributes?: string): Promise<string>;
15
- export type XCUITestDriver = import("../driver").XCUITestDriver;
17
+ export declare function mobileGetSource(this: XCUITestDriver, format?: SourceFormat, excludedAttributes?: string): Promise<string>;
16
18
  //# sourceMappingURL=source.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../lib/commands/source.js"],"names":[],"mappings":"AAKA;;GAEG;AACH,sFAiBC;AAED;;;;;;;;GAQG;AACH,mFANW,OAAO,SAAS,EAAE,YAAY,uBAC9B,MAAM,GAEJ,OAAO,CAAC,MAAM,CAAC,CAe3B;6BAiFY,OAAO,WAAW,EAAE,cAAc"}
1
+ {"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../../lib/commands/source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAI1C;;;;GAIG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAiBzE;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,cAAc,EACpB,MAAM,GAAE,YAAoB,EAC5B,kBAAkB,CAAC,EAAE,MAAM,GAC1B,OAAO,CAAC,MAAM,CAAC,CAYjB"}
@@ -9,7 +9,9 @@ const lodash_1 = __importDefault(require("lodash"));
9
9
  const js2xmlparser2_1 = __importDefault(require("js2xmlparser2"));
10
10
  const APPIUM_AUT_TAG = 'AppiumAUT';
11
11
  /**
12
- * @this {XCUITestDriver}
12
+ * Retrieves the page source of the current application.
13
+ *
14
+ * @returns The page source as XML or HTML string
13
15
  */
14
16
  async function getPageSource() {
15
17
  if (this.isWebContext()) {
@@ -27,11 +29,10 @@ async function getPageSource() {
27
29
  /**
28
30
  * Retrieve the source tree of the current page in XML or JSON format.
29
31
  *
30
- * @param {import('./types').SourceFormat} format - Page tree source representation format.
31
- * @param {string} [excludedAttributes] A comma-separated string of attribute names to exclude from the output. Only works if `format` is `xml`.
32
+ * @param format - Page tree source representation format.
33
+ * @param excludedAttributes - A comma-separated string of attribute names to exclude from the output. Only works if `format` is `xml`.
32
34
  * @privateRemarks Why isn't `excludedAttributes` an array?
33
- * @returns {Promise<string>} The source tree of the current page in the given format.
34
- * @this {XCUITestDriver}
35
+ * @returns The source tree of the current page in the given format.
35
36
  */
36
37
  async function mobileGetSource(format = 'xml', excludedAttributes) {
37
38
  const paramsMap = {
@@ -44,7 +45,7 @@ async function mobileGetSource(format = 'xml', excludedAttributes) {
44
45
  const query = Object.entries(paramsMap)
45
46
  .map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`)
46
47
  .join('&');
47
- return /** @type {string} */ (await this.proxyCommand(`/source?${query}`, 'GET'));
48
+ return await this.proxyCommand(`/source?${query}`, 'GET');
48
49
  }
49
50
  /**
50
51
  * Will get JSON of the form:
@@ -76,13 +77,12 @@ async function mobileGetSource(format = 'xml', excludedAttributes) {
76
77
  */
77
78
  function getTreeForXML(srcTree) {
78
79
  function getTree(element, elementIndex, parentPath) {
79
- let curPath = `${parentPath}/${elementIndex}`;
80
- let rect = element.rect || {};
80
+ const curPath = `${parentPath}/${elementIndex}`;
81
+ const rect = element.rect || {};
81
82
  /**
82
83
  * @privateRemarks I don't even want to try to type this right now
83
- * @type {any}
84
84
  */
85
- let subtree = {
85
+ const subtree = {
86
86
  '@': {
87
87
  type: `XCUIElementType${element.type}`,
88
88
  enabled: parseInt(element.isEnabled, 10) === 1,
@@ -112,7 +112,7 @@ function getTreeForXML(srcTree) {
112
112
  [`XCUIElementType${element.type}`]: subtree,
113
113
  };
114
114
  }
115
- let tree = getTree(srcTree, 0, '');
115
+ const tree = getTree(srcTree, 0, '');
116
116
  return tree;
117
117
  }
118
118
  function getSourceXml(jsonSource) {
@@ -122,7 +122,4 @@ function getSourceXml(jsonSource) {
122
122
  prettyPrinting: { indentString: ' ' },
123
123
  });
124
124
  }
125
- /**
126
- * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
127
- */
128
125
  //# sourceMappingURL=source.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"source.js","sourceRoot":"","sources":["../../../lib/commands/source.js"],"names":[],"mappings":";;;;;AAQA,sCAiBC;AAWD,0CAYC;AAhDD,oDAAuB;AACvB,kEAAmC;AAEnC,MAAM,cAAc,GAAG,WAAW,CAAC;AAEnC;;GAEG;AACI,KAAK,UAAU,aAAa;IACjC,IAAI,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;QACxB,MAAM,MAAM,GAAG,2CAA2C,CAAC;QAC3D,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,EACJ,4BAA4B,EAAE,kBAAkB,EAChD,aAAa,EACd,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC;IACtC,MAAM,qBAAqB,GAAG,gBAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC,IAAI,CAAC,gBAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC/F,IAAI,aAAa,EAAE,CAAC;QAClB,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QAC3G,OAAO,YAAY,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED,OAAO,MAAM,IAA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C,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,YAAY,CAAC,UAAe;IACnC,OAAO,IAAA,uBAAM,EAAC,WAAW,EAAE,UAAU,EAAE;QACrC,SAAS,EAAE,EAAC,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAC;QACnD,WAAW,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC;QAC5B,cAAc,EAAE,EAAC,YAAY,EAAE,IAAI,EAAC;KACrC,CAAC,CAAC;AACL,CAAC"}
@@ -1,53 +1,46 @@
1
+ import type { XCUITestDriver } from '../driver';
1
2
  /**
2
- * @this {XCUITestDriver}
3
+ * Sets the page load timeout using W3C protocol.
4
+ *
5
+ * @param ms - Timeout in milliseconds
3
6
  */
4
- export function pageLoadTimeoutW3C(this: import("../driver").XCUITestDriver, ms: any): Promise<void>;
7
+ export declare function pageLoadTimeoutW3C(this: XCUITestDriver, ms: number): Promise<void>;
5
8
  /**
6
- * @this {XCUITestDriver}
9
+ * Sets the page load timeout using MJSONWP protocol.
10
+ *
11
+ * @param ms - Timeout in milliseconds
7
12
  */
8
- export function pageLoadTimeoutMJSONWP(this: import("../driver").XCUITestDriver, ms: any): Promise<void>;
13
+ export declare function pageLoadTimeoutMJSONWP(this: XCUITestDriver, ms: number): Promise<void>;
9
14
  /**
10
- * @this {XCUITestDriver}
15
+ * Sets the async script timeout using W3C protocol.
16
+ *
17
+ * @param ms - Timeout in milliseconds
11
18
  */
12
- export function scriptTimeoutW3C(this: import("../driver").XCUITestDriver, ms: any): Promise<void>;
19
+ export declare function scriptTimeoutW3C(this: XCUITestDriver, ms: number): Promise<void>;
13
20
  /**
14
21
  * Alias for {@linkcode XCUITestDriver.scriptTimeoutW3C}.
15
22
  *
16
- * @param {number} ms - the timeout
17
- * @this {XCUITestDriver}
23
+ * @param ms - The timeout in milliseconds
18
24
  * @deprecated Use {@linkcode XCUITestDriver.scriptTimeoutW3C} instead
19
25
  */
20
- export function scriptTimeoutMJSONWP(this: import("../driver").XCUITestDriver, ms: number): Promise<void>;
26
+ export declare function scriptTimeoutMJSONWP(this: XCUITestDriver, ms: number): Promise<void>;
21
27
  /**
22
28
  * Alias for {@linkcode XCUITestDriver.scriptTimeoutW3C}.
23
29
  *
24
- * @param {number} ms - the timeout
25
- *
30
+ * @param ms - The timeout in milliseconds
26
31
  * @deprecated Use {@linkcode XCUITestDriver.scriptTimeoutW3C} instead
27
- * @this {XCUITestDriver}
28
32
  */
29
- export function asyncScriptTimeout(this: import("../driver").XCUITestDriver, ms: number): Promise<void>;
33
+ export declare function asyncScriptTimeout(this: XCUITestDriver, ms: number): Promise<void>;
30
34
  /**
31
- * @this {XCUITestDriver}
35
+ * Sets the page load timeout.
36
+ *
37
+ * @param ms - Timeout in milliseconds
32
38
  */
33
- export function setPageLoadTimeout(this: import("../driver").XCUITestDriver, ms: any): void;
34
- export class setPageLoadTimeout {
35
- /**
36
- * @this {XCUITestDriver}
37
- */
38
- constructor(this: import("../driver").XCUITestDriver, ms: any);
39
- pageLoadMs: any;
40
- }
39
+ export declare function setPageLoadTimeout(this: XCUITestDriver, ms: number): void;
41
40
  /**
42
- * @this {XCUITestDriver}
41
+ * Sets the async script timeout.
42
+ *
43
+ * @param ms - Timeout in milliseconds
43
44
  */
44
- export function setAsyncScriptTimeout(this: import("../driver").XCUITestDriver, ms: any): void;
45
- export class setAsyncScriptTimeout {
46
- /**
47
- * @this {XCUITestDriver}
48
- */
49
- constructor(this: import("../driver").XCUITestDriver, ms: any);
50
- asyncWaitMs: any;
51
- }
52
- export type XCUITestDriver = import("../driver").XCUITestDriver;
45
+ export declare function setAsyncScriptTimeout(this: XCUITestDriver, ms: number): void;
53
46
  //# sourceMappingURL=timeouts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"timeouts.d.ts","sourceRoot":"","sources":["../../../lib/commands/timeouts.js"],"names":[],"mappings":"AAAA;;GAEG;AACH,qGAEC;AAED;;GAEG;AACH,yGAEC;AAED;;GAEG;AACH,mGAGC;AAED;;;;;;GAMG;AACH,mFAJW,MAAM,iBAMhB;AAED;;;;;;;GAOG;AACH,iFALW,MAAM,iBAOhB;AAED;;GAEG;AACH,4FAOC;;IAVD;;OAEG;IACH,+DAOC;IALC,gBAAoB;;AAOtB;;GAEG;AACH,+FAGC;;IAND;;OAEG;IACH,+DAGC;IAFC,iBAAqB;;6BAKV,OAAO,WAAW,EAAE,cAAc"}
1
+ {"version":3,"file":"timeouts.d.ts","sourceRoot":"","sources":["../../../lib/commands/timeouts.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAE9C;;;;GAIG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC,CAGf;AAED;;;;;GAKG;AACH,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,MAAM,GACT,IAAI,CAON;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,cAAc,EACpB,EAAE,EAAE,MAAM,GACT,IAAI,CAGN"}
@@ -8,19 +8,25 @@ exports.asyncScriptTimeout = asyncScriptTimeout;
8
8
  exports.setPageLoadTimeout = setPageLoadTimeout;
9
9
  exports.setAsyncScriptTimeout = setAsyncScriptTimeout;
10
10
  /**
11
- * @this {XCUITestDriver}
11
+ * Sets the page load timeout using W3C protocol.
12
+ *
13
+ * @param ms - Timeout in milliseconds
12
14
  */
13
15
  async function pageLoadTimeoutW3C(ms) {
14
16
  await this.setPageLoadTimeout(this.parseTimeoutArgument(ms));
15
17
  }
16
18
  /**
17
- * @this {XCUITestDriver}
19
+ * Sets the page load timeout using MJSONWP protocol.
20
+ *
21
+ * @param ms - Timeout in milliseconds
18
22
  */
19
23
  async function pageLoadTimeoutMJSONWP(ms) {
20
24
  await this.setPageLoadTimeout(this.parseTimeoutArgument(ms));
21
25
  }
22
26
  /**
23
- * @this {XCUITestDriver}
27
+ * Sets the async script timeout using W3C protocol.
28
+ *
29
+ * @param ms - Timeout in milliseconds
24
30
  */
25
31
  async function scriptTimeoutW3C(ms) {
26
32
  // XXX: this is synchronous
@@ -29,8 +35,7 @@ async function scriptTimeoutW3C(ms) {
29
35
  /**
30
36
  * Alias for {@linkcode XCUITestDriver.scriptTimeoutW3C}.
31
37
  *
32
- * @param {number} ms - the timeout
33
- * @this {XCUITestDriver}
38
+ * @param ms - The timeout in milliseconds
34
39
  * @deprecated Use {@linkcode XCUITestDriver.scriptTimeoutW3C} instead
35
40
  */
36
41
  async function scriptTimeoutMJSONWP(ms) {
@@ -39,33 +44,32 @@ async function scriptTimeoutMJSONWP(ms) {
39
44
  /**
40
45
  * Alias for {@linkcode XCUITestDriver.scriptTimeoutW3C}.
41
46
  *
42
- * @param {number} ms - the timeout
43
- *
47
+ * @param ms - The timeout in milliseconds
44
48
  * @deprecated Use {@linkcode XCUITestDriver.scriptTimeoutW3C} instead
45
- * @this {XCUITestDriver}
46
49
  */
47
50
  async function asyncScriptTimeout(ms) {
48
51
  await this.scriptTimeoutW3C(ms);
49
52
  }
50
53
  /**
51
- * @this {XCUITestDriver}
54
+ * Sets the page load timeout.
55
+ *
56
+ * @param ms - Timeout in milliseconds
52
57
  */
53
58
  function setPageLoadTimeout(ms) {
54
- ms = parseInt(ms, 10);
59
+ ms = parseInt(String(ms), 10);
55
60
  this.pageLoadMs = ms;
56
- if (this.remote) {
61
+ if (this._remote) {
57
62
  this.remote.pageLoadMs = ms;
58
63
  }
59
64
  this.log.debug(`Set page load timeout to ${ms}ms`);
60
65
  }
61
66
  /**
62
- * @this {XCUITestDriver}
67
+ * Sets the async script timeout.
68
+ *
69
+ * @param ms - Timeout in milliseconds
63
70
  */
64
71
  function setAsyncScriptTimeout(ms) {
65
72
  this.asyncWaitMs = ms;
66
73
  this.log.debug(`Set async script timeout to ${ms}ms`);
67
74
  }
68
- /**
69
- * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
70
- */
71
75
  //# sourceMappingURL=timeouts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"timeouts.js","sourceRoot":"","sources":["../../../lib/commands/timeouts.js"],"names":[],"mappings":";;AAGA,gDAEC;AAKD,wDAEC;AAKD,4CAGC;AASD,oDAEC;AAUD,gDAEC;AAKD,gDAOC;AAKD,sDAGC;AA/DD;;GAEG;AACI,KAAK,UAAU,kBAAkB,CAAC,EAAE;IACzC,MAAM,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,sBAAsB,CAAC,EAAE;IAC7C,MAAM,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,gBAAgB,CAAC,EAAE;IACvC,2BAA2B;IAC3B,MAAM,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAC;AAClE,CAAC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,oBAAoB,CAAC,EAAE;IAC3C,MA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AgB,CAEpC,EAAU;IAEV,2BAA2B;IAC3B,MAAM,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAC;AAClE,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,oBAAoB,CAExC,EAAU;IAEV,MAAM,IAAI,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAC;AACpC,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,kBAAkB,CAEtC,EAAU;IAEV,MAAM,IAAI,CAAC,gBAAgB,CAAC,EAAE,CAAC,CAAC;AAClC,CAAC;AAED;;;;GAIG;AACH,SAAgB,kBAAkB,CAEhC,EAAU;IAEV,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAC9B,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;IACrB,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;QACjB,IAAI,CAAC,MAAM,CAAC,UAAU,GAAG,EAAE,CAAC;IAC9B,CAAC;IACD,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,4BAA4B,EAAE,IAAI,CAAC,CAAC;AACrD,CAAC;AAED;;;;GAIG;AACH,SAAgB,qBAAqB,CAEnC,EAAU;IAEV,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;IACtB,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,+BAA+B,EAAE,IAAI,CAAC,CAAC;AACxD,CAAC"}
@@ -303,6 +303,28 @@ export interface ProcessArguments {
303
303
  env: StringRecord<string>;
304
304
  args: string[];
305
305
  }
306
+ /**
307
+ * Accessibility audit item returned by the audit command.
308
+ */
309
+ export interface AccessibilityAuditItem {
310
+ /**
311
+ * The detailed description of the found accessibility issue.
312
+ */
313
+ detailedDescription: string;
314
+ /**
315
+ * The compact description of the found accessibility issue.
316
+ */
317
+ compactDescription: string;
318
+ /**
319
+ * The name of the audit type this issue belongs to. Could be
320
+ * a number if the type name is unknown.
321
+ */
322
+ auditType: string | number;
323
+ /**
324
+ * The description of the element this issue was found for.
325
+ */
326
+ element: string;
327
+ }
306
328
  /**
307
329
  * Pressable button names; used by the {@linkcode XCUITest.mobilePressButton mobile: pressButton} command.
308
330
  */
@@ -536,4 +558,62 @@ export interface LogEntry {
536
558
  message: string;
537
559
  }
538
560
  export type LogListener = (logEntry: LogEntry) => any;
561
+ /**
562
+ * Condition inducer profile configuration
563
+ */
564
+ export interface Profile {
565
+ name: string;
566
+ /** The property is profileID used in {@linkcode XCUITestDriver.enableConditionInducer} */
567
+ identifier: string;
568
+ /** Configuration details */
569
+ description: string;
570
+ }
571
+ /**
572
+ * We can use the returned data to determine whether the Condition is enabled and the currently enabled configuration information
573
+ */
574
+ export interface Condition {
575
+ profiles: Profile[];
576
+ /** The property is conditionID used in {@linkcode XCUITestDriver.enableConditionInducer} */
577
+ identifier: string;
578
+ profilesSorted: boolean;
579
+ isDestructive: boolean;
580
+ isInternal: boolean;
581
+ /** `true` if this condition identifier is enabled */
582
+ isActive: boolean;
583
+ /** Enabled profiles identifier */
584
+ activeProfile: string;
585
+ }
586
+ /**
587
+ * Information about an XCTest screen recording session
588
+ */
589
+ export interface XcTestScreenRecordingInfo {
590
+ /** Unique identifier of the video being recorded */
591
+ uuid: string;
592
+ /** FPS value */
593
+ fps: number;
594
+ /** Video codec, where 0 is h264 */
595
+ codec: number;
596
+ /** The timestamp when the screen recording has started in float Unix seconds */
597
+ startedAt: number;
598
+ }
599
+ /**
600
+ * XCTest screen recording result with payload
601
+ */
602
+ export interface XcTestScreenRecording extends XcTestScreenRecordingInfo {
603
+ /**
604
+ * Base64-encoded content of the recorded media file if `remotePath` parameter is empty or null or an empty string otherwise.
605
+ * The media is expected to a be a valid QuickTime movie (.mov).
606
+ */
607
+ payload: string;
608
+ }
609
+ /**
610
+ * Options for AudioRecorder
611
+ */
612
+ export interface AudioRecorderOptions {
613
+ audioSource: string;
614
+ audioCodec: string;
615
+ audioBitrate: string;
616
+ audioChannels: number;
617
+ audioRate: number;
618
+ }
539
619
  //# sourceMappingURL=types.d.ts.map