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,19 +1,39 @@
1
- declare namespace _default {
2
- /**
3
- * Get all available ConditionInducer configuration information, which can be used with
4
- * {@linkcode XCUITestDriver.enableConditionInducer}
5
- * @returns {Promise<Condition[]>}
6
- * @since 4.9.0
7
- * @see {@link https://help.apple.com/xcode/mac/current/#/dev308429d42}
8
- * @this {XCUITestDriver}
9
- */
10
- function listConditionInducers(this: import("../driver").XCUITestDriver): Promise<Condition[]>;
1
+ /**
2
+ * Get all available ConditionInducer configuration information, which can be used with
3
+ * {@linkcode XCUITestDriver.enableConditionInducer}
4
+ * @returns {Promise<Condition[]>}
5
+ * @since 4.9.0
6
+ * @see {@link https://help.apple.com/xcode/mac/current/#/dev308429d42}
7
+ * @this {XCUITestDriver}
8
+ */
9
+ export function listConditionInducers(this: import("../driver").XCUITestDriver): Promise<Condition[]>;
10
+ /**
11
+ * Enable a "condition inducer". You can create a condition on a connected device to test your app under adverse conditions,
12
+ * such as poor network connectivity or thermal constraints. When you start a device condition,
13
+ * the operating system on the device behaves as if its environment has changed. The device
14
+ * condition remains active until you stop the device condition or disconnect the device. For
15
+ * example, you can start a device condition, run your app, monitor your app's energy usage, and
16
+ * then stop the condition.
17
+ *
18
+ * (Note: the socket needs to remain connected during operation)
19
+ * (Note: Device conditions are available only for real devices running iOS 13.0 and later.)
20
+ *
21
+ * @param {string} conditionID - Determine which condition IDs are available with the {@linkcode XCUITestDriver.listConditionInducers} command
22
+ * @param {string} profileID - Determine which profile IDs are available with the {@linkcode XCUITestDriver.listConditionInducers} command
23
+ * @returns {Promise<boolean>} `true` if enabling the condition succeeded
24
+ * @throws {Error} If you try to start another Condition and the previous Condition has not stopped
25
+ * @since 4.9.0
26
+ * @see {@link https://help.apple.com/xcode/mac/current/#/dev308429d42}
27
+ * @this {XCUITestDriver}
28
+ */
29
+ export function enableConditionInducer(this: import("../driver").XCUITestDriver, conditionID: string, profileID: string): Promise<boolean>;
30
+ export class enableConditionInducer {
11
31
  /**
12
32
  * Enable a "condition inducer". You can create a condition on a connected device to test your app under adverse conditions,
13
33
  * such as poor network connectivity or thermal constraints. When you start a device condition,
14
34
  * the operating system on the device behaves as if its environment has changed. The device
15
35
  * condition remains active until you stop the device condition or disconnect the device. For
16
- * example, you can start a device condition, run your app, monitor your apps energy usage, and
36
+ * example, you can start a device condition, run your app, monitor your app's energy usage, and
17
37
  * then stop the condition.
18
38
  *
19
39
  * (Note: the socket needs to remain connected during operation)
@@ -27,22 +47,25 @@ declare namespace _default {
27
47
  * @see {@link https://help.apple.com/xcode/mac/current/#/dev308429d42}
28
48
  * @this {XCUITestDriver}
29
49
  */
30
- function enableConditionInducer(this: import("../driver").XCUITestDriver, conditionID: string, profileID: string): Promise<boolean>;
31
- /**
32
- * Disable a condition inducer enabled with {@linkcode XCUITestDriver.enableConditionInducer} Usually
33
- * a persistent connection is maintained after the condition inducer is enabled, and this method
34
- * is only valid for the currently enabled connection. If the connection is disconnected, the
35
- * condition inducer will be automatically disabled
36
- *
37
- * (Note: this is also automatically called upon session cleanup)
38
- * @returns {Promise<boolean>} `true` if disable the condition succeeded
39
- * @since 4.9.0
40
- * @see {@link https://help.apple.com/xcode/mac/current/#/dev308429d42}
41
- * @this {XCUITestDriver}
42
- */
43
- function disableConditionInducer(this: import("../driver").XCUITestDriver): Promise<boolean>;
50
+ constructor(this: import("../driver").XCUITestDriver, conditionID: string, profileID: string);
51
+ _conditionInducerService: any;
52
+ }
53
+ /**
54
+ * Disable a condition inducer enabled with {@linkcode XCUITestDriver.enableConditionInducer} Usually
55
+ * a persistent connection is maintained after the condition inducer is enabled, and this method
56
+ * is only valid for the currently enabled connection. If the connection is disconnected, the
57
+ * condition inducer will be automatically disabled
58
+ *
59
+ * (Note: this is also automatically called upon session cleanup)
60
+ * @returns {Promise<boolean>} `true` if disable the condition succeeded
61
+ * @since 4.9.0
62
+ * @see {@link https://help.apple.com/xcode/mac/current/#/dev308429d42}
63
+ * @this {XCUITestDriver}
64
+ */
65
+ export function disableConditionInducer(this: import("../driver").XCUITestDriver): Promise<boolean>;
66
+ export class disableConditionInducer {
67
+ _conditionInducerService: any;
44
68
  }
45
- export default _default;
46
69
  export type Profile = {
47
70
  name: string;
48
71
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"condition.d.ts","sourceRoot":"","sources":["../../../lib/commands/condition.js"],"names":[],"mappings":";IAuDE;;;;;;;OAOG;IACH,0EALa,OAAO,CAAC,SAAS,EAAE,CAAC,CAiBhC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACH,uFARW,MAAM,aACN,MAAM,GACJ,OAAO,CAAC,OAAO,CAAC,CA0B5B;IAED;;;;;;;;;;;OAWG;IACH,4EALa,OAAO,CAAC,OAAO,CAAC,CA0B5B;;;;UAxIW,MAAM;;;;gBACN,MAAM;;;;iBACN,MAAM;;;;;;cAMN,OAAO,EAAE;;;;gBACT,MAAM;oBACN,OAAO;mBACP,OAAO;gBACP,OAAO;;;;cACP,OAAO;;;;mBACP,MAAM;;6BA8HP,OAAO,WAAW,EAAE,cAAc"}
1
+ {"version":3,"file":"condition.d.ts","sourceRoot":"","sources":["../../../lib/commands/condition.js"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,iFALa,OAAO,CAAC,SAAS,EAAE,CAAC,CAiBhC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,8FARW,MAAM,aACN,MAAM,GACJ,OAAO,CAAC,OAAO,CAAC,CA0B5B;;IAvCD;;;;;;;;;;;;;;;;;;OAkBG;IACH,mEARW,MAAM,aACN,MAAM,EA2BhB;IAbC,8BAAuF;;AAezF;;;;;;;;;;;GAWG;AACH,mFALa,OAAO,CAAC,OAAO,CAAC,CA0B5B;;IAHK,8BAAoC;;;UAiB5B,MAAM;;;;gBACN,MAAM;;;;iBACN,MAAM;;;;;;cAMN,OAAO,EAAE;;;;gBACT,MAAM;oBACN,OAAO;mBACP,OAAO;gBACP,OAAO;;;;cACP,OAAO;;;;mBACP,MAAM;;6BA0BP,OAAO,WAAW,EAAE,cAAc"}
@@ -3,8 +3,95 @@ 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.listConditionInducers = listConditionInducers;
7
+ exports.enableConditionInducer = enableConditionInducer;
8
+ exports.disableConditionInducer = disableConditionInducer;
6
9
  const appium_ios_device_1 = require("appium-ios-device");
7
10
  const lodash_1 = __importDefault(require("lodash"));
11
+ /**
12
+ * Get all available ConditionInducer configuration information, which can be used with
13
+ * {@linkcode XCUITestDriver.enableConditionInducer}
14
+ * @returns {Promise<Condition[]>}
15
+ * @since 4.9.0
16
+ * @see {@link https://help.apple.com/xcode/mac/current/#/dev308429d42}
17
+ * @this {XCUITestDriver}
18
+ */
19
+ async function listConditionInducers() {
20
+ requireConditionInducerCompatibleDevice.bind(this);
21
+ const conditionInducerService = await appium_ios_device_1.services.startInstrumentService(this.device.udid);
22
+ try {
23
+ const ret = await conditionInducerService.callChannel(appium_ios_device_1.INSTRUMENT_CHANNEL.CONDITION_INDUCER, 'availableConditionInducers');
24
+ return ret.selector;
25
+ }
26
+ finally {
27
+ conditionInducerService.close();
28
+ }
29
+ }
30
+ /**
31
+ * Enable a "condition inducer". You can create a condition on a connected device to test your app under adverse conditions,
32
+ * such as poor network connectivity or thermal constraints. When you start a device condition,
33
+ * the operating system on the device behaves as if its environment has changed. The device
34
+ * condition remains active until you stop the device condition or disconnect the device. For
35
+ * example, you can start a device condition, run your app, monitor your app's energy usage, and
36
+ * then stop the condition.
37
+ *
38
+ * (Note: the socket needs to remain connected during operation)
39
+ * (Note: Device conditions are available only for real devices running iOS 13.0 and later.)
40
+ *
41
+ * @param {string} conditionID - Determine which condition IDs are available with the {@linkcode XCUITestDriver.listConditionInducers} command
42
+ * @param {string} profileID - Determine which profile IDs are available with the {@linkcode XCUITestDriver.listConditionInducers} command
43
+ * @returns {Promise<boolean>} `true` if enabling the condition succeeded
44
+ * @throws {Error} If you try to start another Condition and the previous Condition has not stopped
45
+ * @since 4.9.0
46
+ * @see {@link https://help.apple.com/xcode/mac/current/#/dev308429d42}
47
+ * @this {XCUITestDriver}
48
+ */
49
+ async function enableConditionInducer(conditionID, profileID) {
50
+ requireConditionInducerCompatibleDevice.bind(this);
51
+ if (this._conditionInducerService && !this._conditionInducerService._socketClient.destroyed) {
52
+ throw this.log.errorWithException(`Condition inducer has been started. A condition is already active.`);
53
+ }
54
+ this._conditionInducerService = await appium_ios_device_1.services.startInstrumentService(this.device.udid);
55
+ const ret = await this._conditionInducerService.callChannel(appium_ios_device_1.INSTRUMENT_CHANNEL.CONDITION_INDUCER, 'enableConditionWithIdentifier:profileIdentifier:', conditionID, profileID);
56
+ if (!lodash_1.default.isBoolean(ret.selector)) {
57
+ this._conditionInducerService.close();
58
+ this._conditionInducerService = null;
59
+ throw this.log.errorWithException(`Enable condition inducer error: '${JSON.stringify(ret.selector)}'`);
60
+ }
61
+ return ret.selector;
62
+ }
63
+ /**
64
+ * Disable a condition inducer enabled with {@linkcode XCUITestDriver.enableConditionInducer} Usually
65
+ * a persistent connection is maintained after the condition inducer is enabled, and this method
66
+ * is only valid for the currently enabled connection. If the connection is disconnected, the
67
+ * condition inducer will be automatically disabled
68
+ *
69
+ * (Note: this is also automatically called upon session cleanup)
70
+ * @returns {Promise<boolean>} `true` if disable the condition succeeded
71
+ * @since 4.9.0
72
+ * @see {@link https://help.apple.com/xcode/mac/current/#/dev308429d42}
73
+ * @this {XCUITestDriver}
74
+ */
75
+ async function disableConditionInducer() {
76
+ if (!this._conditionInducerService) {
77
+ this.log.warn('Condition inducer server is not started');
78
+ return false;
79
+ }
80
+ try {
81
+ const ret = await this._conditionInducerService.callChannel(appium_ios_device_1.INSTRUMENT_CHANNEL.CONDITION_INDUCER, 'disableActiveCondition');
82
+ if (!lodash_1.default.isBoolean(ret.selector)) {
83
+ this.log.warn(`Disable condition inducer error: '${JSON.stringify(ret.selector)}'`);
84
+ return false;
85
+ }
86
+ return ret.selector;
87
+ }
88
+ finally {
89
+ if (this._conditionInducerService) {
90
+ this._conditionInducerService.close();
91
+ this._conditionInducerService = null;
92
+ }
93
+ }
94
+ }
8
95
  /**
9
96
  * @this {XCUITestDriver}
10
97
  * @returns {void}
@@ -53,92 +140,6 @@ function requireConditionInducerCompatibleDevice() {
53
140
  * "isActive": false
54
141
  * }
55
142
  */
56
- exports.default = {
57
- /**
58
- * Get all available ConditionInducer configuration information, which can be used with
59
- * {@linkcode XCUITestDriver.enableConditionInducer}
60
- * @returns {Promise<Condition[]>}
61
- * @since 4.9.0
62
- * @see {@link https://help.apple.com/xcode/mac/current/#/dev308429d42}
63
- * @this {XCUITestDriver}
64
- */
65
- async listConditionInducers() {
66
- requireConditionInducerCompatibleDevice.bind(this);
67
- const conditionInducerService = await appium_ios_device_1.services.startInstrumentService(this.device.udid);
68
- try {
69
- const ret = await conditionInducerService.callChannel(appium_ios_device_1.INSTRUMENT_CHANNEL.CONDITION_INDUCER, 'availableConditionInducers');
70
- return ret.selector;
71
- }
72
- finally {
73
- conditionInducerService.close();
74
- }
75
- },
76
- /**
77
- * Enable a "condition inducer". You can create a condition on a connected device to test your app under adverse conditions,
78
- * such as poor network connectivity or thermal constraints. When you start a device condition,
79
- * the operating system on the device behaves as if its environment has changed. The device
80
- * condition remains active until you stop the device condition or disconnect the device. For
81
- * example, you can start a device condition, run your app, monitor your app’s energy usage, and
82
- * then stop the condition.
83
- *
84
- * (Note: the socket needs to remain connected during operation)
85
- * (Note: Device conditions are available only for real devices running iOS 13.0 and later.)
86
- *
87
- * @param {string} conditionID - Determine which condition IDs are available with the {@linkcode XCUITestDriver.listConditionInducers} command
88
- * @param {string} profileID - Determine which profile IDs are available with the {@linkcode XCUITestDriver.listConditionInducers} command
89
- * @returns {Promise<boolean>} `true` if enabling the condition succeeded
90
- * @throws {Error} If you try to start another Condition and the previous Condition has not stopped
91
- * @since 4.9.0
92
- * @see {@link https://help.apple.com/xcode/mac/current/#/dev308429d42}
93
- * @this {XCUITestDriver}
94
- */
95
- async enableConditionInducer(conditionID, profileID) {
96
- requireConditionInducerCompatibleDevice.bind(this);
97
- if (this._conditionInducerService && !this._conditionInducerService._socketClient.destroyed) {
98
- throw this.log.errorWithException(`Condition inducer has been started. A condition is already active.`);
99
- }
100
- this._conditionInducerService = await appium_ios_device_1.services.startInstrumentService(this.device.udid);
101
- const ret = await this._conditionInducerService.callChannel(appium_ios_device_1.INSTRUMENT_CHANNEL.CONDITION_INDUCER, 'enableConditionWithIdentifier:profileIdentifier:', conditionID, profileID);
102
- if (!lodash_1.default.isBoolean(ret.selector)) {
103
- this._conditionInducerService.close();
104
- this._conditionInducerService = null;
105
- throw this.log.errorWithException(`Enable condition inducer error: '${JSON.stringify(ret.selector)}'`);
106
- }
107
- return ret.selector;
108
- },
109
- /**
110
- * Disable a condition inducer enabled with {@linkcode XCUITestDriver.enableConditionInducer} Usually
111
- * a persistent connection is maintained after the condition inducer is enabled, and this method
112
- * is only valid for the currently enabled connection. If the connection is disconnected, the
113
- * condition inducer will be automatically disabled
114
- *
115
- * (Note: this is also automatically called upon session cleanup)
116
- * @returns {Promise<boolean>} `true` if disable the condition succeeded
117
- * @since 4.9.0
118
- * @see {@link https://help.apple.com/xcode/mac/current/#/dev308429d42}
119
- * @this {XCUITestDriver}
120
- */
121
- async disableConditionInducer() {
122
- if (!this._conditionInducerService) {
123
- this.log.warn('Condition inducer server is not started');
124
- return false;
125
- }
126
- try {
127
- const ret = await this._conditionInducerService.callChannel(appium_ios_device_1.INSTRUMENT_CHANNEL.CONDITION_INDUCER, 'disableActiveCondition');
128
- if (!lodash_1.default.isBoolean(ret.selector)) {
129
- this.log.warn(`Disable condition inducer error: '${JSON.stringify(ret.selector)}'`);
130
- return false;
131
- }
132
- return ret.selector;
133
- }
134
- finally {
135
- if (this._conditionInducerService) {
136
- this._conditionInducerService.close();
137
- this._conditionInducerService = null;
138
- }
139
- }
140
- },
141
- };
142
143
  /**
143
144
  * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
144
145
  */
@@ -1 +1 @@
1
- {"version":3,"file":"condition.js","sourceRoot":"","sources":["../../../lib/commands/condition.js"],"names":[],"mappings":";;;;;AAAA,yDAA+D;AAC/D,oDAAuB;AAEvB;;;GAGG;AACH,SAAS,uCAAuC;IAC9C,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;QACvB,MAAM,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,8CAA8C,CAAC,CAAC;IACpF,CAAC;AACH,CAAC;AAED;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,kBAAe;IACb;;;;;;;OAOG;IACH,KAAK,CAAC,qBAAqB;QACzB,uCAAuC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnD,MAAM,uBAAuB,GAAG,MAAM,4BAAQ,CAAC,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACxF,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,MAAM,uBAAuB,CAAC,WAAW,CACnD,sCAAkB,CAAC,iBAAiB,EACpC,4BAA4B,CAC7B,CAAC;YACF,OAAO,GAAG,CAAC,QAAQ,CAAC;QACtB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IAAI,CAAC,gBAAC,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC/B,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,qCAAqC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YACpF,OAAO,KAAK,CAAC;QACf,CAAC;QACD,OAAO,GAAG,CAAC,QAAQ,CAAC;IACtB,CAAC;YAAS,CAAC;QACT,IAAI,IAAI,CAAC,wBAAwB,EAAE,CAAC;YAClC,IAAI,CAAC,wBAAwB,CAAC,KAAK,EAAE,CAAC;YACtC,IAAI,CAAC,wBAAwB,GAAG,IAAI,CAAC;QACvC,CAAC;IACH,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,SAAS,uCAAuC;IAC9C,IAAI,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;QACvB,MAAM,IAAI,CAAC,GAAG,CAAC,kBAAkB,CAAC,8CAA8C,CAAC,CAAC;IACpF,CAAC;AACH,CAAC;AAED;;;;;GAKG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH;;GAEG"}
@@ -1,32 +1,29 @@
1
- declare namespace _default {
2
- /**
3
- * Sets content size for the given simulator.
4
- *
5
- * @since Xcode 15 (but lower xcode could have this command)
6
- * @param {ContentSizeAction} size - The content size action to set. Acceptable value is
7
- * extra-small, small, medium, large, extra-large, extra-extra-large,
8
- * extra-extra-extra-large, accessibility-medium, accessibility-large,
9
- * accessibility-extra-large, accessibility-extra-extra-large,
10
- * accessibility-extra-extra-extra-large with Xcode 16.2.
11
- * @throws {Error} if the current platform does not support content size appearance changes
12
- * @this {XCUITestDriver}
13
- */
14
- function mobileSetContentSize(this: import("../driver").XCUITestDriver, size: ContentSizeAction): Promise<void>;
15
- /**
16
- * Retrieves the current content size value from the given simulator.
17
- *
18
- * @since Xcode 15 (but lower xcode could have this command)
19
- * @returns {Promise<ContentSizeResult>} the content size value. Possible return value is
20
- * extra-small, small, medium, large, extra-large, extra-extra-large,
21
- * extra-extra-extra-large, accessibility-medium, accessibility-large,
22
- * accessibility-extra-large, accessibility-extra-extra-large,
23
- * accessibility-extra-extra-extra-large,
24
- * unknown or unsupported with Xcode 16.2.
25
- * @this {XCUITestDriver}
26
- */
27
- function mobileGetContentSize(this: import("../driver").XCUITestDriver): Promise<ContentSizeResult>;
28
- }
29
- export default _default;
1
+ /**
2
+ * Sets content size for the given simulator.
3
+ *
4
+ * @since Xcode 15 (but lower xcode could have this command)
5
+ * @param {ContentSizeAction} size - The content size action to set. Acceptable value is
6
+ * extra-small, small, medium, large, extra-large, extra-extra-large,
7
+ * extra-extra-extra-large, accessibility-medium, accessibility-large,
8
+ * accessibility-extra-large, accessibility-extra-extra-large,
9
+ * accessibility-extra-extra-extra-large with Xcode 16.2.
10
+ * @throws {Error} if the current platform does not support content size appearance changes
11
+ * @this {XCUITestDriver}
12
+ */
13
+ export function mobileSetContentSize(this: import("../driver").XCUITestDriver, size: ContentSizeAction): Promise<void>;
14
+ /**
15
+ * Retrieves the current content size value from the given simulator.
16
+ *
17
+ * @since Xcode 15 (but lower xcode could have this command)
18
+ * @returns {Promise<ContentSizeResult>} the content size value. Possible return value is
19
+ * extra-small, small, medium, large, extra-large, extra-extra-large,
20
+ * extra-extra-extra-large, accessibility-medium, accessibility-large,
21
+ * accessibility-extra-large, accessibility-extra-extra-large,
22
+ * accessibility-extra-extra-extra-large,
23
+ * unknown or unsupported with Xcode 16.2.
24
+ * @this {XCUITestDriver}
25
+ */
26
+ export function mobileGetContentSize(this: import("../driver").XCUITestDriver): Promise<ContentSizeResult>;
30
27
  export type XCUITestDriver = import("../driver").XCUITestDriver;
31
28
  export type ContentSizeAction = import("./types").ContentSizeAction;
32
29
  export type ContentSizeResult = import("./types").ContentSizeResult;
@@ -1 +1 @@
1
- {"version":3,"file":"content-size.d.ts","sourceRoot":"","sources":["../../../lib/commands/content-size.js"],"names":[],"mappings":";IAwBE;;;;;;;;;;;OAWG;IACH,8EARW,iBAAiB,iBAkB3B;IAED;;;;;;;;;;;OAWG;IACH,yEARa,OAAO,CAAC,iBAAiB,CAAC,CAUtC;;;6BAIU,OAAO,WAAW,EAAE,cAAc;gCAClC,OAAO,SAAS,EAAE,iBAAiB;gCACnC,OAAO,SAAS,EAAE,iBAAiB"}
1
+ {"version":3,"file":"content-size.d.ts","sourceRoot":"","sources":["../../../lib/commands/content-size.js"],"names":[],"mappings":"AAuBA;;;;;;;;;;;GAWG;AACH,qFARW,iBAAiB,iBAkB3B;AAED;;;;;;;;;;;GAWG;AACH,gFARa,OAAO,CAAC,iBAAiB,CAAC,CAUtC;6BAGY,OAAO,WAAW,EAAE,cAAc;gCAClC,OAAO,SAAS,EAAE,iBAAiB;gCACnC,OAAO,SAAS,EAAE,iBAAiB"}
@@ -3,6 +3,8 @@ 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.mobileSetContentSize = mobileSetContentSize;
7
+ exports.mobileGetContentSize = mobileGetContentSize;
6
8
  const lodash_1 = __importDefault(require("lodash"));
7
9
  const utils_1 = require("../utils");
8
10
  const driver_1 = require("appium/driver");
@@ -23,42 +25,40 @@ const CONTENT_SIZE = [
23
25
  'increment',
24
26
  'decrement'
25
27
  ];
26
- exports.default = {
27
- /**
28
- * Sets content size for the given simulator.
29
- *
30
- * @since Xcode 15 (but lower xcode could have this command)
31
- * @param {ContentSizeAction} size - The content size action to set. Acceptable value is
32
- * extra-small, small, medium, large, extra-large, extra-extra-large,
33
- * extra-extra-extra-large, accessibility-medium, accessibility-large,
34
- * accessibility-extra-large, accessibility-extra-extra-large,
35
- * accessibility-extra-extra-extra-large with Xcode 16.2.
36
- * @throws {Error} if the current platform does not support content size appearance changes
37
- * @this {XCUITestDriver}
38
- */
39
- async mobileSetContentSize(size) {
40
- const simulator = assertSimulator(this);
41
- if (!CONTENT_SIZE.includes(lodash_1.default.lowerCase(size))) {
42
- throw new driver_1.errors.InvalidArgumentError(`The 'size' value is expected to be one of ${CONTENT_SIZE.join(',')}`);
43
- }
44
- await simulator.setContentSize(size);
45
- },
46
- /**
47
- * Retrieves the current content size value from the given simulator.
48
- *
49
- * @since Xcode 15 (but lower xcode could have this command)
50
- * @returns {Promise<ContentSizeResult>} the content size value. Possible return value is
51
- * extra-small, small, medium, large, extra-large, extra-extra-large,
52
- * extra-extra-extra-large, accessibility-medium, accessibility-large,
53
- * accessibility-extra-large, accessibility-extra-extra-large,
54
- * accessibility-extra-extra-extra-large,
55
- * unknown or unsupported with Xcode 16.2.
56
- * @this {XCUITestDriver}
57
- */
58
- async mobileGetContentSize() {
59
- return /** @type {ContentSizeResult} */ (await assertSimulator(this).getContentSize());
60
- },
61
- };
28
+ /**
29
+ * Sets content size for the given simulator.
30
+ *
31
+ * @since Xcode 15 (but lower xcode could have this command)
32
+ * @param {ContentSizeAction} size - The content size action to set. Acceptable value is
33
+ * extra-small, small, medium, large, extra-large, extra-extra-large,
34
+ * extra-extra-extra-large, accessibility-medium, accessibility-large,
35
+ * accessibility-extra-large, accessibility-extra-extra-large,
36
+ * accessibility-extra-extra-extra-large with Xcode 16.2.
37
+ * @throws {Error} if the current platform does not support content size appearance changes
38
+ * @this {XCUITestDriver}
39
+ */
40
+ async function mobileSetContentSize(size) {
41
+ const simulator = assertSimulator(this);
42
+ if (!CONTENT_SIZE.includes(lodash_1.default.lowerCase(size))) {
43
+ throw new driver_1.errors.InvalidArgumentError(`The 'size' value is expected to be one of ${CONTENT_SIZE.join(',')}`);
44
+ }
45
+ await simulator.setContentSize(size);
46
+ }
47
+ /**
48
+ * Retrieves the current content size value from the given simulator.
49
+ *
50
+ * @since Xcode 15 (but lower xcode could have this command)
51
+ * @returns {Promise<ContentSizeResult>} the content size value. Possible return value is
52
+ * extra-small, small, medium, large, extra-large, extra-extra-large,
53
+ * extra-extra-extra-large, accessibility-medium, accessibility-large,
54
+ * accessibility-extra-large, accessibility-extra-extra-large,
55
+ * accessibility-extra-extra-extra-large,
56
+ * unknown or unsupported with Xcode 16.2.
57
+ * @this {XCUITestDriver}
58
+ */
59
+ async function mobileGetContentSize() {
60
+ return /** @type {ContentSizeResult} */ (await assertSimulator(this).getContentSize());
61
+ }
62
62
  /**
63
63
  * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
64
64
  * @typedef {import('./types').ContentSizeAction} ContentSizeAction
@@ -1 +1 @@
1
- {"version":3,"file":"content-size.js","sourceRoot":"","sources":["../../../lib/commands/content-size.js"],"names":[],"mappings":";;;;;AAAA,oDAAuB;AACvB,oCAA6D;AAC7D,0CAAuC;AAEvC,MAAM,eAAe,GAAG,gBAAC,CAAC,OAAO,CAAC,uBAAgB,EAAE,yBAAyB,CAAC,CAAC;AAE/E,MAAM,YAAY,GAAG;IACjB,aAAa;IACb,OAAO;IACP,QAAQ;IACR,OAAO;IACP,aAAa;IACb,mBAAmB;IACnB,yBAAyB;IACzB,sBAAsB;IACtB,qBAAqB;IACrB,2BAA2B;IAC3B,iCAAiC;IACjC,uCAAuC;IACvC,WAAW;IACX,WAAW;CACd,CAAC;AAEF,kBAAe;IACb;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,oBAAoB,CAAC,IAAI;QAC7B,MAAM,SAAS,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;QAExC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,gBAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;YAC9C,MAAM,IAAI,eAAM,CAAC,oBAAoB,CACnC,6CAA6C,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CACtE,CAAC;QACJ,CAAC;QAED,MAAM,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;IACvC,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,oBAAoB;QACxB,OAAO,gCAAgC,CAAC,CAAC,MAAM,eAAe,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC;IACzF,CAAC;CACF,CAAC;AAEF;;;;GAIG"}
1
+ {"version":3,"file":"content-size.js","sourceRoot":"","sources":["../../../lib/commands/content-size.js"],"names":[],"mappings":";;;;;AAmCA,oDAUC;AAcD,oDAEC;AA7DD,oDAAuB;AACvB,oCAA6D;AAC7D,0CAAuC;AAEvC,MAAM,eAAe,GAAG,gBAAC,CAAC,OAAO,CAAC,uBAAgB,EAAE,yBAAyB,CAAC,CAAC;AAE/E,MAAM,YAAY,GAAG;IACjB,aAAa;IACb,OAAO;IACP,QAAQ;IACR,OAAO;IACP,aAAa;IACb,mBAAmB;IACnB,yBAAyB;IACzB,sBAAsB;IACtB,qBAAqB;IACrB,2BAA2B;IAC3B,iCAAiC;IACjC,uCAAuC;IACvC,WAAW;IACX,WAAW;CACd,CAAC;AAEF;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,oBAAoB,CAAC,IAAI;IAC7C,MAAM,SAAS,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;IAExC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,gBAAC,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC;QAC9C,MAAM,IAAI,eAAM,CAAC,oBAAoB,CACnC,6CAA6C,YAAY,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CACtE,CAAC;IACJ,CAAC;IAED,MAAM,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,CAAC;AACvC,CAAC;AAED;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,oBAAoB;IACxC,OAAO,gCAAgC,CAAC,CAAC,MAAM,eAAe,CAAC,IAAI,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC;AACzF,CAAC;AAED;;;;GAIG"}