appium-xcuitest-driver 10.3.0 → 10.4.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 (257) hide show
  1. package/CHANGELOG.md +12 -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 +275 -197
  175. package/build/lib/commands/web.d.ts.map +1 -1
  176. package/build/lib/commands/web.js +866 -785
  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 +277 -1597
  187. package/build/lib/driver.d.ts.map +1 -1
  188. package/build/lib/driver.js +318 -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 +932 -859
  237. package/lib/commands/xctest-record-screen.js +103 -105
  238. package/lib/commands/xctest.js +134 -139
  239. package/lib/driver.js +286 -235
  240. package/lib/execute-method-map.ts +9 -0
  241. package/npm-shrinkwrap.json +8 -8
  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/build/lib/cookies.d.ts +0 -15
  252. package/build/lib/cookies.d.ts.map +0 -1
  253. package/build/lib/cookies.js +0 -84
  254. package/build/lib/cookies.js.map +0 -1
  255. package/lib/commands/activeAppInfo.js +0 -14
  256. package/lib/commands/index.js +0 -95
  257. package/lib/cookies.js +0 -92
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../lib/commands/navigation.js"],"names":[],"mappings":";IAUE;;OAEG;IACH,uEAMC;IACD;;OAEG;IACH,0EAIC;IACD;;OAEG;IACH,6EAsBC;IAED;;;;;;;;;;;;OAYG;IACH,uEAPW,MAAM,aACN,MAAM,GAEJ,OAAO,CAAC,IAAI,CAAC,CASzB;IAID;;OAEG;IACH,gFAiCC;;;6BAMU,OAAO,WAAW,EAAE,cAAc;;;;;SAKjC,MAAM;;;;;;cACN,MAAM,OAAC"}
1
+ {"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../../lib/commands/navigation.js"],"names":[],"mappings":"AASA;;GAEG;AACH,8EAMC;AAED;;GAEG;AACH,iFAIC;AAED;;GAEG;AACH,oFAsBC;AAED;;;;;;;;;;;;GAYG;AACH,8EAPW,MAAM,aACN,MAAM,GAEJ,OAAO,CAAC,IAAI,CAAC,CASzB;AAED;;GAEG;AACH,uFAiCC;6BAGY,OAAO,WAAW,EAAE,cAAc;;;;;SAKjC,MAAM;;;;;;cACN,MAAM,OAAC"}
@@ -3,6 +3,11 @@ 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.back = back;
7
+ exports.forward = forward;
8
+ exports.closeWindow = closeWindow;
9
+ exports.mobileDeepLink = mobileDeepLink;
10
+ exports.nativeBack = nativeBack;
6
11
  const driver_1 = require("appium/driver");
7
12
  const lodash_1 = __importDefault(require("lodash"));
8
13
  const asyncbox_1 = require("asyncbox");
@@ -10,104 +15,99 @@ const utils_1 = require("../utils");
10
15
  // these two constitute the wait after closing a window
11
16
  const CLOSE_WINDOW_TIMEOUT = 5000;
12
17
  const CLOSE_WINDOW_INTERVAL = 100;
