@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
@@ -27,7 +27,12 @@ const appium_ios_device_1 = require("appium-ios-device");
27
27
  const teen_process_1 = require("teen_process");
28
28
  const MOMENT_FORMAT_ISO8601 = 'YYYY-MM-DDTHH:mm:ssZ';
29
29
  /**
30
- * @this {XCUITestDriver}
30
+ * Gets the currently active element.
31
+ *
32
+ * In web context, returns the active element from the DOM.
33
+ * In native context, returns the active element from the current view.
34
+ *
35
+ * @returns The active element
31
36
  */
32
37
  async function active() {
33
38
  if (this.isWebContext()) {
@@ -36,28 +41,25 @@ async function active() {
36
41
  return await this.proxyCommand(`/element/active`, 'GET');
37
42
  }
38
43
  /**
39
- * Trigger a touch/fingerprint match or match failure
44
+ * Trigger a touch/fingerprint match or match failure.
40
45
  *
41
- * @param {boolean} match - whether the match should be a success or failure
42
- * @this {XCUITestDriver}
46
+ * @param match - Whether the match should be a success or failure
43
47
  */
44
48
  async function touchId(match = true) {
45
49
  await this.mobileSendBiometricMatch('touchId', match);
46
50
  }
47
51
  /**
48
- * Toggle whether the device is enrolled in the touch ID program
49
- *
50
- * @param {boolean} isEnabled - whether to enable or disable the touch ID program
52
+ * Toggle whether the device is enrolled in the touch ID program.
51
53
  *
52
- * @this {XCUITestDriver}
54
+ * @param isEnabled - Whether to enable or disable the touch ID program
53
55
  */
54
56
  async function toggleEnrollTouchId(isEnabled = true) {
55
57
  await this.mobileEnrollBiometric(isEnabled);
56
58
  }
57
59
  /**
58
- * Get the window size
59
- * @this {XCUITestDriver}
60
- * @returns {Promise<import('@appium/types').Size>}
60
+ * Get the window size.
61
+ *
62
+ * @returns The window size (width and height)
61
63
  */
62
64
  async function getWindowSize() {
63
65
  const { width, height } = await this.getWindowRect();
@@ -66,9 +68,8 @@ async function getWindowSize() {
66
68
  /**
67
69
  * Retrieves the actual device time.
68
70
  *
69
- * @param {string} format - The format specifier string. Read the [MomentJS documentation](https://momentjs.com/docs/) to get the full list of supported datetime format specifiers. The default format is `YYYY-MM-DDTHH:mm:ssZ`, which complies to ISO-8601.
70
- * @returns {Promise<string>} Formatted datetime string or the raw command output (if formatting fails)
71
- * @this {XCUITestDriver}
71
+ * @param format - The format specifier string. Read the [MomentJS documentation](https://momentjs.com/docs/) to get the full list of supported datetime format specifiers. The default format is `YYYY-MM-DDTHH:mm:ssZ`, which complies to ISO-8601.
72
+ * @returns Formatted datetime string or the raw command output (if formatting fails)
72
73
  */
73
74
  async function getDeviceTime(format = MOMENT_FORMAT_ISO8601) {
74
75
  this.log.info('Attempting to capture iOS device date and time');
@@ -107,19 +108,23 @@ async function getDeviceTime(format = MOMENT_FORMAT_ISO8601) {
107
108
  return utc.format(format);
108
109
  }
109
110
  /**
110
- * Retrieves the current device time
111
+ * Retrieves the current device time.
112
+ *
113
+ * This is a wrapper around {@linkcode getDeviceTime}.
111
114
  *
112
- * @param {string} format - See {@linkcode getDeviceTime.format}
113
- * @returns {Promise<string>} Formatted datetime string or the raw command output if formatting fails
114
- * @this {XCUITestDriver}
115
+ * @param format - See {@linkcode getDeviceTime.format}
116
+ * @returns Formatted datetime string or the raw command output if formatting fails
115
117
  */
116
118
  async function mobileGetDeviceTime(format = MOMENT_FORMAT_ISO8601) {
117
119
  return await this.getDeviceTime(format);
118
120
  }
119
121
  /**
120
- * For W3C
121
- * @this {XCUITestDriver}
122
- * @return {Promise<import('@appium/types').Rect>}
122
+ * Gets the window rectangle (position and size).
123
+ *
124
+ * For W3C compatibility. In web context, returns the browser window dimensions.
125
+ * In native context, returns the device window dimensions.
126
+ *
127
+ * @returns The window rectangle
123
128
  */
124
129
  async function getWindowRect() {
125
130
  if (this.isWebContext()) {
@@ -131,32 +136,49 @@ async function getWindowRect() {
131
136
  '}';
132
137
  return await this.executeAtom('execute_script', [script]);
133
138
  }
134
- return /** @type {import('@appium/types').Rect} */ (await this.proxyCommand('/window/rect', 'GET'));
139
+ return (await this.proxyCommand('/window/rect', 'GET'));
135
140
  }
136
141
  /**
137
- * @this {XCUITestDriver}
142
+ * Removes/uninstalls the given application from the device under test.
143
+ *
144
+ * This is a wrapper around {@linkcode mobileRemoveApp mobile: removeApp}.
145
+ *
146
+ * @param bundleId - The bundle identifier of the application to be removed
147
+ * @returns `true` if the application has been removed successfully; `false` otherwise
138
148
  */
139
149
  async function removeApp(bundleId) {
140
150
  return await this.mobileRemoveApp(bundleId);
141
151
  }
142
152
  /**
143
- * @this {XCUITestDriver}
153
+ * Launches the app.
154
+ *
155
+ * @deprecated This API has been deprecated and is not supported anymore.
156
+ * Consider using corresponding 'mobile:' extensions to manage the state of the app under test.
157
+ * @throws {Error} Always throws an error indicating the API is deprecated
144
158
  */
145
159
  async function launchApp() {
146
160
  throw new Error(`The launchApp API has been deprecated and is not supported anymore. ` +
147
161
  `Consider using corresponding 'mobile:' extensions to manage the state of the app under test.`);
148
162
  }
149
163
  /**
150
- * @this {XCUITestDriver}
164
+ * Closes the app.
165
+ *
166
+ * @deprecated This API has been deprecated and is not supported anymore.
167
+ * Consider using corresponding 'mobile:' extensions to manage the state of the app under test.
168
+ * @throws {Error} Always throws an error indicating the API is deprecated
151
169
  */
152
170
  async function closeApp() {
153
171
  throw new Error(`The closeApp API has been deprecated and is not supported anymore. ` +
154
172
  `Consider using corresponding 'mobile:' extensions to manage the state of the app under test.`);
155
173
  }
156
174
  /**
157
- * @this {XCUITestDriver}
158
- * @param {string} url
159
- * @returns {Promise<void>}
175
+ * Sets the URL for the current session.
176
+ *
177
+ * In web context, navigates to the URL using the remote debugger.
178
+ * In native context on real devices, uses the proxy command.
179
+ * In native context on simulators, uses simctl to open the URL.
180
+ *
181
+ * @param url - The URL to navigate to
160
182
  */
161
183
  async function setUrl(url) {
162
184
  this.log.debug(`Attempting to set url '${url}'`);
@@ -164,22 +186,22 @@ async function setUrl(url) {
164
186
  this.setCurrentUrl(url);
165
187
  // make sure to clear out any leftover web frames
166
188
  this.curWebFrames = [];
167
- await ( /** @type {import('appium-remote-debugger').RemoteDebugger} */(this.remote)).navToUrl(url);
189
+ await this.remote.navToUrl(url);
168
190
  return;
169
191
  }
170
192
  if (this.isRealDevice()) {
171
193
  await this.proxyCommand('/url', 'POST', { url });
172
194
  }
173
195
  else {
174
- await /** @type {import('appium-ios-simulator').Simulator} */ (this.device).simctl.openUrl(url);
196
+ await this.device.simctl.openUrl(url);
175
197
  }
176
198
  }
177
199
  /**
178
200
  * Retrieves the viewport dimensions.
179
201
  *
180
202
  * The viewport is the device's screen size with status bar size subtracted if the latter is present/visible.
181
- * @returns {Promise<import('./types').Viewport>}
182
- * @this {XCUITestDriver}
203
+ *
204
+ * @returns The viewport rectangle
183
205
  */
184
206
  async function getViewportRect() {
185
207
  const scale = await this.getDevicePixelRatio();
@@ -199,22 +221,25 @@ async function getViewportRect() {
199
221
  * Get information about the screen.
200
222
  *
201
223
  * @privateRemarks memoized in constructor
202
- * @this {XCUITestDriver}
203
- * @returns {Promise<ScreenInfo>}
224
+ * @returns Screen information including dimensions, scale, and status bar size
204
225
  */
205
226
  async function getScreenInfo() {
206
- return /** @type {ScreenInfo} */ (await this.proxyCommand('/wda/screen', 'GET'));
227
+ return (await this.proxyCommand('/wda/screen', 'GET'));
207
228
  }
208
229
  /**
209
- * @this {XCUITestDriver}
230
+ * Gets the status bar height.
231
+ *
232
+ * @returns The height of the status bar in logical pixels
210
233
  */
211
234
  async function getStatusBarHeight() {
212
235
  const { statusBarSize } = await this.getScreenInfo();
213
236
  return statusBarSize.height;
214
237
  }
215
238
  /**
216
- * memoized in constructor
217
- * @this {XCUITestDriver}
239
+ * Gets the device pixel ratio.
240
+ *
241
+ * @privateRemarks memoized in constructor
242
+ * @returns The device pixel ratio (scale factor)
218
243
  */
219
244
  async function getDevicePixelRatio() {
220
245
  const { scale } = await this.getScreenInfo();
@@ -230,9 +255,8 @@ async function getDevicePixelRatio() {
230
255
  *
231
256
  * Use {@linkcode mobilePerformIoHidEvent} to call a more universal API to perform a button press with duration on any supported device.
232
257
  *
233
- * @param {import('./types').ButtonName} name - The name of the button to be pressed.
234
- * @param {number} [durationSeconds] - The duration of the button press in seconds (float).
235
- * @this {XCUITestDriver}
258
+ * @param name - The name of the button to be pressed
259
+ * @param durationSeconds - The duration of the button press in seconds (float)
236
260
  */
237
261
  async function mobilePressButton(name, durationSeconds) {
238
262
  if (!name) {
@@ -247,10 +271,8 @@ async function mobilePressButton(name, durationSeconds) {
247
271
  * Process a string as speech and send it to Siri.
248
272
  *
249
273
  * Presents the Siri UI, if it is not currently active, and accepts a string which is then processed as if it were recognized speech. See [the documentation of `activateWithVoiceRecognitionText`](https://developer.apple.com/documentation/xctest/xcuisiriservice/2852140-activatewithvoicerecognitiontext?language=objc) for more details.
250
-
251
- * @param {string} text - Text to be sent to Siri
252
- * @returns {Promise<void>}
253
- * @this {XCUITestDriver}
274
+ *
275
+ * @param text - Text to be sent to Siri
254
276
  */
255
277
  async function mobileSiriCommand(text) {
256
278
  if (!text) {
@@ -258,13 +280,4 @@ async function mobileSiriCommand(text) {
258
280
  }
259
281
  await this.proxyCommand('/wda/siri/activate', 'POST', { text });
260
282
  }
261
- /**
262
- * @typedef {Object} PressButtonOptions
263
- * @property {string} name - The name of the button to be pressed.
264
- * @property {number} [durationSeconds] - Duration in float seconds.
265
- */
266
- /**
267
- * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
268
- * @typedef {import('./types').ScreenInfo} ScreenInfo
269
- */
270
283
  //# sourceMappingURL=general.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"general.js","sourceRoot":"","sources":["../../../lib/commands/general.js"],"names":[],"mappings":";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;;GAKG;AACI,KAAK,UAAU,mBAAmB;IACvC,MAAM,EAAC,KAAK,EAAC,GAAG,MAAM,IAAI,CAAC,aAAa,EAAE,CAAC;IAC3C,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;;;;GAYG;AACI,KAAK,UAAU,iBAAiB,CAErC,IAAgB,EAChB,eAAwB;IAExB,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,eAAM,CAAC,oBAAoB,CAAC,0BAA0B,CAAC,CAAC;IACpE,CAAC;IACD,IAAI,CAAC,gBAAC,CAAC,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,gBAAC,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC;QAC9D,MAAM,IAAI,eAAM,CAAC,oBAAoB,CAAC,oCAAoC,CAAC,CAAC;IAC9E,CAAC;IACD,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,kBAAkB,EAAE,MAAM,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,eAAe,EAAC,CAAC,CAAC;AAChG,CAAC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,iBAAiB,CAAuB,IAAY;IACxE,IAAI,CAAC,IAAI,EAAE,CAAC;QACV,MAAM,IAAI,eAAM,CAAC,oBAAoB,CAAC,8BAA8B,CAAC,CAAC;IACxE,CAAC;IACD,MAAM,IAAI,CAAC,YAAY,CAAC,oBAAoB,EAAE,MAAM,EAAE,EAAC,IAAI,EAAC,CAAC,CAAC;AAChE,CAAC"}
@@ -1,57 +1,37 @@
1
- /**
2
- * @typedef {Object} GeolocationInfo
3
- * @property {number|null} latitude Measurement of distance north or south of the Equator, or
4
- * `null` if {@linkcode XCUITestDriver.mobileSetSimulatedLocation} has not been called or {@linkcode
5
- * resetSimulatedLocation} has been called.
6
- * @property {number|null} longitude Measurement of distance east or west of the prime meridian, or
7
- * `null` if {@linkcode XCUITestDriver.mobileSetSimulatedLocation} has not been called or {@linkcode
8
- * resetSimulatedLocation} has been called.
9
- */
1
+ import type { XCUITestDriver } from '../driver';
2
+ export interface GeolocationInfo {
3
+ /** Measurement of distance north or south of the Equator, or `null` if {@linkcode XCUITestDriver.mobileSetSimulatedLocation} has not been called or {@linkcode mobileResetSimulatedLocation} has been called. */
4
+ latitude: number | null;
5
+ /** Measurement of distance east or west of the prime meridian, or `null` if {@linkcode XCUITestDriver.mobileSetSimulatedLocation} has not been called or {@linkcode mobileResetSimulatedLocation} has been called. */
6
+ longitude: number | null;
7
+ }
10
8
  /**
11
9
  * Retrieves the simulated geolocation value.
12
10
  * Only works since Xcode 14.3/iOS 16.4
13
11
  *
14
- * @returns {Promise<GeolocationInfo>}
15
- * @throws {Error} If the device under test does not support gelolocation simulation.
12
+ * @returns The current simulated geolocation
13
+ * @throws If the device under test does not support geolocation simulation.
16
14
  * @since 4.18
17
- * @this {XCUITestDriver}
18
15
  */
19
- export function mobileGetSimulatedLocation(this: import("../driver").XCUITestDriver): Promise<GeolocationInfo>;
16
+ export declare function mobileGetSimulatedLocation(this: XCUITestDriver): Promise<GeolocationInfo>;
20
17
  /**
21
18
  * Sets simulated geolocation value.
22
19
  * Only works since Xcode 14.3/iOS 16.4
23
20
  *
24
- * @param {number} latitude
25
- * @param {number} longitude
26
- * @returns {Promise<void>}
27
- * @throws {Error} If the device under test does not support gelolocation simulation.
21
+ * @param latitude - Latitude value
22
+ * @param longitude - Longitude value
23
+ * @throws If the device under test does not support geolocation simulation.
28
24
  * @since 4.18
29
- * @this {XCUITestDriver}
30
25
  */
31
- export function mobileSetSimulatedLocation(this: import("../driver").XCUITestDriver, latitude: number, longitude: number): Promise<void>;
26
+ export declare function mobileSetSimulatedLocation(this: XCUITestDriver, latitude: number, longitude: number): Promise<void>;
32
27
  /**
33
28
  * Resets simulated geolocation value.
34
29
  * Only works since Xcode 14.3/iOS 16.4.
35
30
  * ! Do not forget to reset the simulated geolocation value after your automated test is finished.
36
31
  * ! If the value is not reset explicitly then the simulated one will remain until the next device restart.
37
32
  *
38
- * @returns {Promise<void>}
39
- * @throws {Error} If the device under test does not support gelolocation simulation.
33
+ * @throws If the device under test does not support geolocation simulation.
40
34
  * @since 4.18
41
- * @this {XCUITestDriver}
42
35
  */
43
- export function mobileResetSimulatedLocation(this: import("../driver").XCUITestDriver): Promise<void>;
44
- export type GeolocationInfo = {
45
- /**
46
- * Measurement of distance north or south of the Equator, or
47
- * `null` if {@linkcode XCUITestDriver.mobileSetSimulatedLocation} has not been called or {@linkcode * resetSimulatedLocation} has been called.
48
- */
49
- latitude: number | null;
50
- /**
51
- * Measurement of distance east or west of the prime meridian, or
52
- * `null` if {@linkcode XCUITestDriver.mobileSetSimulatedLocation} has not been called or {@linkcode * resetSimulatedLocation} has been called.
53
- */
54
- longitude: number | null;
55
- };
56
- export type XCUITestDriver = import("../driver").XCUITestDriver;
36
+ export declare function mobileResetSimulatedLocation(this: XCUITestDriver): Promise<void>;
57
37
  //# sourceMappingURL=geolocation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"geolocation.d.ts","sourceRoot":"","sources":["../../../lib/commands/geolocation.js"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH;;;;;;;;GAQG;AACH,sFALa,OAAO,CAAC,eAAe,CAAC,CAOpC;AAED;;;;;;;;;;GAUG;AACH,+FAPW,MAAM,aACN,MAAM,GACJ,OAAO,CAAC,IAAI,CAAC,CAOzB;AAED;;;;;;;;;;GAUG;AACH,wFALa,OAAO,CAAC,IAAI,CAAC,CAOzB;;;;;;cAjDa,MAAM,GAAC,IAAI;;;;;eAGX,MAAM,GAAC,IAAI;;6BAiDZ,OAAO,WAAW,EAAE,cAAc"}
1
+ {"version":3,"file":"geolocation.d.ts","sourceRoot":"","sources":["../../../lib/commands/geolocation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,WAAW,CAAC;AAE9C,MAAM,WAAW,eAAe;IAC9B,iNAAiN;IACjN,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,sNAAsN;IACtN,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,eAAe,CAAC,CAE1B;AAED;;;;;;;;GAQG;AACH,wBAAsB,0BAA0B,CAC9C,IAAI,EAAE,cAAc,EACpB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,IAAI,CAAC,CAEf;AAED;;;;;;;;GAQG;AACH,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,cAAc,GACnB,OAAO,CAAC,IAAI,CAAC,CAEf"}
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- /**
3
- * @typedef {Object} GeolocationInfo
4
- * @property {number|null} latitude Measurement of distance north or south of the Equator, or
5
- * `null` if {@linkcode XCUITestDriver.mobileSetSimulatedLocation} has not been called or {@linkcode
6
- * resetSimulatedLocation} has been called.
7
- * @property {number|null} longitude Measurement of distance east or west of the prime meridian, or
8
- * `null` if {@linkcode XCUITestDriver.mobileSetSimulatedLocation} has not been called or {@linkcode
9
- * resetSimulatedLocation} has been called.
10
- */
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.mobileGetSimulatedLocation = mobileGetSimulatedLocation;
13
4
  exports.mobileSetSimulatedLocation = mobileSetSimulatedLocation;
@@ -16,10 +7,9 @@ exports.mobileResetSimulatedLocation = mobileResetSimulatedLocation;
16
7
  * Retrieves the simulated geolocation value.
17
8
  * Only works since Xcode 14.3/iOS 16.4
18
9
  *
19
- * @returns {Promise<GeolocationInfo>}
20
- * @throws {Error} If the device under test does not support gelolocation simulation.
10
+ * @returns The current simulated geolocation
11
+ * @throws If the device under test does not support geolocation simulation.
21
12
  * @since 4.18
22
- * @this {XCUITestDriver}
23
13
  */
24
14
  async function mobileGetSimulatedLocation() {
25
15
  return await this.proxyCommand('/wda/simulatedLocation', 'GET');
@@ -28,15 +18,13 @@ async function mobileGetSimulatedLocation() {
28
18
  * Sets simulated geolocation value.
29
19
  * Only works since Xcode 14.3/iOS 16.4
30
20
  *
31
- * @param {number} latitude
32
- * @param {number} longitude
33
- * @returns {Promise<void>}
34
- * @throws {Error} If the device under test does not support gelolocation simulation.
21
+ * @param latitude - Latitude value
22
+ * @param longitude - Longitude value
23
+ * @throws If the device under test does not support geolocation simulation.
35
24
  * @since 4.18
36
- * @this {XCUITestDriver}
37
25
  */
38
26
  async function mobileSetSimulatedLocation(latitude, longitude) {
39
- return await this.proxyCommand('/wda/simulatedLocation', 'POST', { latitude, longitude });
27
+ await this.proxyCommand('/wda/simulatedLocation', 'POST', { latitude, longitude });
40
28
  }
41
29
  /**
42
30
  * Resets simulated geolocation value.
@@ -44,15 +32,10 @@ async function mobileSetSimulatedLocation(latitude, longitude) {
44
32
  * ! Do not forget to reset the simulated geolocation value after your automated test is finished.
45
33
  * ! If the value is not reset explicitly then the simulated one will remain until the next device restart.
46
34
  *
47
- * @returns {Promise<void>}
48
- * @throws {Error} If the device under test does not support gelolocation simulation.
35
+ * @throws If the device under test does not support geolocation simulation.
49
36
  * @since 4.18
50
- * @this {XCUITestDriver}
51
37
  */
52
38
  async function mobileResetSimulatedLocation() {
53
- return await this.proxyCommand('/wda/simulatedLocation', 'DELETE');
39
+ await this.proxyCommand('/wda/simulatedLocation', 'DELETE');
54
40
  }
55
- /**
56
- * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
57
- */
58
41
  //# sourceMappingURL=geolocation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"geolocation.js","sourceRoot":"","sources":["../../../lib/commands/geolocation.js"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;AAWH,gEAEC;AAaD,gEAEC;AAaD,oEAEC;AAzCD;;;;;;;;GAQG;AACI,KAAK,UAAU,0BAA0B;IAC9C,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;AAClE,CAAC;AAED;;;;;;;;;;GAUG;AACI,KAAK,UAAU,0BAA0B,CAAC,QAAQ,EAAE,SAAS;IAClE,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,wBAAwB,EAAE,MAAM,EAAE,EAAC,QAAQ,EAAE,SAAS,EAAC,CAAC,CAAC;AAC1F,CAAC;AAED;;;;;;;;;;GAUG;AACI,KAAK,UAAU,4BAA4B;IAChD,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,wBAAwB,EAAE,QAAQ,CAAC,CAAC;AACrE,CAAC;AAED;;GAEG"}
1
+ {"version":3,"file":"geolocation.js","sourceRoot":"","sources":["../../../lib/commands/geolocation.ts"],"names":[],"mappings":";;AAiBA,gEAIC;AAWD,gEAMC;AAWD,oEAIC;AA5CD;;;;;;;GAOG;AACI,KAAK,UAAU,0BAA0B;IAG9C,OAAO,MAAM,IAAI,CAAC,YAAY,CAAuB,wBAAwB,EAAE,KAAK,CAAC,CAAC;AACxF,CAAC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,0BAA0B,CAE9C,QAAgB,EAChB,SAAiB;IAEjB,MAAM,IAAI,CAAC,YAAY,CAAC,wBAAwB,EAAE,MAAM,EAAE,EAAC,QAAQ,EAAE,SAAS,EAAC,CAAC,CAAC;AACnF,CAAC;AAED;;;;;;;;GAQG;AACI,KAAK,UAAU,4BAA4B;IAGhD,MAAM,IAAI,CAAC,YAAY,CAAC,wBAAwB,EAAE,QAAQ,CAAC,CAAC;AAC9D,CAAC"}