appium-xcuitest-driver 10.3.0 → 10.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/lib/commands/active-app-info.d.ts +9 -0
  3. package/build/lib/commands/active-app-info.d.ts.map +1 -0
  4. package/build/lib/commands/active-app-info.js +14 -0
  5. package/build/lib/commands/active-app-info.js.map +1 -0
  6. package/build/lib/commands/alert.d.ts +42 -45
  7. package/build/lib/commands/alert.d.ts.map +1 -1
  8. package/build/lib/commands/alert.js +66 -62
  9. package/build/lib/commands/alert.js.map +1 -1
  10. package/build/lib/commands/app-management.d.ts +150 -153
  11. package/build/lib/commands/app-management.d.ts.map +1 -1
  12. package/build/lib/commands/app-management.js +300 -286
  13. package/build/lib/commands/app-management.js.map +1 -1
  14. package/build/lib/commands/app-strings.d.ts +14 -17
  15. package/build/lib/commands/app-strings.d.ts.map +1 -1
  16. package/build/lib/commands/app-strings.js +23 -24
  17. package/build/lib/commands/app-strings.js.map +1 -1
  18. package/build/lib/commands/appearance.d.ts +19 -22
  19. package/build/lib/commands/appearance.d.ts.map +1 -1
  20. package/build/lib/commands/appearance.js +56 -56
  21. package/build/lib/commands/appearance.js.map +1 -1
  22. package/build/lib/commands/audit.d.ts +22 -17
  23. package/build/lib/commands/audit.d.ts.map +1 -1
  24. package/build/lib/commands/audit.js +17 -18
  25. package/build/lib/commands/audit.js.map +1 -1
  26. package/build/lib/commands/battery.d.ts +11 -14
  27. package/build/lib/commands/battery.d.ts.map +1 -1
  28. package/build/lib/commands/battery.js +36 -37
  29. package/build/lib/commands/battery.js.map +1 -1
  30. package/build/lib/commands/biometric.d.ts +30 -33
  31. package/build/lib/commands/biometric.d.ts.map +1 -1
  32. package/build/lib/commands/biometric.js +42 -41
  33. package/build/lib/commands/biometric.js.map +1 -1
  34. package/build/lib/commands/certificate.d.ts +48 -45
  35. package/build/lib/commands/certificate.d.ts.map +1 -1
  36. package/build/lib/commands/certificate.js +218 -205
  37. package/build/lib/commands/certificate.js.map +1 -1
  38. package/build/lib/commands/clipboard.d.ts +19 -22
  39. package/build/lib/commands/clipboard.d.ts.map +1 -1
  40. package/build/lib/commands/clipboard.js +30 -30
  41. package/build/lib/commands/clipboard.js.map +1 -1
  42. package/build/lib/commands/condition.d.ts +49 -26
  43. package/build/lib/commands/condition.d.ts.map +1 -1
  44. package/build/lib/commands/condition.js +87 -86
  45. package/build/lib/commands/condition.js.map +1 -1
  46. package/build/lib/commands/content-size.d.ts +26 -29
  47. package/build/lib/commands/content-size.d.ts.map +1 -1
  48. package/build/lib/commands/content-size.js +36 -36
  49. package/build/lib/commands/content-size.js.map +1 -1
  50. package/build/lib/commands/context.d.ts +161 -108
  51. package/build/lib/commands/context.d.ts.map +1 -1
  52. package/build/lib/commands/context.js +530 -517
  53. package/build/lib/commands/context.js.map +1 -1
  54. package/build/lib/commands/deviceInfo.d.ts +9 -12
  55. package/build/lib/commands/deviceInfo.d.ts.map +1 -1
  56. package/build/lib/commands/deviceInfo.js +17 -18
  57. package/build/lib/commands/deviceInfo.js.map +1 -1
  58. package/build/lib/commands/element.d.ts +102 -105
  59. package/build/lib/commands/element.d.ts.map +1 -1
  60. package/build/lib/commands/element.js +337 -323
  61. package/build/lib/commands/element.js.map +1 -1
  62. package/build/lib/commands/execute.d.ts +24 -19
  63. package/build/lib/commands/execute.d.ts.map +1 -1
  64. package/build/lib/commands/execute.js +63 -62
  65. package/build/lib/commands/execute.js.map +1 -1
  66. package/build/lib/commands/file-movement.d.ts +77 -80
  67. package/build/lib/commands/file-movement.d.ts.map +1 -1
  68. package/build/lib/commands/file-movement.js +130 -124
  69. package/build/lib/commands/file-movement.js.map +1 -1
  70. package/build/lib/commands/find.d.ts +18 -21
  71. package/build/lib/commands/find.d.ts.map +1 -1
  72. package/build/lib/commands/find.js +158 -156
  73. package/build/lib/commands/find.js.map +1 -1
  74. package/build/lib/commands/general.d.ts +124 -116
  75. package/build/lib/commands/general.d.ts.map +1 -1
  76. package/build/lib/commands/general.js +248 -232
  77. package/build/lib/commands/general.js.map +1 -1
  78. package/build/lib/commands/geolocation.d.ts +43 -46
  79. package/build/lib/commands/geolocation.d.ts.map +1 -1
  80. package/build/lib/commands/geolocation.js +10 -11
  81. package/build/lib/commands/geolocation.js.map +1 -1
  82. package/build/lib/commands/gesture.d.ts +273 -276
  83. package/build/lib/commands/gesture.d.ts.map +1 -1
  84. package/build/lib/commands/gesture.js +506 -492
  85. package/build/lib/commands/gesture.js.map +1 -1
  86. package/build/lib/commands/increase-contrast.d.ts +20 -23
  87. package/build/lib/commands/increase-contrast.d.ts.map +1 -1
  88. package/build/lib/commands/increase-contrast.js +30 -30
  89. package/build/lib/commands/increase-contrast.js.map +1 -1
  90. package/build/lib/commands/iohid.d.ts +1370 -1373
  91. package/build/lib/commands/iohid.d.ts.map +1 -1
  92. package/build/lib/commands/iohid.js +30 -31
  93. package/build/lib/commands/iohid.js.map +1 -1
  94. package/build/lib/commands/keyboard.d.ts +29 -32
  95. package/build/lib/commands/keyboard.d.ts.map +1 -1
  96. package/build/lib/commands/keyboard.js +53 -51
  97. package/build/lib/commands/keyboard.js.map +1 -1
  98. package/build/lib/commands/keychains.d.ts +9 -12
  99. package/build/lib/commands/keychains.d.ts.map +1 -1
  100. package/build/lib/commands/keychains.js +13 -14
  101. package/build/lib/commands/keychains.js.map +1 -1
  102. package/build/lib/commands/localization.d.ts +16 -19
  103. package/build/lib/commands/localization.d.ts.map +1 -1
  104. package/build/lib/commands/localization.js +25 -26
  105. package/build/lib/commands/localization.js.map +1 -1
  106. package/build/lib/commands/location.d.ts +36 -39
  107. package/build/lib/commands/location.d.ts.map +1 -1
  108. package/build/lib/commands/location.js +99 -98
  109. package/build/lib/commands/location.js.map +1 -1
  110. package/build/lib/commands/lock.d.ts +21 -24
  111. package/build/lib/commands/lock.d.ts.map +1 -1
  112. package/build/lib/commands/lock.js +39 -38
  113. package/build/lib/commands/lock.js.map +1 -1
  114. package/build/lib/commands/log.d.ts +43 -37
  115. package/build/lib/commands/log.d.ts.map +1 -1
  116. package/build/lib/commands/log.js +174 -171
  117. package/build/lib/commands/log.js.map +1 -1
  118. package/build/lib/commands/memory.d.ts +9 -12
  119. package/build/lib/commands/memory.d.ts.map +1 -1
  120. package/build/lib/commands/memory.js +37 -38
  121. package/build/lib/commands/memory.js.map +1 -1
  122. package/build/lib/commands/navigation.d.ts +30 -33
  123. package/build/lib/commands/navigation.d.ts.map +1 -1
  124. package/build/lib/commands/navigation.js +92 -92
  125. package/build/lib/commands/navigation.js.map +1 -1
  126. package/build/lib/commands/notifications.d.ts +26 -29
  127. package/build/lib/commands/notifications.d.ts.map +1 -1
  128. package/build/lib/commands/notifications.js +53 -53
  129. package/build/lib/commands/notifications.js.map +1 -1
  130. package/build/lib/commands/pasteboard.d.ts +21 -24
  131. package/build/lib/commands/pasteboard.d.ts.map +1 -1
  132. package/build/lib/commands/pasteboard.js +37 -37
  133. package/build/lib/commands/pasteboard.js.map +1 -1
  134. package/build/lib/commands/pcap.d.ts +39 -26
  135. package/build/lib/commands/pcap.d.ts.map +1 -1
  136. package/build/lib/commands/pcap.js +81 -81
  137. package/build/lib/commands/pcap.js.map +1 -1
  138. package/build/lib/commands/performance.d.ts +63 -44
  139. package/build/lib/commands/performance.d.ts.map +1 -1
  140. package/build/lib/commands/performance.js +105 -105
  141. package/build/lib/commands/performance.js.map +1 -1
  142. package/build/lib/commands/permissions.d.ts +33 -36
  143. package/build/lib/commands/permissions.d.ts.map +1 -1
  144. package/build/lib/commands/permissions.js +66 -65
  145. package/build/lib/commands/permissions.js.map +1 -1
  146. package/build/lib/commands/proxy-helper.d.ts +12 -15
  147. package/build/lib/commands/proxy-helper.d.ts.map +1 -1
  148. package/build/lib/commands/proxy-helper.js +53 -54
  149. package/build/lib/commands/proxy-helper.js.map +1 -1
  150. package/build/lib/commands/record-audio.d.ts +49 -29
  151. package/build/lib/commands/record-audio.d.ts.map +1 -1
  152. package/build/lib/commands/record-audio.js +100 -104
  153. package/build/lib/commands/record-audio.js.map +1 -1
  154. package/build/lib/commands/recordscreen.d.ts +54 -18
  155. package/build/lib/commands/recordscreen.d.ts.map +1 -1
  156. package/build/lib/commands/recordscreen.js +127 -129
  157. package/build/lib/commands/recordscreen.js.map +1 -1
  158. package/build/lib/commands/screenshots.d.ts +14 -17
  159. package/build/lib/commands/screenshots.d.ts.map +1 -1
  160. package/build/lib/commands/screenshots.js +108 -107
  161. package/build/lib/commands/screenshots.js.map +1 -1
  162. package/build/lib/commands/simctl.d.ts +11 -14
  163. package/build/lib/commands/simctl.d.ts.map +1 -1
  164. package/build/lib/commands/simctl.js +23 -26
  165. package/build/lib/commands/simctl.js.map +1 -1
  166. package/build/lib/commands/source.d.ts +14 -17
  167. package/build/lib/commands/source.d.ts.map +1 -1
  168. package/build/lib/commands/source.js +40 -43
  169. package/build/lib/commands/source.js.map +1 -1
  170. package/build/lib/commands/timeouts.d.ts +44 -33
  171. package/build/lib/commands/timeouts.d.ts.map +1 -1
  172. package/build/lib/commands/timeouts.js +65 -63
  173. package/build/lib/commands/timeouts.js.map +1 -1
  174. package/build/lib/commands/web.d.ts +247 -197
  175. package/build/lib/commands/web.d.ts.map +1 -1
  176. package/build/lib/commands/web.js +815 -786
  177. package/build/lib/commands/web.js.map +1 -1
  178. package/build/lib/commands/xctest-record-screen.d.ts +63 -66
  179. package/build/lib/commands/xctest-record-screen.d.ts.map +1 -1
  180. package/build/lib/commands/xctest-record-screen.js +103 -102
  181. package/build/lib/commands/xctest-record-screen.js.map +1 -1
  182. package/build/lib/commands/xctest.d.ts +55 -51
  183. package/build/lib/commands/xctest.d.ts.map +1 -1
  184. package/build/lib/commands/xctest.js +116 -117
  185. package/build/lib/commands/xctest.js.map +1 -1
  186. package/build/lib/driver.d.ts +278 -1597
  187. package/build/lib/driver.d.ts.map +1 -1
  188. package/build/lib/driver.js +319 -235
  189. package/build/lib/driver.js.map +1 -1
  190. package/build/lib/execute-method-map.d.ts.map +1 -1
  191. package/build/lib/execute-method-map.js +9 -0
  192. package/build/lib/execute-method-map.js.map +1 -1
  193. package/lib/commands/active-app-info.js +12 -0
  194. package/lib/commands/alert.js +68 -65
  195. package/lib/commands/app-management.js +308 -301
  196. package/lib/commands/app-strings.js +24 -26
  197. package/lib/commands/appearance.js +54 -56
  198. package/lib/commands/audit.js +18 -20
  199. package/lib/commands/battery.js +35 -37
  200. package/lib/commands/biometric.js +44 -46
  201. package/lib/commands/certificate.js +226 -215
  202. package/lib/commands/clipboard.js +30 -32
  203. package/lib/commands/condition.js +98 -100
  204. package/lib/commands/content-size.js +36 -38
  205. package/lib/commands/context.js +495 -490
  206. package/lib/commands/deviceInfo.js +19 -20
  207. package/lib/commands/element.js +367 -357
  208. package/lib/commands/execute.js +72 -72
  209. package/lib/commands/file-movement.js +132 -134
  210. package/lib/commands/find.js +160 -159
  211. package/lib/commands/general.js +238 -231
  212. package/lib/commands/geolocation.js +6 -14
  213. package/lib/commands/gesture.js +525 -515
  214. package/lib/commands/increase-contrast.js +30 -32
  215. package/lib/commands/iohid.js +32 -34
  216. package/lib/commands/keyboard.js +49 -51
  217. package/lib/commands/keychains.js +12 -14
  218. package/lib/commands/localization.js +24 -26
  219. package/lib/commands/location.js +102 -104
  220. package/lib/commands/lock.js +38 -38
  221. package/lib/commands/log.js +197 -198
  222. package/lib/commands/memory.js +40 -42
  223. package/lib/commands/navigation.js +96 -100
  224. package/lib/commands/notifications.js +57 -59
  225. package/lib/commands/pasteboard.js +37 -39
  226. package/lib/commands/pcap.js +84 -86
  227. package/lib/commands/performance.js +132 -133
  228. package/lib/commands/permissions.js +67 -69
  229. package/lib/commands/proxy-helper.js +60 -61
  230. package/lib/commands/record-audio.js +115 -120
  231. package/lib/commands/recordscreen.js +145 -149
  232. package/lib/commands/screenshots.js +116 -116
  233. package/lib/commands/simctl.js +25 -29
  234. package/lib/commands/source.js +42 -46
  235. package/lib/commands/timeouts.js +59 -63
  236. package/lib/commands/web.js +878 -858
  237. package/lib/commands/xctest-record-screen.js +103 -105
  238. package/lib/commands/xctest.js +134 -139
  239. package/lib/driver.js +287 -235
  240. package/lib/execute-method-map.ts +9 -0
  241. package/npm-shrinkwrap.json +2 -2
  242. package/package.json +1 -1
  243. package/build/lib/commands/activeAppInfo.d.ts +0 -12
  244. package/build/lib/commands/activeAppInfo.d.ts.map +0 -1
  245. package/build/lib/commands/activeAppInfo.js +0 -15
  246. package/build/lib/commands/activeAppInfo.js.map +0 -1
  247. package/build/lib/commands/index.d.ts +0 -96
  248. package/build/lib/commands/index.d.ts.map +0 -1
  249. package/build/lib/commands/index.js +0 -100
  250. package/build/lib/commands/index.js.map +0 -1
  251. package/lib/commands/activeAppInfo.js +0 -14
  252. package/lib/commands/index.js +0 -95