13
- const commands = {
14
- /**
15
- * @this {XCUITestDriver}
16
- */
17
- async back() {
18
- if (!this.isWebContext()) {
19
- await this.nativeBack();
20
- }
21
- else {
22
- await this.mobileWebNav('back');
23
- }
24
- },
25
- /**
26
- * @this {XCUITestDriver}
27
- */
28
- async forward() {
29
- if (!this.isWebContext()) {
30
- }
31
- await this.mobileWebNav('forward');
32
- },
33
- /**
34
- * @this {XCUITestDriver}
35
- */
36
- async closeWindow() {
37
- if (!this.isWebContext()) {
38
- throw new driver_1.errors.NotImplementedError();
39
- }
40
- // since the window will be closed and the execution context gone, return
41
- // first before closing. Waiting for close will happen in the finally block
42
- const script = `setTimeout(function () {window.open('','_self').close();}, 0); return true;`;
43
- const context = this.curContext;
18
+ /**
19
+ * @this {XCUITestDriver}
20
+ */
21
+ async function back() {
22
+ if (!this.isWebContext()) {
23
+ await this.nativeBack();
24
+ }
25
+ else {
26
+ await this.mobileWebNav('back');
27
+ }
28
+ }
29
+ /**
30
+ * @this {XCUITestDriver}
31
+ */
32
+ async function forward() {
33
+ if (!this.isWebContext()) {
34
+ }
35
+ await this.mobileWebNav('forward');
36
+ }
37
+ /**
38
+ * @this {XCUITestDriver}
39
+ */
40
+ async function closeWindow() {
41
+ if (!this.isWebContext()) {
42
+ throw new driver_1.errors.NotImplementedError();
43
+ }
44
+ // since the window will be closed and the execution context gone, return
45
+ // first before closing. Waiting for close will happen in the finally block
46
+ const script = `setTimeout(function () {window.open('','_self').close();}, 0); return true;`;
47
+ const context = this.curContext;
48
+ try {
49
+ return await this.executeAtom('execute_script', [script, []], true);
50
+ }
51
+ finally {
52
+ // wait for the window to successfully change...
44
53
  try {
45
- return await this.executeAtom('execute_script', [script, []], true);
54
+ await (0, asyncbox_1.waitForCondition)(() => this.curContext !== context, {
55
+ waitMs: CLOSE_WINDOW_TIMEOUT,
56
+ intervalMs: CLOSE_WINDOW_INTERVAL,
57
+ });
46
58
  }
47
- finally {
48
- // wait for the window to successfully change...
49
- try {
50
- await (0, asyncbox_1.waitForCondition)(() => this.curContext !== context, {
51
- waitMs: CLOSE_WINDOW_TIMEOUT,
52
- intervalMs: CLOSE_WINDOW_INTERVAL,
53
- });
54
- }
55
- catch {
56
- this.log.debug('Context has not yet been changed after closing window. Continuing...');
57
- }
59
+ catch {
60
+ this.log.debug('Context has not yet been changed after closing window. Continuing...');
58
61
  }
59
- },
60
- /**
61
- * Opens the given URL with the default application assigned to handle it based on the URL
62
- * scheme, or the application provided as an optional parameter
63
- *
64
- * (Note: the version of Xcode must be 14.3+ and iOS must be 16.4+)
65
- *
66
- * @param {string} url - the URL to be opened, e.g. `myscheme://yolo`
67
- * @param {string} [bundleId] - the application to open the given URL with. If not provided, then
68
- * the application assigned by the operating system to handle URLs of the appropriate type
69
- * @returns {Promise<void>}
70
- * @since 4.17
71
- * @this {XCUITestDriver}
72
- */
73
- async mobileDeepLink(url, bundleId) {
74
- return await this.proxyCommand('/url', 'POST', {
75
- url,
76
- bundleId,
77
- });
78
- },
79
- };
80
- const helpers = {
81
- /**
82
- * @this {XCUITestDriver}
83
- */
84
- async nativeBack() {
85
- if ((0, utils_1.isTvOs)(this.opts.platformName)) {
86
- this.log.debug(`Sending Menu button as back behavior in tvOS`);
87
- return await this.mobilePressButton('Menu');
62
+ }
63
+ }
64
+ /**
65
+ * Opens the given URL with the default application assigned to handle it based on the URL
66
+ * scheme, or the application provided as an optional parameter
67
+ *
68
+ * (Note: the version of Xcode must be 14.3+ and iOS must be 16.4+)
69
+ *
70
+ * @param {string} url - the URL to be opened, e.g. `myscheme://yolo`
71
+ * @param {string} [bundleId] - the application to open the given URL with. If not provided, then
72
+ * the application assigned by the operating system to handle URLs of the appropriate type
73
+ * @returns {Promise<void>}
74
+ * @since 4.17
75
+ * @this {XCUITestDriver}
76
+ */
77
+ async function mobileDeepLink(url, bundleId) {
78
+ return await this.proxyCommand('/url', 'POST', {
79
+ url,
80
+ bundleId,
81
+ });
82
+ }
83
+ /**
84
+ * @this {XCUITestDriver}
85
+ */
86
+ async function nativeBack() {
87
+ if ((0, utils_1.isTvOs)(this.opts.platformName)) {
88
+ this.log.debug(`Sending Menu button as back behavior in tvOS`);
89
+ return await this.mobilePressButton('Menu');
90
+ }
91
+ try {
92
+ let navBar = await this.findNativeElementOrElements('class name', 'XCUIElementTypeNavigationBar', false);
93
+ let buttons = await this.findNativeElementOrElements('class name', 'XCUIElementTypeButton', true, navBar);
94
+ if (buttons?.length === 0) {
95
+ throw new Error('No buttons found in navigation bar');
88
96
  }
89
- try {
90
- let navBar = await this.findNativeElementOrElements('class name', 'XCUIElementTypeNavigationBar', false);
91
- let buttons = await this.findNativeElementOrElements('class name', 'XCUIElementTypeButton', true, navBar);
92
- if (buttons?.length === 0) {
93
- throw new Error('No buttons found in navigation bar');
94
- }
95
- let backButton = lodash_1.default.filter(buttons, (value) => value.label === 'Back')[0];
96
- if (backButton) {
97
- this.log.debug(`Found navigation bar 'back' button. Clicking.`);
98
- }
99
- else {
100
- this.log.debug(`Unable to find 'Back' button. Trying first button in navigation bar`);
101
- backButton = buttons?.[0];
102
- }
103
- await this.nativeClick(/** @type {string} */ (backButton));
97
+ let backButton = lodash_1.default.filter(buttons, (value) => value.label === 'Back')[0];
98
+ if (backButton) {
99
+ this.log.debug(`Found navigation bar 'back' button. Clicking.`);
104
100
  }
105
- catch (err) {
106
- this.log.error(`Unable to find navigation bar and back button: ${err.message}`);
101
+ else {
102
+ this.log.debug(`Unable to find 'Back' button. Trying first button in navigation bar`);
103
+ backButton = buttons?.[0];
107
104
  }
108
- },
109
- };
110
- exports.default = { ...helpers, ...commands };
105
+ await this.nativeClick(/** @type {string} */ (backButton));
106
+ }
107
+ catch (err) {
108
+ this.log.error(`Unable to find navigation bar and back button: ${err.message}`);
109
+ }
110
+ }
111
111
  /**
112
112
  * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
113
113
  */
@@ -1 +1 @@
1
- {"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../../lib/commands/navigation.js"],"names":[],"mappings":";;;;;AAAA,0CAAqC;AACrC,oDAAuB;AACvB,uCAA0C;AAC1C,oCAAkC;AAElC,uDAAuD;AACvD,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAClC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAElC,MAAM,QAAQ,GAAG;IACf;;OAEG;IACH,KAAK,CAAC,IAAI;QACR,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;YACzB,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;QAC1B,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;IACD;;OAEG;IACH,KAAK,CAAC,OAAO;QACX,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;QAC3B,CAAC;QACD,MAAM,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACrC,CAAC;IACD;;OAEG;IACH,KAAK,CAAC,WAAW;QACf,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;YACzB,MAAM,IAAI,eAAM,CAAC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b,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,kDAAkD,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;AACH,CAAC;AAED;;GAEG;AAEH;;;;;;GAMG"}
@@ -1,31 +1,28 @@
1
- declare namespace _default {
2
- /**
3
- * Simulates push notification delivery to a simulated device.
4
- *
5
- * **Only "remote" push notifications are supported.** VoIP, Complication, File Provider, and other types are unsupported.
6
- *
7
- * Supported in Xcode SDK 11.4+.
8
- * @param {string} bundleId - The bundle identifier of the target application
9
- * @param {import('./types').PushPayload} payload - Valid push payload.
10
- * @group Simulator Only
11
- * @this {XCUITestDriver}
12
- */
13
- function mobilePushNotification(this: import("../driver").XCUITestDriver, bundleId: string, payload: import("./types").PushPayload): Promise<void>;
14
- /**
15
- * Blocks until the expected notification is delivered.
16
- *
17
- * This method is a thin wrapper over the
18
- * [`XCTNSNotificationExpectation`](https://developer.apple.com/documentation/xctest/xctnsnotificationexpectation?language=objc) and
19
- * [`XCTDarwinNotificationExpectation`](https://developer.apple.com/documentation/xctest/xctdarwinnotificationexpectation?language=objc) entities.
20
- *
21
- * @param {string} name - The name of the notification to expect
22
- * @param {import('./types').NotificationType} type - Which notification type to expect.
23
- * @param {number} timeoutSeconds - For how long to wait until the notification is delivered (in float seconds).
24
- * @throws A [`TimeoutError`](https://www.selenium.dev/selenium/docs/api/javascript/module/selenium-webdriver/lib/error_exports_TimeoutError.html) if the expected notification has not been delivered within the given timeout.
25
- * @this {XCUITestDriver}
26
- */
27
- function mobileExpectNotification(this: import("../driver").XCUITestDriver, name: string, type?: import("./types").NotificationType, timeoutSeconds?: number): Promise<unknown>;
28
- }
29
- export default _default;
1
+ /**
2
+ * Simulates push notification delivery to a simulated device.
3
+ *
4
+ * **Only "remote" push notifications are supported.** VoIP, Complication, File Provider, and other types are unsupported.
5
+ *
6
+ * Supported in Xcode SDK 11.4+.
7
+ * @param {string} bundleId - The bundle identifier of the target application
8
+ * @param {import('./types').PushPayload} payload - Valid push payload.
9
+ * @group Simulator Only
10
+ * @this {XCUITestDriver}
11
+ */
12
+ export function mobilePushNotification(this: import("../driver").XCUITestDriver, bundleId: string, payload: import("./types").PushPayload): Promise<void>;
13
+ /**
14
+ * Blocks until the expected notification is delivered.
15
+ *
16
+ * This method is a thin wrapper over the
17
+ * [`XCTNSNotificationExpectation`](https://developer.apple.com/documentation/xctest/xctnsnotificationexpectation?language=objc) and
18
+ * [`XCTDarwinNotificationExpectation`](https://developer.apple.com/documentation/xctest/xctdarwinnotificationexpectation?language=objc) entities.
19
+ *
20
+ * @param {string} name - The name of the notification to expect
21
+ * @param {import('./types').NotificationType} type - Which notification type to expect.
22
+ * @param {number} timeoutSeconds - For how long to wait until the notification is delivered (in float seconds).
23
+ * @throws A [`TimeoutError`](https://www.selenium.dev/selenium/docs/api/javascript/module/selenium-webdriver/lib/error_exports_TimeoutError.html) if the expected notification has not been delivered within the given timeout.
24
+ * @this {XCUITestDriver}
25
+ */
26
+ export function mobileExpectNotification(this: import("../driver").XCUITestDriver, name: string, type?: import("./types").NotificationType, timeoutSeconds?: number): Promise<unknown>;
30
27
  export type XCUITestDriver = import("../driver").XCUITestDriver;
31
28
  //# sourceMappingURL=notifications.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../lib/commands/notifications.js"],"names":[],"mappings":";IAIE;;;;;;;;;;OAUG;IACH,oFALW,MAAM,WACN,OAAO,SAAS,EAAE,WAAW,iBA8BvC;IAED;;;;;;;;;;;;OAYG;IACH,kFANW,MAAM,SACN,OAAO,SAAS,EAAE,gBAAgB,mBAClC,MAAM,oBAUhB;;;6BAIU,OAAO,WAAW,EAAE,cAAc"}
1
+ {"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../lib/commands/notifications.js"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,2FALW,MAAM,WACN,OAAO,SAAS,EAAE,WAAW,iBA8BvC;AAED;;;;;;;;;;;;GAYG;AACH,yFANW,MAAM,SACN,OAAO,SAAS,EAAE,gBAAgB,mBAClC,MAAM,oBAUhB;6BAGY,OAAO,WAAW,EAAE,cAAc"}
@@ -3,61 +3,61 @@ 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.mobilePushNotification = mobilePushNotification;
7
+ exports.mobileExpectNotification = mobileExpectNotification;
6
8
  const driver_1 = require("appium/driver");
7
9
  const lodash_1 = __importDefault(require("lodash"));
8
- exports.default = {
9
- /**
10
- * Simulates push notification delivery to a simulated device.
11
- *
12
- * **Only "remote" push notifications are supported.** VoIP, Complication, File Provider, and other types are unsupported.
13
- *
14
- * Supported in Xcode SDK 11.4+.
15
- * @param {string} bundleId - The bundle identifier of the target application
16
- * @param {import('./types').PushPayload} payload - Valid push payload.
17
- * @group Simulator Only
18
- * @this {XCUITestDriver}
19
- */
20
- async mobilePushNotification(bundleId, payload) {
21
- if (!this.isSimulator()) {
22
- throw new Error('This extension only works on Simulator');
23
- }
24
- if (!bundleId) {
25
- throw new driver_1.errors.InvalidArgumentError(`'bundleId' argument must be a valid bundle identifier string`);
26
- }
27
- if (!lodash_1.default.isPlainObject(payload)) {
28
- throw new driver_1.errors.InvalidArgumentError(`The 'payload' argument value must be a valid dictionary. ` +
29
- `Got ${JSON.stringify(payload)} instead`);
30
- }
31
- if (!lodash_1.default.isPlainObject(payload.aps)) {
32
- throw new driver_1.errors.InvalidArgumentError(`The 'payload.aps' value must be a valid dictionary. ` +
33
- `Got ${JSON.stringify(payload.aps)} instead`);
34
- }
35
- return await /** @type {import('../driver').Simulator} */ (this.device).pushNotification({
36
- ...payload,
37
- 'Simulator Target Bundle': bundleId,
38
- });
39
- },
40
- /**
41
- * Blocks until the expected notification is delivered.
42
- *
43
- * This method is a thin wrapper over the
44
- * [`XCTNSNotificationExpectation`](https://developer.apple.com/documentation/xctest/xctnsnotificationexpectation?language=objc) and
45
- * [`XCTDarwinNotificationExpectation`](https://developer.apple.com/documentation/xctest/xctdarwinnotificationexpectation?language=objc) entities.
46
- *
47
- * @param {string} name - The name of the notification to expect
48
- * @param {import('./types').NotificationType} type - Which notification type to expect.
49
- * @param {number} timeoutSeconds - For how long to wait until the notification is delivered (in float seconds).
50
- * @throws A [`TimeoutError`](https://www.selenium.dev/selenium/docs/api/javascript/module/selenium-webdriver/lib/error_exports_TimeoutError.html) if the expected notification has not been delivered within the given timeout.
51
- * @this {XCUITestDriver}
52
- */
53
- async mobileExpectNotification(name, type = 'plain', timeoutSeconds = 60) {
54
- return await this.proxyCommand('/wda/expectNotification', 'POST', {
55
- name,
56
- type,
57
- timeout: timeoutSeconds,
58
- });
59
- },
60
- };
10
+ /**
11
+ * Simulates push notification delivery to a simulated device.
12
+ *
13
+ * **Only "remote" push notifications are supported.** VoIP, Complication, File Provider, and other types are unsupported.
14
+ *
15
+ * Supported in Xcode SDK 11.4+.
16
+ * @param {string} bundleId - The bundle identifier of the target application
17
+ * @param {import('./types').PushPayload} payload - Valid push payload.
18
+ * @group Simulator Only
19
+ * @this {XCUITestDriver}
20
+ */
21
+ async function mobilePushNotification(bundleId, payload) {
22
+ if (!this.isSimulator()) {
23
+ throw new Error('This extension only works on Simulator');
24
+ }
25
+ if (!bundleId) {
26
+ throw new driver_1.errors.InvalidArgumentError(`'bundleId' argument must be a valid bundle identifier string`);
27
+ }
28
+ if (!lodash_1.default.isPlainObject(payload)) {
29
+ throw new driver_1.errors.InvalidArgumentError(`The 'payload' argument value must be a valid dictionary. ` +
30
+ `Got ${JSON.stringify(payload)} instead`);
31
+ }
32
+ if (!lodash_1.default.isPlainObject(payload.aps)) {
33
+ throw new driver_1.errors.InvalidArgumentError(`The 'payload.aps' value must be a valid dictionary. ` +
34
+ `Got ${JSON.stringify(payload.aps)} instead`);
35
+ }
36
+ return await /** @type {import('../driver').Simulator} */ (this.device).pushNotification({
37
+ ...payload,
38
+ 'Simulator Target Bundle': bundleId,
39
+ });
40
+ }
41
+ /**
42
+ * Blocks until the expected notification is delivered.
43
+ *
44
+ * This method is a thin wrapper over the
45
+ * [`XCTNSNotificationExpectation`](https://developer.apple.com/documentation/xctest/xctnsnotificationexpectation?language=objc) and
46
+ * [`XCTDarwinNotificationExpectation`](https://developer.apple.com/documentation/xctest/xctdarwinnotificationexpectation?language=objc) entities.
47
+ *
48
+ * @param {string} name - The name of the notification to expect
49
+ * @param {import('./types').NotificationType} type - Which notification type to expect.
50
+ * @param {number} timeoutSeconds - For how long to wait until the notification is delivered (in float seconds).
51
+ * @throws A [`TimeoutError`](https://www.selenium.dev/selenium/docs/api/javascript/module/selenium-webdriver/lib/error_exports_TimeoutError.html) if the expected notification has not been delivered within the given timeout.
52
+ * @this {XCUITestDriver}
53
+ */
54
+ async function mobileExpectNotification(name, type = 'plain', timeoutSeconds = 60) {
55
+ return await this.proxyCommand('/wda/expectNotification', 'POST', {
56
+ name,
57
+ type,
58
+ timeout: timeoutSeconds,
59
+ });
60
+ }
61
61
  /**
62
62
  * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
63
63
  */
@@ -1 +1 @@
1
- {"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../../lib/commands/notifications.js"],"names":[],"mappings":";;;;;AAAA,0CAAqC;AACrC,oDAAuB;AAEvB,kBAAe;IACb;;;;;;;;;;OAUG;IACH,KAAK,CAAC,sBAAsB,CAAC,QAAQ,EAAE,OAAO;QAC5C,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAC5D,CAAC;QAED,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,MAAM,IAAI,eAAM,CAAC,oBAAoB,CACnC,8DAA8D,CAC/D,CAAC;QACJ,CAAC;QACD,IAAI,CAAC,gBAAC,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9B,MAAM,IAAI,eAAM,CAAC,o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C,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,eAAM,CAAC,oBAAoB,CACnC,2DAA2D;YACzD,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,UAAU,CAC3C,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,gBAAC,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,eAAM,CAAC,oBAAoB,CACnC,sDAAsD;YACpD,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAC/C,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,4CAA4C,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,gBAAgB,CAAC;QACvF,GAAG,OAAO;QACV,yBAAyB,EAAE,QAAQ;KACpC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;;GAYG;AACI,KAAK,UAAU,wBAAwB,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,EAAE,cAAc,GAAG,EAAE;IACtF,OAAO,MAAM,IAAI,CAAC,YAAY,CAAC,yBAAyB,EAAE,MAAM,EAAE;QAChE,IAAI;QACJ,IAAI;QACJ,OAAO,EAAE,cAAc;KACxB,CAAC,CAAC;AACL,CAAC;AAED;;GAEG"}
@@ -1,26 +1,23 @@
1
- declare namespace _default {
2
- /**
3
- * Sets the Simulator's pasteboard content to the given value.
4
- *
5
- * Does not work for real devices.
6
- * @param {string} content - The content to set
7
- * @param {string} encoding - The content's encoding
8
- * @group Simulator Only
9
- * @returns {Promise<void>}
10
- * @this {XCUITestDriver}
11
- */
12
- function mobileSetPasteboard(this: import("../driver").XCUITestDriver, content: string, encoding?: string): Promise<void>;
13
- /**
14
- * Gets the Simulator's pasteboard content.
15
- *
16
- * Does not work for real devices.
17
- * @param {string} encoding - Expected encoding of returned string
18
- * @group Simulator Only
19
- * @this {XCUITestDriver}
20
- * @returns {Promise<string>} The pasteboard content string
21
- */
22
- function mobileGetPasteboard(this: import("../driver").XCUITestDriver, encoding?: string): Promise<string>;
23
- }
24
- export default _default;
1
+ /**
2
+ * Sets the Simulator's pasteboard content to the given value.
3
+ *
4
+ * Does not work for real devices.
5
+ * @param {string} content - The content to set
6
+ * @param {string} encoding - The content's encoding
7
+ * @group Simulator Only
8
+ * @returns {Promise<void>}
9
+ * @this {XCUITestDriver}
10
+ */
11
+ export function mobileSetPasteboard(this: import("../driver").XCUITestDriver, content: string, encoding?: string): Promise<void>;
12
+ /**
13
+ * Gets the Simulator's pasteboard content.
14
+ *
15
+ * Does not work for real devices.
16
+ * @param {string} encoding - Expected encoding of returned string
17
+ * @group Simulator Only
18
+ * @this {XCUITestDriver}
19
+ * @returns {Promise<string>} The pasteboard content string
20
+ */
21
+ export function mobileGetPasteboard(this: import("../driver").XCUITestDriver, encoding?: string): Promise<string>;
25
22
  export type XCUITestDriver = import("../driver").XCUITestDriver;
26
23
  //# sourceMappingURL=pasteboard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"pasteboard.d.ts","sourceRoot":"","sources":["../../../lib/commands/pasteboard.js"],"names":[],"mappings":";IACE;;;;;;;;;OASG;IACH,gFANW,MAAM,aACN,MAAM,GAEJ,OAAO,CAAC,IAAI,CAAC,CAczB;IAED;;;;;;;;OAQG;IACH,kFALW,MAAM,GAGJ,OAAO,CAAC,MAAM,CAAC,CAO3B;;;6BAIU,OAAO,WAAW,EAAE,cAAc"}
1
+ {"version":3,"file":"pasteboard.d.ts","sourceRoot":"","sources":["../../../lib/commands/pasteboard.js"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,uFANW,MAAM,aACN,MAAM,GAEJ,OAAO,CAAC,IAAI,CAAC,CAczB;AAED;;;;;;;;GAQG;AACH,yFALW,MAAM,GAGJ,OAAO,CAAC,MAAM,CAAC,CAO3B;6BAGY,OAAO,WAAW,EAAE,cAAc"}
@@ -1,42 +1,42 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = {
4
- /**
5
- * Sets the Simulator's pasteboard content to the given value.
6
- *
7
- * Does not work for real devices.
8
- * @param {string} content - The content to set
9
- * @param {string} encoding - The content's encoding
10
- * @group Simulator Only
11
- * @returns {Promise<void>}
12
- * @this {XCUITestDriver}
13
- */
14
- async mobileSetPasteboard(content, encoding = 'utf8') {
15
- if (!this.isSimulator()) {
16
- throw new Error('Setting pasteboard content is not supported on real devices');
17
- }
18
- if (!content) {
19
- // can be empty string
20
- throw new Error('Pasteboard content is mandatory to set');
21
- }
22
- return await /** @type {import('../driver').Simulator} */ (this.device).simctl.setPasteboard(content, /** @type {BufferEncoding} */ (encoding));
23
- },
24
- /**
25
- * Gets the Simulator's pasteboard content.
26
- *
27
- * Does not work for real devices.
28
- * @param {string} encoding - Expected encoding of returned string
29
- * @group Simulator Only
30
- * @this {XCUITestDriver}
31
- * @returns {Promise<string>} The pasteboard content string
32
- */
33
- async mobileGetPasteboard(encoding = 'utf8') {
34
- if (!this.isSimulator()) {
35
- throw new Error('Getting pasteboard content is not supported on real devices');
36
- }
37
- return await /** @type {import('../driver').Simulator} */ (this.device).simctl.getPasteboard(encoding);
38
- },
39
- };
3
+ exports.mobileSetPasteboard = mobileSetPasteboard;
4
+ exports.mobileGetPasteboard = mobileGetPasteboard;
5
+ /**
6
+ * Sets the Simulator's pasteboard content to the given value.
7
+ *
8
+ * Does not work for real devices.
9
+ * @param {string} content - The content to set
10
+ * @param {string} encoding - The content's encoding
11
+ * @group Simulator Only
12
+ * @returns {Promise<void>}
13
+ * @this {XCUITestDriver}
14
+ */
15
+ async function mobileSetPasteboard(content, encoding = 'utf8') {
16
+ if (!this.isSimulator()) {
17
+ throw new Error('Setting pasteboard content is not supported on real devices');
18
+ }
19
+ if (!content) {
20
+ // can be empty string
21
+ throw new Error('Pasteboard content is mandatory to set');
22
+ }
23
+ return await /** @type {import('../driver').Simulator} */ (this.device).simctl.setPasteboard(content, /** @type {BufferEncoding} */ (encoding));
24
+ }
25
+ /**
26
+ * Gets the Simulator's pasteboard content.
27
+ *
28
+ * Does not work for real devices.
29
+ * @param {string} encoding - Expected encoding of returned string
30
+ * @group Simulator Only
31
+ * @this {XCUITestDriver}
32
+ * @returns {Promise<string>} The pasteboard content string
33
+ */
34
+ async function mobileGetPasteboard(encoding = 'utf8') {
35
+ if (!this.isSimulator()) {
36
+ throw new Error('Getting pasteboard content is not supported on real devices');
37
+ }
38
+ return await /** @type {import('../driver').Simulator} */ (this.device).simctl.getPasteboard(encoding);
39
+ }
40
40
  /**
41
41
  * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
42
42
  */
@@ -1 +1 @@
1
- {"version":3,"file":"pasteboard.js","sourceRoot":"","sources":["../../../lib/commands/pasteboard.js"],"names":[],"mappings":";;AAAA,kBAAe;IACb;;;;;;;;;OASG;IACH,KAAK,CAAC,mBAAmB,CAAC,OAAO,EAAE,QAAQ,GAAG,MAAM;QAClD,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;QACjF,CAAC;QACD,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,sBAAsB;YACtB,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAC5D,CAAC;QACD,OAAO,MAAM,4CAA4C,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,aAAa,CAC1F,OAAO,EAAE,6BAA6B,CAAC,CAAC,QAAQ,CAAC,CAClD,CAAC;IACJ,CAAC;IAED;;;;;;;;OAQG;IACH,KAAK,CAAC,mBAAmB,CAAC,QAAQ,GAAG,MAAM;QACzC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;YACxB,MAAM,IAAI,KAAK,CAAC,6DAA6D,CAAC,CAAC;QACjF,CAAC;QACD,OAAO,MAAM,4CAA4C,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAA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