@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
@@ -30,14 +30,12 @@ const app_utils_1 = require("../app-utils");
30
30
  * Installs the given application to the device under test.
31
31
  *
32
32
  * Please ensure the app is built for a correct architecture and is signed with a proper developer signature (for real devices) prior to calling this.
33
- * @param {string} app - See docs for `appium:app` capability
34
- * @param {number} [timeoutMs] - The maximum time to wait until app install is finished (in ms) on real devices.
33
+ * @param app - See docs for `appium:app` capability
34
+ * @param timeoutMs - The maximum time to wait until app install is finished (in ms) on real devices.
35
35
  * If not provided, then the value of `appium:appPushTimeout` capability is used. If the capability is not provided then the default is 240000ms (4 minutes).
36
- * @param {boolean} [checkVersion] - If the application installation follows currently installed application's version status if provided.
36
+ * @param checkVersion - If the application installation follows currently installed application's version status if provided.
37
37
  * No checking occurs if no this option.
38
38
  * @privateRemarks Link to capability docs
39
- * @returns {Promise<void>}
40
- * @this {XCUITestDriver}
41
39
  */
42
40
  async function mobileInstallApp(app, timeoutMs, checkVersion) {
43
41
  const srcAppPath = await this.helpers.configureApp(app, {
@@ -65,7 +63,7 @@ async function mobileInstallApp(app, timeoutMs, checkVersion) {
65
63
  }
66
64
  }
67
65
  await this.device.installApp(srcAppPath, bundleId, {
68
- timeoutMs: timeoutMs ?? this.opts.appPushTimeout
66
+ timeoutMs: timeoutMs ?? this.opts.appPushTimeout,
69
67
  });
70
68
  this.log.info(`Installation of '${srcAppPath}' succeeded`);
71
69
  }
@@ -73,9 +71,8 @@ async function mobileInstallApp(app, timeoutMs, checkVersion) {
73
71
  * Checks whether the given application is installed on the device under test.
74
72
  * Offload app is handled as not installed.
75
73
  *
76
- * @param {string} bundleId - The bundle identifier of the application to be checked
77
- * @returns {Promise<boolean>} `true` if the application is installed; `false` otherwise
78
- * @this {XCUITestDriver}
74
+ * @param bundleId - The bundle identifier of the application to be checked
75
+ * @returns `true` if the application is installed; `false` otherwise
79
76
  */
80
77
  async function mobileIsAppInstalled(bundleId) {
81
78
  const installed = await this.device.isAppInstalled(bundleId);
@@ -86,9 +83,8 @@ async function mobileIsAppInstalled(bundleId) {
86
83
  * Removes/uninstalls the given application from the device under test.
87
84
  * Offload app data could also be removed.
88
85
  *
89
- * @param {string} bundleId - The bundle identifier of the application to be removed
90
- * @returns {Promise<boolean>} `true` if the application has been removed successfully; `false` otherwise
91
- * @this {XCUITestDriver}
86
+ * @param bundleId - The bundle identifier of the application to be removed
87
+ * @returns `true` if the application has been removed successfully; `false` otherwise
92
88
  */
93
89
  async function mobileRemoveApp(bundleId) {
94
90
  this.log.info(`Uninstalling the application with bundle identifier '${bundleId}' ` +
@@ -107,14 +103,11 @@ async function mobileRemoveApp(bundleId) {
107
103
  * Executes the given app on the device under test.
108
104
  *
109
105
  * If the app is already running it will be activated. If the app is not installed or cannot be launched then an exception is thrown.
110
- * @param {string} bundleId - The bundle identifier of the application to be launched
111
- * @param {string|string[]} [args] - One or more command line arguments for the app. If the app is already running then this argument is ignored.
112
- * @param {object} [environment] - Environment variables mapping for the app. If the app is already running then this argument is ignored.
113
- * @returns {Promise<void>}
114
- * @this {XCUITestDriver}
106
+ * @param bundleId - The bundle identifier of the application to be launched
107
+ * @param args - One or more command line arguments for the app. If the app is already running then this argument is ignored.
108
+ * @param environment - Environment variables mapping for the app. If the app is already running then this argument is ignored.
115
109
  */
116
110
  async function mobileLaunchApp(bundleId, args, environment) {
117
- /** @type { {arguments?: any[], environment?: any, bundleId: string} } */
118
111
  const launchOptions = { bundleId };
119
112
  if (args) {
120
113
  launchOptions.arguments = Array.isArray(args) ? args : [args];
@@ -128,21 +121,18 @@ async function mobileLaunchApp(bundleId, args, environment) {
128
121
  * Terminates the given app on the device under test.
129
122
  *
130
123
  * This command performs termination via [XCTest's `terminate`](https://developer.apple.com/documentation/xctest/xcuiapplication/1500637-terminate) API. If the app is not installed an exception is thrown. If the app is not running then nothing is done.
131
- * @param {string} bundleId - The bundle identifier of the application to be terminated
132
- * @returns {Promise<boolean>} `true` if the app has been terminated successfully; `false` otherwise
133
- * @this {XCUITestDriver}
124
+ * @param bundleId - The bundle identifier of the application to be terminated
125
+ * @returns `true` if the app has been terminated successfully; `false` otherwise
134
126
  */
135
127
  async function mobileTerminateApp(bundleId) {
136
- return /** @type {boolean} */ (await this.proxyCommand('/wda/apps/terminate', 'POST', { bundleId }));
128
+ return (await this.proxyCommand('/wda/apps/terminate', 'POST', { bundleId }));
137
129
  }
138
130
  /**
139
131
  * Activate the given app on the device under test.
140
132
  *
141
133
  * This pushes the app to the foreground if it is running in the background. An exception is thrown if the app is not install or isn't running. Nothing is done if the app is already in the foreground.
142
134
  *
143
- * @param {string} bundleId - The bundle identifier of the application to be activated
144
- * @returns {Promise<void>}
145
- * @this {XCUITestDriver}
135
+ * @param bundleId - The bundle identifier of the application to be activated
146
136
  */
147
137
  async function mobileActivateApp(bundleId) {
148
138
  await this.proxyCommand('/wda/apps/activate', 'POST', { bundleId });
@@ -155,67 +145,91 @@ async function mobileActivateApp(bundleId) {
155
145
  * @remarks `appium-xcuitest-driver` v4.4 does not require `py-ios-device` to be installed.
156
146
  * @privateRemarks See implementation at https://github.com/YueChen-C/py-ios-device/blob/51f4683c5c3c385a015858ada07a5f1c62d3cf57/ios_device/cli/base.py#L220
157
147
  * @see https://github.com/YueChen-C/py-ios-device
158
- * @param {string} bundleId - The bundle identifier of the application to be killed
159
- * @returns {Promise<boolean>} `true` if the app has been killed successfully; `false` otherwise
148
+ * @param bundleId - The bundle identifier of the application to be killed
149
+ * @returns `true` if the app has been killed successfully; `false` otherwise
160
150
  * @group Real Device Only
161
- * @this {XCUITestDriver}
162
151
  */
163
152
  async function mobileKillApp(bundleId) {
164
153
  if (!this.isRealDevice()) {
165
154
  throw new driver_1.errors.UnsupportedOperationError('A real device is required');
166
155
  }
167
- return await /** @type {import('../device/real-device-management').RealDevice} */ (this.device).terminateApp(bundleId, String(this.opts.platformVersion));
156
+ return await this.device.terminateApp(bundleId, String(this.opts.platformVersion));
168
157
  }
169
158
  /**
170
159
  * Queries the state of an installed application from the device under test.
171
160
  *
172
161
  * If the app with the given `bundleId` is not installed, an exception will be thrown.
173
162
  *
174
- * @param {string} bundleId - The bundle identifier of the application to be queried
175
- * @returns {Promise<AppState>} The actual application state code
163
+ * @param bundleId - The bundle identifier of the application to be queried
164
+ * @returns The actual application state code
176
165
  * @see https://developer.apple.com/documentation/xctest/xcuiapplicationstate?language=objc
177
- * @this {XCUITestDriver}
178
166
  */
179
167
  async function mobileQueryAppState(bundleId) {
180
- return /** @type {AppState} */ (await this.proxyCommand('/wda/apps/state', 'POST', { bundleId }));
168
+ return (await this.proxyCommand('/wda/apps/state', 'POST', { bundleId }));
181
169
  }
182
170
  /**
183
- * @param {string} appPath
184
- * @param {object} opts
185
- * @this {XCUITestDriver}
171
+ * Installs the given application to the device under test.
172
+ *
173
+ * This is a wrapper around {@linkcode mobileInstallApp mobile: installApp}.
174
+ *
175
+ * @param appPath - Path to the application bundle or .ipa/.app file
176
+ * @param opts - Installation options
177
+ * @param opts.timeoutMs - Maximum time to wait for installation to complete (in milliseconds)
178
+ * @param opts.strategy - If `true`, checks the version before installing and skips if already installed
186
179
  */
187
- async function installApp(appPath, { timeoutMs, strategy } = {}) {
188
- // @ts-ignore Probably a TS bug
189
- await this.mobileInstallApp(appPath, timeoutMs, strategy);
180
+ async function installApp(appPath, opts = {}) {
181
+ await this.mobileInstallApp(appPath, opts.timeoutMs, opts.strategy);
190
182
  }
191
183
  /**
192
- * @param {string} bundleId
193
- * @param {object} opts
194
- * @this {XCUITestDriver}
184
+ * Activates the given app on the device under test.
185
+ *
186
+ * This is a wrapper around {@linkcode mobileLaunchApp mobile: launchApp}. If the app is already
187
+ * running, it will be activated (brought to foreground). If the app is not installed or cannot
188
+ * be launched, an exception is thrown.
189
+ *
190
+ * @param bundleId - The bundle identifier of the application to be activated
191
+ * @param opts - Launch options
192
+ * @param opts.environment - Environment variables mapping for the app
193
+ * @param opts.arguments - Command line arguments for the app
195
194
  */
196
195
  async function activateApp(bundleId, opts = {}) {
197
196
  const { environment, arguments: args } = opts;
198
- // @ts-ignore Probably a TS bug
199
197
  return await this.mobileLaunchApp(bundleId, args, environment);
200
198
  }
201
199
  /**
202
- * @param {string} bundleId
203
- * @this {XCUITestDriver}
200
+ * Checks whether the given application is installed on the device under test.
201
+ *
202
+ * This is a wrapper around {@linkcode mobileIsAppInstalled mobile: isAppInstalled}.
203
+ * Offload apps are treated as not installed.
204
+ *
205
+ * @param bundleId - The bundle identifier of the application to be checked
206
+ * @returns `true` if the application is installed; `false` otherwise
204
207
  */
205
208
  async function isAppInstalled(bundleId) {
206
209
  return await this.mobileIsAppInstalled(bundleId);
207
210
  }
208
211
  /**
209
- * @param {string} bundleId
210
- * @this {XCUITestDriver}
211
- * @returns {Promise<boolean>}
212
+ * Terminates the given app on the device under test.
213
+ *
214
+ * This is a wrapper around {@linkcode mobileTerminateApp mobile: terminateApp}.
215
+ * The command performs termination via XCTest's `terminate` API. If the app is not installed,
216
+ * an exception is thrown. If the app is not running, nothing is done.
217
+ *
218
+ * @param bundleId - The bundle identifier of the application to be terminated
219
+ * @returns `true` if the app has been terminated successfully; `false` otherwise
212
220
  */
213
221
  async function terminateApp(bundleId) {
214
222
  return await this.mobileTerminateApp(bundleId);
215
223
  }
216
224
  /**
217
- * @param {string} bundleId
218
- * @this {XCUITestDriver}
225
+ * Queries the state of an installed application from the device under test.
226
+ *
227
+ * This is a wrapper around {@linkcode mobileQueryAppState mobile: queryAppState}.
228
+ * If the app with the given `bundleId` is not installed, an exception will be thrown.
229
+ *
230
+ * @param bundleId - The bundle identifier of the application to be queried
231
+ * @returns The actual application state code
232
+ * @see https://developer.apple.com/documentation/xctest/xcuiapplicationstate?language=objc
219
233
  */
220
234
  async function queryAppState(bundleId) {
221
235
  return await this.mobileQueryAppState(bundleId);
@@ -224,8 +238,8 @@ async function queryAppState(bundleId) {
224
238
  * List applications installed on the real device under test
225
239
  *
226
240
  * Read [Pushing/Pulling files](https://appium.io/docs/en/writing-running-appium/ios/ios-xctest-file-movement/) for more details.
227
- * @param {'User'|'System'} applicationType - The type of applications to list.
228
- * @returns {Promise<Record<string,any>[]>} A list of apps where each item is a mapping of bundle identifiers to maps of platform-specific app properties.
241
+ * @param applicationType - The type of applications to list.
242
+ * @returns A list of apps where each item is a mapping of bundle identifiers to maps of platform-specific app properties.
229
243
  * @remarks Having `UIFileSharingEnabled` set to `true` in the return app properties map means this app supports file upload/download in its `documents` container.
230
244
  * @group Real Device Only
231
245
  */
@@ -246,9 +260,8 @@ async function mobileListApps(applicationType = 'User') {
246
260
  * it is launched.
247
261
  * This API only works on a Simulator.
248
262
  *
249
- * @param {string} bundleId Application bundle identifier
250
- * @this {XCUITestDriver}
251
- * @returns {Promise<boolean>} true if any files from the app's data container have been deleted
263
+ * @param bundleId Application bundle identifier
264
+ * @returns true if any files from the app's data container have been deleted
252
265
  */
253
266
  async function mobileClearApp(bundleId) {
254
267
  if (this.isRealDevice()) {
@@ -256,10 +269,10 @@ async function mobileClearApp(bundleId) {
256
269
  `The only known way to clear app data on real devices ` +
257
270
  `would be to uninstall the app then perform a fresh install of it.`);
258
271
  }
259
- const simctl = /** @type {import('appium-ios-simulator').Simulator} */ (this.device).simctl;
272
+ const simctl = this.device.simctl;
260
273
  const dataRoot = await simctl.getAppContainer(bundleId, 'data');
261
274
  this.log.debug(`Got the data container root of ${bundleId} at '${dataRoot}'`);
262
- if (!await support_1.fs.exists(dataRoot)) {
275
+ if (!(await support_1.fs.exists(dataRoot))) {
263
276
  return false;
264
277
  }
265
278
  await this.mobileTerminateApp(bundleId);
@@ -272,16 +285,17 @@ async function mobileClearApp(bundleId) {
272
285
  return true;
273
286
  }
274
287
  /**
275
- * Close app (simulate device home button). It is possible to restore
276
- * the app after the timeout or keep it minimized based on the parameter value.
288
+ * Closes the app (simulates device home button press).
289
+ *
290
+ * It is possible to restore the app after a timeout or keep it minimized based on the parameter value.
277
291
  *
278
- * @param {number|{timeout: number?}} [seconds]
279
- * - any positive number of seconds: come back after X seconds
280
- * - any negative number of seconds or zero: never come back
281
- * - undefined/null: never come back
282
- * - {timeout: 5000}: come back after 5 seconds
283
- * - {timeout: null}, {timeout: -2}: never come back
284
- * @this {XCUITestDriver}
292
+ * @param seconds - Timeout configuration. Accepts:
293
+ * - A positive number (seconds): app will be restored after the specified number of seconds
294
+ * - A negative number or zero: app will not be restored (kept minimized)
295
+ * - `undefined` or `null`: app will not be restored (kept minimized)
296
+ * - An object with `timeout` property:
297
+ * - `{timeout: 5000}`: app will be restored after 5 seconds (timeout in milliseconds)
298
+ * - `{timeout: null}` or `{timeout: -2}`: app will not be restored
285
299
  */
286
300
  async function background(seconds) {
287
301
  const homescreen = '/wda/homescreen';
@@ -292,8 +306,8 @@ async function background(seconds) {
292
306
  if (!support_1.util.hasValue(timeoutSeconds)) {
293
307
  endpoint = homescreen;
294
308
  }
295
- else if (!isNaN(timeoutSeconds)) {
296
- const duration = parseFloat(timeoutSeconds);
309
+ else if (!isNaN(Number(timeoutSeconds))) {
310
+ const duration = parseFloat(String(timeoutSeconds));
297
311
  if (duration >= 0) {
298
312
  params = { duration };
299
313
  endpoint = deactivateApp;
@@ -308,7 +322,7 @@ async function background(seconds) {
308
322
  selectEndpoint(isNaN(Number(timeout)) ? timeout : parseFloat(String(timeout)) / 1000.0);
309
323
  }
310
324
  else {
311
- selectEndpoint(seconds);
325
+ selectEndpoint(lodash_1.default.isNumber(seconds) ? seconds : undefined);
312
326
  }
313
327
  if (!endpoint) {
314
328
  throw new driver_1.errors.InvalidArgumentError(`Argument value is expected to be a valid number. ` +
@@ -316,8 +330,4 @@ async function background(seconds) {
316
330
  }
317
331
  return await this.proxyCommand(endpoint, 'POST', params, endpoint !== homescreen);
318
332
  }
319
- /**
320
- * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
321
- * @typedef {import('./enum').AppState} AppState
322
- */
323
333
  //# sourceMappingURL=app-management.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-management.js","sourceRoot":"","sources":["../../../lib/commands/app-management.js"],"names":[],"mappings":";;;;;AAyBA,4CAwCC;AAUD,oDAIC;AAUD,0CAaC;AAYD,0CAUC;AAUD,gDAIC;AAWD,8CAEC;AAeD,sCAQC;AAYD,kDAEC;AAOD,gCAGC;AAOD,kCAIC;AAMD,wCAEC;AAOD,oCAEC;AAMD,sCAEC;AAWD,wCAWC;AAWD,wCA2BC;AAcD,gCAgCC;AApVD,oDAAuB;AACvB,4CAAwC;AACxC,0CAAqC;AACrC,yDAA2C;AAC3C,0DAA6B;AAC7B,wDAAyB;AACzB,4CAIsB;AAEtB;;;;;;;;;;;;GAYG;AACI,KAAK,UAAU,gBAAgB,CAAC,GAAG,EAAE,SAAS,EAAE,YAAY;IACjE,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,EAAE;QACtD,aAAa,EAAE,8BAAkB,CAAC,IAAI,CAAC,IAAI,CAAC;QAC5C,UAAU,EAAE,yBAAa,CAAC,IAAI,CAAC,IAAI,CAAC;QACpC,mBAAmB,EAAE,gCAAoB;KAC1C,CAAC,CAAC;IACH,IAAI,CAAC,GAAG,CAAC,IAAI,CACX,eAAe,UAAU,YAAY,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,WAAW,GAAG;QACvF,cAAc,IAAI,CAAC,MAAM,CAAC,IAAI,GAAG,CACpC,CAAC;IACF,IAAI,CAAC,CAAC,MAAM,YAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC;QACnC,MA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,CAAC,CAAC,SAAS,CAAC,CAAC;IAC5D,CAAC;IACD,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,eAAM,CAAC,oBAAoB,CACnC,mDAAmD;YACjD,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,4BAA4B,CACzD,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,KAAK,UAAU,CAAC,CAAC;AACpF,CAAC"}
@@ -1,16 +1,15 @@
1
+ import type { XCUITestDriver } from '../driver';
2
+ import type { StringRecord } from '@appium/types';
1
3
  /**
2
4
  * Return the language-specific strings for an app
3
5
  *
4
- * @param {string} language - The language abbreviation to fetch app strings mapping for.
6
+ * @param language - The language abbreviation to fetch app strings mapping for.
5
7
  * If no language is provided then strings for the 'en language would be returned
6
- * @param {string|null} [stringFile=null] - Relative path to the corresponding .strings
8
+ * @param stringFile - Relative path to the corresponding .strings
7
9
  * file starting from the corresponding .lproj folder, e.g., `base/main.strings`. If omitted,
8
10
  * then Appium will make its best guess where the file is.
9
11
  *
10
- * @returns {Promise<import('@appium/types').StringRecord<string>>} A record of localized keys to localized text
11
- *
12
- * @this {XCUITestDriver}
12
+ * @returns A record of localized keys to localized text
13
13
  */
14
- export function getStrings(this: import("../driver").XCUITestDriver, language: string, stringFile?: string | null): Promise<import("@appium/types").StringRecord<string>>;
15
- export type XCUITestDriver = import("../driver").XCUITestDriver;
14
+ export declare function getStrings(this: XCUITestDriver, language: string, stringFile?: string | null): Promise<StringRecord<string>>;
16
15
  //# sourceMappingURL=app-strings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-strings.d.ts","sourceRoot":"","sources":["../../../lib/commands/app-strings.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,+EAVW,MAAM,eAEN,MAAM,GAAC,IAAI,GAIT,OAAO,CAAC,OAAO,eAAe,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,CAcjE;6BAGY,OAAO,WAAW,EAAE,cAAc"}
1
+ {"version":3,"file":"app-strings.d.ts","sourceRoot":"","sources":["../../../lib/commands/app-strings.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAEhD;;;;;;;;;;GAUG;AACH,wBAAsB,UAAU,CAC9B,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,MAAM,EAChB,UAAU,GAAE,MAAM,GAAG,IAAW,GAC/B,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAU/B"}
@@ -5,15 +5,13 @@ const app_utils_1 = require("../app-utils");
5
5
  /**
6
6
  * Return the language-specific strings for an app
7
7
  *
8
- * @param {string} language - The language abbreviation to fetch app strings mapping for.
8
+ * @param language - The language abbreviation to fetch app strings mapping for.
9
9
  * If no language is provided then strings for the 'en language would be returned
10
- * @param {string|null} [stringFile=null] - Relative path to the corresponding .strings
10
+ * @param stringFile - Relative path to the corresponding .strings
11
11
  * file starting from the corresponding .lproj folder, e.g., `base/main.strings`. If omitted,
12
12
  * then Appium will make its best guess where the file is.
13
13
  *
14
- * @returns {Promise<import('@appium/types').StringRecord<string>>} A record of localized keys to localized text
15
- *
16
- * @this {XCUITestDriver}
14
+ * @returns A record of localized keys to localized text
17
15
  */
18
16
  async function getStrings(language, stringFile = null) {
19
17
  this.log.debug(`Gettings strings for language '${language}' and string file '${stringFile}'`);
@@ -24,7 +22,4 @@ async function getStrings(language, stringFile = null) {
24
22
  strictMode: true,
25
23
  });
26
24
  }
27
- /**
28
- * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
29
- */
30
25
  //# sourceMappingURL=app-strings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-strings.js","sourceRoot":"","sources":["../../../lib/commands/app-strings.js"],"names":[],"mappings":";;AAeA,gCAUC;AAzBD,4CAAqD;AAErD;;;;;;;;;;;;GAYG;AACI,KAAK,UAAU,UAAU,CAAC,QAAQ,EAAE,UAAU,GAAG,IAAI;IAC1D,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,kCAAkC,QAAQ,sBAAsB,UAAU,GAAG,CAAC,CAAC;IAC9F,OAAO,MAAM,mCAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,CAC7C;QACE,GAAG,IAAI,CAAC,IAAI;QACZ,QAAQ;QACR,UAAU;QACV,UAAU,EAAE,IAAI;KACjB,CACF,CAAC;AACJ,CAAC;AAED;;GAEG"}
1
+ {"version":3,"file":"app-strings.js","sourceRoot":"","sources":["../../../lib/commands/app-strings.ts"],"names":[],"mappings":";;AAeA,gCAcC;AA7BD,4CAAqD;AAIrD;;;;;;;;;;GAUG;AACI,KAAK,UAAU,UAAU,CAE9B,QAAgB,EAChB,aAA4B,IAAI;IAEhC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,kCAAkC,QAAQ,sBAAsB,UAAU,GAAG,CAAC,CAAC;IAC9F,OAAO,MAAM,mCAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,CAC7C;QACE,GAAG,IAAI,CAAC,IAAI;QACZ,QAAQ;QACR,UAAU;QACV,UAAU,EAAE,IAAI;KACjB,CACF,CAAC;AACJ,CAAC"}
@@ -1,22 +1,20 @@
1
+ import type { XCUITestDriver } from '../driver';
2
+ import type { Style } from './types';
1
3
  /**
2
4
  * Set the device's UI appearance style
3
5
  *
4
6
  * @since iOS 12.0
5
- * @param {'dark'|'light'} style - The appearance style to set
6
- * @throws {Error} if the current platform does not support UI appearance changes
7
- * @this {XCUITestDriver}
7
+ * @param style - The appearance style to set
8
+ * @throws If the current platform does not support UI appearance changes
8
9
  */
9
- export function mobileSetAppearance(this: import("../driver").XCUITestDriver, style: "dark" | "light"): Promise<undefined>;
10
+ export declare function mobileSetAppearance(this: XCUITestDriver, style: 'dark' | 'light'): Promise<void>;
10
11
  /**
11
12
  * Get the device's UI appearance style.
12
13
  *
13
14
  * @since Xcode SDK 11
14
- * @returns {Promise<{style: Style}>}
15
- * @this {XCUITestDriver}
15
+ * @returns The current appearance style
16
16
  */
17
- export function mobileGetAppearance(this: import("../driver").XCUITestDriver): Promise<{
17
+ export declare function mobileGetAppearance(this: XCUITestDriver): Promise<{
18
18
  style: Style;
19
19
  }>;
20
- export type XCUITestDriver = import("../driver").XCUITestDriver;
21
- export type Style = import("./types").Style;
22
20
  //# sourceMappingURL=appearance.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"appearance.d.ts","sourceRoot":"","sources":["../../../lib/commands/appearance.js"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,qFAJW,MAAM,GAAC,OAAO,sBA0BxB;AAED;;;;;;GAMG;AACH,+EAHa,OAAO,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAC,CAAC,CA0BnC;6BAGY,OAAO,WAAW,EAAE,cAAc;oBAClC,OAAO,SAAS,EAAE,KAAK"}
1
+ {"version":3,"file":"appearance.d.ts","sourceRoot":"","sources":["../../../lib/commands/appearance.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAGnC;;;;;;GAMG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,cAAc,EACpB,KAAK,EAAE,MAAM,GAAG,OAAO,GACtB,OAAO,CAAC,IAAI,CAAC,CAwBf;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAC,CAAC,CAkBzB"}
@@ -11,27 +11,28 @@ const support_1 = require("appium/support");
11
11
  * Set the device's UI appearance style
12
12
  *
13
13
  * @since iOS 12.0
14
- * @param {'dark'|'light'} style - The appearance style to set
15
- * @throws {Error} if the current platform does not support UI appearance changes
16
- * @this {XCUITestDriver}
14
+ * @param style - The appearance style to set
15
+ * @throws If the current platform does not support UI appearance changes
17
16
  */
18
17
  async function mobileSetAppearance(style) {
19
18
  if (!['light', 'dark'].includes(lodash_1.default.toLower(style))) {
20
19
  throw new Error(`The 'style' value is expected to equal either 'light' or 'dark'`);
21
20
  }
22
- if (support_1.util.compareVersions(/** @type {string} */ (this.opts.platformVersion), '<', '12.0')) {
21
+ if (support_1.util.compareVersions(this.opts.platformVersion, '<', '12.0')) {
23
22
  throw new Error('Changing appearance is only supported since iOS 12');
24
23
  }
25
24
  if (this.isSimulator()) {
26
25
  try {
27
- return void (await /** @type {import('appium-ios-simulator').Simulator} */ (this.device).setAppearance(style));
26
+ await this.device.setAppearance(style);
27
+ return;
28
28
  }
29
29
  catch (e) {
30
30
  this.log.debug(e.stack);
31
31
  }
32
32
  }
33
33
  try {
34
- return void (await this.proxyCommand('/wda/device/appearance', 'POST', { name: style }, false));
34
+ await this.proxyCommand('/wda/device/appearance', 'POST', { name: style }, false);
35
+ return;
35
36
  }
36
37
  catch (e) {
37
38
  this.log.debug(e.stack);
@@ -43,32 +44,25 @@ async function mobileSetAppearance(style) {
43
44
  * Get the device's UI appearance style.
44
45
  *
45
46
  * @since Xcode SDK 11
46
- * @returns {Promise<{style: Style}>}
47
- * @this {XCUITestDriver}
47
+ * @returns The current appearance style
48
48
  */
49
49
  async function mobileGetAppearance() {
50
- if (support_1.util.compareVersions(/** @type {string} */ (this.opts.platformVersion), '<', '12.0')) {
50
+ if (support_1.util.compareVersions(this.opts.platformVersion, '<', '12.0')) {
51
51
  return { style: 'unsupported' };
52
52
  }
53
- /** @type {Style|undefined} */
54
53
  let style;
55
54
  if (this.isSimulator()) {
56
55
  try {
57
- style = /** @type {Style} */ (await /** @type {import('appium-ios-simulator').Simulator} */ (this.device).getAppearance());
56
+ style = await this.device.getAppearance();
58
57
  }
59
58
  catch { }
60
59
  }
61
60
  if (!style) {
62
- style = /** @type {Style} */ (
63
- /** @type {any} */ (await this.proxyCommand('/wda/device/info', 'GET'))
64
- ?.userInterfaceStyle ?? 'unknown');
61
+ const deviceInfo = await this.proxyCommand('/wda/device/info', 'GET');
62
+ style = (deviceInfo?.userInterfaceStyle ?? 'unknown');
65
63
  }
66
64
  return {
67
- style,
65
+ style: style,
68
66
  };
69
67
  }
70
- /**
71
- * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
72
- * @typedef {import('./types').Style} Style
73
- */
74
68
  //# sourceMappingURL=appearance.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"appearance.js","sourceRoot":"","sources":["../../../lib/commands/appearance.js"],"names":[],"mappings":";;;;;AAWA,kDAsBC;AASD,kDAuBC;AAjED,oDAAuB;AACvB,4CAAoC;AAEpC;;;;;;;GAOG;AACI,KAAK,UAAU,mBAAmB,CAAC,KAAK;IAC7C,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,QAAQ,CAAC,gBAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QAClD,MAAM,IAAI,KAAK,CAAC,iEAAiE,CAAC,CAAC;IACrF,CAAC;IACD,IAAI,cAAI,CAAC,eAAe,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,CAAC;QACzF,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,CAAC;IAED,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;QACvB,IAAI,CAAC;YACH,OAAO,KAAK,CAAC,MAAM,uDAAuD,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;QACjH,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IACD,IAAI,CAAC;QACH,OAA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AAI,CAAC,CAAC,CAAC,KAAK,YAAY,CAAC,CAAC;AAC/F,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,mBAAmB;IAGvC,IAAI,cAAI,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,eAAyB,EAAE,GAAG,EAAE,MAAM,CAAC,EAAE,CAAC;QAC3E,OAAO,EAAC,KAAK,EAAE,aAAa,EAAC,CAAC;IAChC,CAAC;IAED,IAAI,KAAwB,CAAC;IAC7B,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;QACvB,IAAI,CAAC;YACH,KAAK,GAAG,MAAO,IAAI,CAAC,MAAoB,CAAC,aAAa,EAAW,CAAC;QACpE,CAAC;QAAC,MAAM,CAAC,CAAA,CAAC;IACZ,CAAC;IACD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,YAAY,CAAqC,kBAAkB,EAAE,KAAK,CAAC,CAAC;QAC1G,KAAK,GAAG,CAAC,UAAU,EAAE,kBAAkB,IAAI,SAAS,CAAU,CAAC;IACjE,CAAC;IACD,OAAO;QACL,KAAK,EAAE,KAAc;KACtB,CAAC;AACJ,CAAC"}
@@ -1,43 +1,15 @@
1
- /**
2
- * @typedef {Object} AccessibilityAuditItem
3
- * @property {string} detailedDescription The detailed description of the found accessibility issue.
4
- * @property {string} compactDescription The compact description of the found accessibility issue.
5
- * @property {string|number} auditType The name of the audit type this issue belongs to. Could be
6
- * a number if the type name is unknown.
7
- * @property {string} element The description of the element this issue was found for.
8
- */
1
+ import type { XCUITestDriver } from '../driver';
2
+ import type { AccessibilityAuditItem } from './types';
9
3
  /**
10
4
  * Performs accessibility audit of the current application according to the given type or multiple types.
11
5
  *
12
6
  * @since Xcode 15/iOS 17
13
- * @param {string[]?} auditTypes - One or more type names to perform the audit for.
7
+ * @param auditTypes - One or more type names to perform the audit for.
14
8
  * The full list of available names could be found at
15
9
  * https://developer.apple.com/documentation/xctest/xcuiaccessibilityaudittype?language=objc
16
10
  * If no type if provided explicitly then XCUIAccessibilityAuditTypeAll is assumed.
17
11
  *
18
- * @returns {Promise<AccessibilityAuditItem[]>} List of found issues or an empty list
19
- *
20
- * @this {XCUITestDriver}
12
+ * @returns List of found issues or an empty list
21
13
  */
22
- export function mobilePerformAccessibilityAudit(this: import("../driver").XCUITestDriver, auditTypes: string[] | null): Promise<AccessibilityAuditItem[]>;
23
- export type AccessibilityAuditItem = {
24
- /**
25
- * The detailed description of the found accessibility issue.
26
- */
27
- detailedDescription: string;
28
- /**
29
- * The compact description of the found accessibility issue.
30
- */
31
- compactDescription: string;
32
- /**
33
- * The name of the audit type this issue belongs to. Could be
34
- * a number if the type name is unknown.
35
- */
36
- auditType: string | number;
37
- /**
38
- * The description of the element this issue was found for.
39
- */
40
- element: string;
41
- };
42
- export type XCUITestDriver = import("../driver").XCUITestDriver;
14
+ export declare function mobilePerformAccessibilityAudit(this: XCUITestDriver, auditTypes?: string[]): Promise<AccessibilityAuditItem[]>;
43
15
  //# sourceMappingURL=audit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../../lib/commands/audit.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;;;;;;GAYG;AACH,sGATW,MAAM,EAAE,OAAC,GAKP,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAQ7C;;;;;yBAxBa,MAAM;;;;wBACN,MAAM;;;;;eACN,MAAM,GAAC,MAAM;;;;aAEb,MAAM;;6BAuBP,OAAO,WAAW,EAAE,cAAc"}
1
+ {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../../lib/commands/audit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAC9C,OAAO,KAAK,EAAC,sBAAsB,EAAC,MAAM,SAAS,CAAC;AAEpD;;;;;;;;;;GAUG;AACH,wBAAsB,+BAA+B,CACnD,IAAI,EAAE,cAAc,EACpB,UAAU,CAAC,EAAE,MAAM,EAAE,GACpB,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAMnC"}
@@ -1,31 +1,18 @@
1
1
  "use strict";
2
- /**
3
- * @typedef {Object} AccessibilityAuditItem
4
- * @property {string} detailedDescription The detailed description of the found accessibility issue.
5
- * @property {string} compactDescription The compact description of the found accessibility issue.
6
- * @property {string|number} auditType The name of the audit type this issue belongs to. Could be
7
- * a number if the type name is unknown.
8
- * @property {string} element The description of the element this issue was found for.
9
- */
10
2
  Object.defineProperty(exports, "__esModule", { value: true });
11
3
  exports.mobilePerformAccessibilityAudit = mobilePerformAccessibilityAudit;
12
4
  /**
13
5
  * Performs accessibility audit of the current application according to the given type or multiple types.
14
6
  *
15
7
  * @since Xcode 15/iOS 17
16
- * @param {string[]?} auditTypes - One or more type names to perform the audit for.
8
+ * @param auditTypes - One or more type names to perform the audit for.
17
9
  * The full list of available names could be found at
18
10
  * https://developer.apple.com/documentation/xctest/xcuiaccessibilityaudittype?language=objc
19
11
  * If no type if provided explicitly then XCUIAccessibilityAuditTypeAll is assumed.
20
12
  *
21
- * @returns {Promise<AccessibilityAuditItem[]>} List of found issues or an empty list
22
- *
23
- * @this {XCUITestDriver}
13
+ * @returns List of found issues or an empty list
24
14
  */
25
15
  async function mobilePerformAccessibilityAudit(auditTypes) {
26
- return /** @type {AccessibilityAuditItem[]} */ (await this.proxyCommand('/wda/performAccessibilityAudit', 'POST', { auditTypes }));
16
+ return await this.proxyCommand('/wda/performAccessibilityAudit', 'POST', { auditTypes });
27
17
  }
28
- /**
29
- * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
30
- */
31
18
  //# sourceMappingURL=audit.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"audit.js","sourceRoot":"","sources":["../../../lib/commands/audit.js"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AAeH,0EAIC;AAjBD;;;;;;;;;;;;GAYG;AACI,KAAK,UAAU,+BAA+B,CAAC,UAAU;IAC9D,OAAO,uCAAuC,CAAC,CAC7C,MAAM,IAAI,CAAC,YAAY,CAAC,gCAAgC,EAAE,MAAM,EAAE,EAAC,UAAU,EAAC,CAAC,CAChF,CAAC;AACJ,CAAC;AAED;;GAEG"}
1
+ {"version":3,"file":"audit.js","sourceRoot":"","sources":["../../../lib/commands/audit.ts"],"names":[],"mappings":";;AAcA,0EASC;AApBD;;;;;;;;;;GAUG;AACI,KAAK,UAAU,+BAA+B,CAEnD,UAAqB;IAErB,OAAO,MAAM,IAAI,CAAC,YAAY,CAC5B,gCAAgC,EAChC,MAAM,EACN,EAAC,UAAU,EAAC,CACb,CAAC;AACJ,CAAC"}