@@ -1,117 +1,118 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getGeoLocation = getGeoLocation;
4
+ exports.setGeoLocation = setGeoLocation;
5
+ exports.mobileResetLocationService = mobileResetLocationService;
3
6
  const appium_ios_device_1 = require("appium-ios-device");
4
7
  const driver_1 = require("appium/driver");
5
8
  const support_1 = require("appium/support");
6
9
  const enum_1 = require("./enum");
7
10
  const utils_1 = require("../utils");
8
- exports.default = {
9
- /**
10
- * Returns location of the device under test.
11
- * The device under test must allow the location services for WDA
12
- * as 'Always' to get the location data correctly.
13
- *
14
- * The 'latitude', 'longitude' and 'altitude' could be zero even
15
- * if the Location Services are set to 'Always', because the device
16
- * needs some time to update the location data.
17
- *
18
- * For iOS 17, the return value could be the result of
19
- * "mobile:getSimulatedLocation" if the simulated location has been previously set
20
- * "mobile:setSimulatedLocation" already.
21
- *
22
- * @returns {Promise<import('./types').LocationWithAltitude>}
23
- * @throws {Error} If the device under test returns an error message.
24
- * i.e.: tvOS returns unsupported error
25
- * @this {XCUITestDriver}
26
- */
27
- async getGeoLocation() {
28
- // Currently we proxy the setGeoLocation to mobile:setSimulatedLocation for iOS 17+.
29
- // It would be helpful to address to use "mobile:getSimulatedLocation" for iOS 17+.
30
- if ((0, utils_1.isIos17OrNewer)(this.opts)) {
31
- const { latitude, longitude } = await this.mobileGetSimulatedLocation();
32
- if (latitude && longitude) {
33
- this.log.debug('Returning the geolocation that has been previously set by mobile:setSimulatedLocation. ' +
34
- 'mobile:resetSimulatedLocation can reset the location configuration.');
35
- return { latitude, longitude, altitude: 0 };
36
- }
37
- this.log.warn(`No location was set by mobile:setSimulatedLocation. Trying to return the location from the device.`);
38
- }
39
- // Please do not change the way to get the location here with '/wda/simulatedLocation'
40
- // endpoint because they could return different value before setting the simulated location.
41
- // '/wda/device/location' returns current device location information,
42
- // but '/wda/simulatedLocation' returns `null` values until the WDA process
43
- // sets a simulated location. After setting the value, both returns the same values.
44
- const { authorizationStatus, latitude, longitude, altitude } = /** @type {WDALocationInfo} */ (await this.proxyCommand('/wda/device/location', 'GET'));
45
- // '3' is 'Always' in the privacy
46
- // https://developer.apple.com/documentation/corelocation/clauthorizationstatus
47
- if (authorizationStatus !== enum_1.AuthorizationStatus.authorizedAlways) {
48
- throw this.log.errorWithException(`Location service must be set to 'Always' in order to ` +
49
- `retrieve the current geolocation data. Please set it up manually via ` +
50
- `'Settings > Privacy > Location Services -> WebDriverAgentRunner-Runner'. ` +
51
- `Or please use 'mobile:getSimulatedLocation'/'mobile:setSimulatedLocation' commands ` +
52
- `to simulate locations instead.`);
53
- }
54
- return { latitude, longitude, altitude };
55
- },
56
- /**
57
- * Set location of the device under test.
58
- *
59
- * iOS 17+ real device environment will be via "mobile:setSimulatedLocation" as
60
- * setting simulated location for XCTest session.
61
- *
62
- * @param {Partial<Location>} location
63
- * @this {XCUITestDriver}
64
- */
65
- async setGeoLocation(location) {
66
- let { latitude, longitude } = location;
67
- if (!support_1.util.hasValue(latitude) || !support_1.util.hasValue(longitude)) {
68
- throw new driver_1.errors.InvalidArgumentError(`Both latitude and longitude should be set`);
69
- }
70
- if (this.isSimulator()) {
71
- await /** @type {import('../driver').Simulator} */ (this.device).setGeolocation(`${latitude}`, `${longitude}`);
72
- return /** @type {Location} */ ({ latitude, longitude, altitude: 0 });
73
- }
74
- if ((0, utils_1.isIos17OrNewer)(this.opts)) {
75
- this.log.info(`Proxying to mobile:setSimulatedLocation method for iOS 17+ platform version`);
76
- await this.mobileSetSimulatedLocation(latitude, longitude);
77
- }
78
- else {
79
- const service = await appium_ios_device_1.services.startSimulateLocationService(this.opts.udid);
80
- try {
81
- service.setLocation(latitude, longitude);
82
- }
83
- catch (e) {
84
- throw this.log.errorWithException(`Can't set the location on device '${this.opts.udid}'. Original error: ${e.message}`);
85
- }
86
- finally {
87
- service.close();
88
- }
11
+ /**
12
+ * Returns location of the device under test.
13
+ * The device under test must allow the location services for WDA
14
+ * as 'Always' to get the location data correctly.
15
+ *
16
+ * The 'latitude', 'longitude' and 'altitude' could be zero even
17
+ * if the Location Services are set to 'Always', because the device
18
+ * needs some time to update the location data.
19
+ *
20
+ * For iOS 17, the return value could be the result of
21
+ * "mobile:getSimulatedLocation" if the simulated location has been previously set
22
+ * "mobile:setSimulatedLocation" already.
23
+ *
24
+ * @returns {Promise<import('./types').LocationWithAltitude>}
25
+ * @throws {Error} If the device under test returns an error message.
26
+ * i.e.: tvOS returns unsupported error
27
+ * @this {XCUITestDriver}
28
+ */
29
+ async function getGeoLocation() {
30
+ // Currently we proxy the setGeoLocation to mobile:setSimulatedLocation for iOS 17+.
31
+ // It would be helpful to address to use "mobile:getSimulatedLocation" for iOS 17+.
32
+ if ((0, utils_1.isIos17OrNewer)(this.opts)) {
33
+ const { latitude, longitude } = await this.mobileGetSimulatedLocation();
34
+ if (latitude && longitude) {
35
+ this.log.debug('Returning the geolocation that has been previously set by mobile:setSimulatedLocation. ' +
36
+ 'mobile:resetSimulatedLocation can reset the location configuration.');
37
+ return { latitude, longitude, altitude: 0 };
89
38
  }
39
+ this.log.warn(`No location was set by mobile:setSimulatedLocation. Trying to return the location from the device.`);
40
+ }
41
+ // Please do not change the way to get the location here with '/wda/simulatedLocation'
42
+ // endpoint because they could return different value before setting the simulated location.
43
+ // '/wda/device/location' returns current device location information,
44
+ // but '/wda/simulatedLocation' returns `null` values until the WDA process
45
+ // sets a simulated location. After setting the value, both returns the same values.
46
+ const { authorizationStatus, latitude, longitude, altitude } = /** @type {WDALocationInfo} */ (await this.proxyCommand('/wda/device/location', 'GET'));
47
+ // '3' is 'Always' in the privacy
48
+ // https://developer.apple.com/documentation/corelocation/clauthorizationstatus
49
+ if (authorizationStatus !== enum_1.AuthorizationStatus.authorizedAlways) {
50
+ throw this.log.errorWithException(`Location service must be set to 'Always' in order to ` +
51
+ `retrieve the current geolocation data. Please set it up manually via ` +
52
+ `'Settings > Privacy > Location Services -> WebDriverAgentRunner-Runner'. ` +
53
+ `Or please use 'mobile:getSimulatedLocation'/'mobile:setSimulatedLocation' commands ` +
54
+ `to simulate locations instead.`);
55
+ }
56
+ return { latitude, longitude, altitude };
57
+ }
58
+ /**
59
+ * Set location of the device under test.
60
+ *
61
+ * iOS 17+ real device environment will be via "mobile:setSimulatedLocation" as
62
+ * setting simulated location for XCTest session.
63
+ *
64
+ * @param {Partial<Location>} location
65
+ * @this {XCUITestDriver}
66
+ */
67
+ async function setGeoLocation(location) {
68
+ let { latitude, longitude } = location;
69
+ if (!support_1.util.hasValue(latitude) || !support_1.util.hasValue(longitude)) {
70
+ throw new driver_1.errors.InvalidArgumentError(`Both latitude and longitude should be set`);
71
+ }
72
+ if (this.isSimulator()) {
73
+ await /** @type {import('../driver').Simulator} */ (this.device).setGeolocation(`${latitude}`, `${longitude}`);
90
74
  return /** @type {Location} */ ({ latitude, longitude, altitude: 0 });
91
- },
92
- /**
93
- * Reset the location service on real device.
94
- * Raises not implemented error for simulator.
95
- * @throws {Error} If the device is simulator, or 'resetLocation' raises an error.
96
- * @this {XCUITestDriver}
97
- */
98
- async mobileResetLocationService() {
99
- if (this.isSimulator()) {
100
- throw new driver_1.errors.NotImplementedError();
101
- }
75
+ }
76
+ if ((0, utils_1.isIos17OrNewer)(this.opts)) {
77
+ this.log.info(`Proxying to mobile:setSimulatedLocation method for iOS 17+ platform version`);
78
+ await this.mobileSetSimulatedLocation(latitude, longitude);
79
+ }
80
+ else {
102
81
  const service = await appium_ios_device_1.services.startSimulateLocationService(this.opts.udid);
103
82
  try {
104
- service.resetLocation();
83
+ service.setLocation(latitude, longitude);
105
84
  }
106
- catch (err) {
107
- throw this.log.errorWithException(`Failed to reset the location on the device on device '${this.opts.udid}'. ` +
108
- `Original error: ${err.message}`);
85
+ catch (e) {
86
+ throw this.log.errorWithException(`Can't set the location on device '${this.opts.udid}'. Original error: ${e.message}`);
109
87
  }
110
88
  finally {
111
89
  service.close();
112
90
  }
113
- },
114
- };
91
+ }
92
+ return /** @type {Location} */ ({ latitude, longitude, altitude: 0 });
93
+ }
94
+ /**
95
+ * Reset the location service on real device.
96
+ * Raises not implemented error for simulator.
97
+ * @throws {Error} If the device is simulator, or 'resetLocation' raises an error.
98
+ * @this {XCUITestDriver}
99
+ */
100
+ async function mobileResetLocationService() {
101
+ if (this.isSimulator()) {
102
+ throw new driver_1.errors.NotImplementedError();
103
+ }
104
+ const service = await appium_ios_device_1.services.startSimulateLocationService(this.opts.udid);
105
+ try {
106
+ service.resetLocation();
107
+ }
108
+ catch (err) {
109
+ throw this.log.errorWithException(`Failed to reset the location on the device on device '${this.opts.udid}'. ` +
110
+ `Original error: ${err.message}`);
111
+ }
112
+ finally {
113
+ service.close();
114
+ }
115
+ }
115
116
  /**
116
117
  * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
117
118
  * @typedef {import('./types').WDALocationInfo} WDALocationInfo
@@ -1 +1 @@
1
- {"version":3,"file":"location.js","sourceRoot":"","sources":["../../../lib/commands/location.js"],"names":[],"mappings":";;AAAA,yDAA2C;AAC3C,0CAAqC;AACrC,4CAAoC;AACpC,iCAA2C;AAC3C,oCAA0C;AAE1C,kBAAe;IACb;;;;;;;;;;;;;;;;;OAiBG;IACH,KAAK,CAAC,cAAc;QAClB,oFAAo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CAAC;YAAS,CAAC;QACT,OAAO,CAAC,KAAK,EAAE,CAAC;IAClB,CAAC;AACH,CAAC;AAED;;;;GAIG"}
@@ -1,26 +1,23 @@
1
- declare namespace _default {
2
- /**
3
- * Lock the device (and optionally unlock the device after a certain amount of time)
4
- *
5
- * @param {number|string} [seconds] - the number of seconds after which to unlock the device. Set to `0` or leave empty to require manual unlock (do not automatically unlock).
6
- * @defaultValue 0
7
- * @this {XCUITestDriver}
8
- */
9
- function lock(this: import("../driver").XCUITestDriver, seconds?: number | string): Promise<void>;
10
- /**
11
- * Unlock the device
12
- *
13
- * @this {XCUITestDriver}
14
- */
15
- function unlock(this: import("../driver").XCUITestDriver): Promise<void>;
16
- /**
17
- * Determine whether the device is locked
18
- *
19
- * @this {XCUITestDriver}
20
- * @returns {Promise<boolean>} `true` if the device is locked, `false` otherwise
21
- */
22
- function isLocked(this: import("../driver").XCUITestDriver): Promise<boolean>;
23
- }
24
- export default _default;
1
+ /**
2
+ * Lock the device (and optionally unlock the device after a certain amount of time)
3
+ *
4
+ * @param {number|string} [seconds] - the number of seconds after which to unlock the device. Set to `0` or leave empty to require manual unlock (do not automatically unlock).
5
+ * @defaultValue 0
6
+ * @this {XCUITestDriver}
7
+ */
8
+ export function lock(this: import("../driver").XCUITestDriver, seconds?: number | string): Promise<void>;
9
+ /**
10
+ * Unlock the device
11
+ *
12
+ * @this {XCUITestDriver}
13
+ */
14
+ export function unlock(this: import("../driver").XCUITestDriver): Promise<void>;
15
+ /**
16
+ * Determine whether the device is locked
17
+ *
18
+ * @this {XCUITestDriver}
19
+ * @returns {Promise<boolean>} `true` if the device is locked, `false` otherwise
20
+ */
21
+ export function isLocked(this: import("../driver").XCUITestDriver): Promise<boolean>;
25
22
  export type XCUITestDriver = import("../driver").XCUITestDriver;
26
23
  //# sourceMappingURL=lock.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../../lib/commands/lock.js"],"names":[],"mappings":";IAGE;;;;;;OAMG;IACH,kEAJW,MAAM,GAAC,MAAM,iBAiBvB;IACD;;;;OAIG;IACH,yEAEC;IACD;;;;;OAKG;IACH,6DAFa,OAAO,CAAC,OAAO,CAAC,CAI5B;;;6BAIU,OAAO,WAAW,EAAE,cAAc"}
1
+ {"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../../lib/commands/lock.js"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,yEAJW,MAAM,GAAC,MAAM,iBAiBvB;AAED;;;;GAIG;AACH,gFAEC;AAED;;;;;GAKG;AACH,oEAFa,OAAO,CAAC,OAAO,CAAC,CAI5B;6BAGY,OAAO,WAAW,EAAE,cAAc"}
@@ -3,45 +3,46 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.lock = lock;
7
+ exports.unlock = unlock;
8
+ exports.isLocked = isLocked;
6
9
  const bluebird_1 = __importDefault(require("bluebird"));
7
- exports.default = {
8
- /**
9
- * Lock the device (and optionally unlock the device after a certain amount of time)
10
- *
11
- * @param {number|string} [seconds] - the number of seconds after which to unlock the device. Set to `0` or leave empty to require manual unlock (do not automatically unlock).
12
- * @defaultValue 0
13
- * @this {XCUITestDriver}
14
- */
15
- async lock(seconds) {
16
- await this.proxyCommand('/wda/lock', 'POST');
17
- if (isNaN(Number(seconds))) {
18
- return;
19
- }
20
- const floatSeconds = parseFloat(String(seconds));
21
- if (floatSeconds <= 0) {
22
- return;
23
- }
24
- await bluebird_1.default.delay(floatSeconds * 1000);
25
- await this.proxyCommand('/wda/unlock', 'POST');
26
- },
27
- /**
28
- * Unlock the device
29
- *
30
- * @this {XCUITestDriver}
31
- */
32
- async unlock() {
33
- await this.proxyCommand('/wda/unlock', 'POST');
34
- },
35
- /**
36
- * Determine whether the device is locked
37
- *
38
- * @this {XCUITestDriver}
39
- * @returns {Promise<boolean>} `true` if the device is locked, `false` otherwise
40
- */
41
- async isLocked() {
42
- return /** @type {boolean} */ (await this.proxyCommand('/wda/locked', 'GET'));
43
- },
44
- };
10
+ /**
11
+ * Lock the device (and optionally unlock the device after a certain amount of time)
12
+ *
13
+ * @param {number|string} [seconds] - the number of seconds after which to unlock the device. Set to `0` or leave empty to require manual unlock (do not automatically unlock).
14
+ * @defaultValue 0
15
+ * @this {XCUITestDriver}
16
+ */
17
+ async function lock(seconds) {
18
+ await this.proxyCommand('/wda/lock', 'POST');
19
+ if (isNaN(Number(seconds))) {
20
+ return;
21
+ }
22
+ const floatSeconds = parseFloat(String(seconds));
23
+ if (floatSeconds <= 0) {
24
+ return;
25
+ }
26
+ await bluebird_1.default.delay(floatSeconds * 1000);
27
+ await this.proxyCommand('/wda/unlock', 'POST');
28
+ }
29
+ /**
30
+ * Unlock the device
31
+ *
32
+ * @this {XCUITestDriver}
33
+ */
34
+ async function unlock() {
35
+ await this.proxyCommand('/wda/unlock', 'POST');
36
+ }
37
+ /**
38
+ * Determine whether the device is locked
39
+ *
40
+ * @this {XCUITestDriver}
41
+ * @returns {Promise<boolean>} `true` if the device is locked, `false` otherwise
42
+ */
43
+ async function isLocked() {
44
+ return /** @type {boolean} */ (await this.proxyCommand('/wda/locked', 'GET'));
45
+ }
45
46
  /**
46
47
  * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
47
48
  */
@@ -1 +1 @@
1
- {"version":3,"file":"lock.js","sourceRoot":"","sources":["../../../lib/commands/lock.js"],"names":[],"mappings":";;;;;AAAA,wDAAyB;AAEzB,kBAAe;IACb;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,CAAC,OAAO;QAChB,MAAM,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;QAC7C,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;YAC3B,OAAO;QACT,CAAC;QAED,MAAM,YAAY,GAAG,UAAU,CAAC,MAAM,CAAC,OAAO,CAA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C,CAAC;AACjD,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,QAAQ;IAC5B,OAAO,sBAAsB,CAAC,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC,CAAC;AAChF,CAAC;AAED;;GAEG"}
@@ -1,3 +1,44 @@
1
+ /**
2
+ *
3
+ * @param {XCUITestDriverLogTypes} logType
4
+ * @param {Partial<Record<XCUITestDriverLogTypes,{getLogs(): Promise<any>}>>} [logsContainer]
5
+ * @this {XCUITestDriver}
6
+ */
7
+ export function extractLogs(this: import("../driver").XCUITestDriver, logType: XCUITestDriverLogTypes, logsContainer?: Partial<Record<XCUITestDriverLogTypes, {
8
+ getLogs(): Promise<any>;
9
+ }>>): Promise<any>;
10
+ /**
11
+ * @this {XCUITestDriver}
12
+ */
13
+ export function startLogCapture(this: import("../driver").XCUITestDriver): Promise<boolean>;
14
+ export class startLogCapture {
15
+ logs: import("../driver").DriverLogs;
16
+ }
17
+ /**
18
+ * Starts an iOS system logs broadcast websocket.
19
+ *
20
+ * The websocket listens on the same host and port as Appium. The endpoint created is `/ws/session/:sessionId:/appium/syslog`.
21
+ *
22
+ * If the websocket is already running, this command does nothing.
23
+ *
24
+ * Each connected webcoket listener will receive syslog lines as soon as they are visible to Appium.
25
+ * @see https://appiumpro.com/editions/55-using-mobile-execution-commands-to-continuously-stream-device-logs-with-appium
26
+ * @returns {Promise<void>}
27
+ * @this {XCUITestDriver}
28
+ */
29
+ export function mobileStartLogsBroadcast(this: import("../driver").XCUITestDriver): Promise<void>;
30
+ export class mobileStartLogsBroadcast {
31
+ _syslogWebsocketListener: ((logRecord: {
32
+ message: string;
33
+ }) => void) | null;
34
+ }
35
+ /**
36
+ * Stops the syslog broadcasting wesocket server previously started by `mobile: startLogsBroadcast`.
37
+ * If no websocket server is running, this command does nothing.
38
+ * @this {XCUITestDriver}
39
+ * @returns {Promise<void>}
40
+ */
41
+ export function mobileStopLogsBroadcast(this: import("../driver").XCUITestDriver): Promise<void>;
1
42
  /**
2
43
  * https://w3c.github.io/webdriver-bidi/#event-log-entryAdded
3
44
  *
@@ -8,43 +49,7 @@
8
49
  * @returns {[EE, import('./types').LogListener]}
9
50
  */
10
51
  export function assignBiDiLogListener<EE extends import("node:events").EventEmitter>(this: import("../driver").XCUITestDriver, logEmitter: EE, properties: BiDiListenerProperties): [EE, import("./types").LogListener];
11
- declare namespace _default {
12
- export { SUPPORTED_LOG_TYPES as supportedLogTypes };
13
- /**
14
- *
15
- * @param {XCUITestDriverLogTypes} logType
16
- * @param {Partial<Record<XCUITestDriverLogTypes,{getLogs(): Promise<any>}>>} [logsContainer]
17
- * @this {XCUITestDriver}
18
- */
19
- export function extractLogs(this: import("../driver").XCUITestDriver, logType: XCUITestDriverLogTypes, logsContainer?: Partial<Record<XCUITestDriverLogTypes, {
20
- getLogs(): Promise<any>;
21
- }>>): Promise<any>;
22
- /**
23
- * @this {XCUITestDriver}
24
- */
25
- export function startLogCapture(this: import("../driver").XCUITestDriver): Promise<boolean>;
26
- /**
27
- * Starts an iOS system logs broadcast websocket.
28
- *
29
- * The websocket listens on the same host and port as Appium. The endpoint created is `/ws/session/:sessionId:/appium/syslog`.
30
- *
31
- * If the websocket is already running, this command does nothing.
32
- *
33
- * Each connected webcoket listener will receive syslog lines as soon as they are visible to Appium.
34
- * @see https://appiumpro.com/editions/55-using-mobile-execution-commands-to-continuously-stream-device-logs-with-appium
35
- * @returns {Promise<void>}
36
- * @this {XCUITestDriver}
37
- */
38
- export function mobileStartLogsBroadcast(this: import("../driver").XCUITestDriver): Promise<void>;
39
- /**
40
- * Stops the syslog broadcasting wesocket server previously started by `mobile: startLogsBroadcast`.
41
- * If no websocket server is running, this command does nothing.
42
- * @this {XCUITestDriver}
43
- * @returns {Promise<void>}
44
- */
45
- export function mobileStopLogsBroadcast(this: import("../driver").XCUITestDriver): Promise<void>;
46
- }
47
- export default _default;
52
+ export const supportedLogTypes: import("@appium/types").LogDefRecord;
48
53
  export type XCUITestDriver = import("../driver").XCUITestDriver;
49
54
  export type XCUITestDriverLogTypes = keyof typeof SUPPORTED_LOG_TYPES;
50
55
  export type AppiumServer = import("@appium/types").AppiumServer;
@@ -59,4 +64,5 @@ export type BiDiListenerProperties = {
59
64
  * @privateRemarks The return types for these getters should be specified
60
65
  */
61
66
  declare const SUPPORTED_LOG_TYPES: import("@appium/types").LogDefRecord;
67
+ export {};
62
68
  //# sourceMappingURL=log.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../lib/commands/log.js"],"names":[],"mappings":"AAmSA;;;;;;;;GAQG;AACH,sCANkD,EAAE,SAAvC,OAAQ,aAAa,EAAE,YAAa,wDAEtC,EAAE,cACF,sBAAsB,GACpB,CAAC,EAAE,EAAE,OAAO,SAAS,EAAE,WAAW,CAAC,CAe/C;;;IAvOC;;;;;OAKG;IACH,+EAJW,sBAAsB,kBACtB,OAAO,CAAC,MAAM,CAAC,sBAAsB,EAAC;QAAC,OAAO,IAAI,OAAO,CAAC,GAAG,CAAC,CAAA;KAAC,CAAC,CAAC,gBAwB3E;IAED;;OAEG;IACH,4FAqFC;IAED;;;;;;;;;;;OAWG;IACH,oFAHa,OAAO,CAAC,IAAI,CAAC,CA8DzB;IAED;;;;;OAKG;IACH,mFAFa,OAAO,CAAC,IAAI,CAAC,CAUzB;;;6BA4BU,OAAO,WAAW,EAAE,cAAc;qCAClC,MAAM,OAAO,mBAAmB;2BAChC,OAAO,eAAe,EAAE,YAAY;;UAKnC,MAAM;;;oCAGS,OAAO,SAAS,EAAE,QAAQ;;AAjSvD;;;GAGG;AACH,mCAHU,OAAO,eAAe,EAAE,YAAY,CAkC5C"}
1
+ {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../../lib/commands/log.js"],"names":[],"mappings":"AAqEA;;;;;GAKG;AACH,+EAJW,sBAAsB,kBACtB,OAAO,CAAC,MAAM,CAAC,sBAAsB,EAAC;IAAC,OAAO,IAAI,OAA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