@limrun/appium-xcuitest-driver 10.4.3-lim.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (444) hide show
  1. package/CHANGELOG.md +2600 -0
  2. package/LICENSE +201 -0
  3. package/README.md +55 -0
  4. package/build/index.d.ts +5 -0
  5. package/build/index.js +41 -0
  6. package/build/lib/app-infos-cache.d.ts +62 -0
  7. package/build/lib/app-infos-cache.d.ts.map +1 -0
  8. package/build/lib/app-infos-cache.js +180 -0
  9. package/build/lib/app-infos-cache.js.map +1 -0
  10. package/build/lib/app-utils.d.ts +89 -0
  11. package/build/lib/app-utils.d.ts.map +1 -0
  12. package/build/lib/app-utils.js +657 -0
  13. package/build/lib/app-utils.js.map +1 -0
  14. package/build/lib/commands/active-app-info.d.ts +9 -0
  15. package/build/lib/commands/active-app-info.d.ts.map +1 -0
  16. package/build/lib/commands/active-app-info.js +14 -0
  17. package/build/lib/commands/active-app-info.js.map +1 -0
  18. package/build/lib/commands/advanced-battery-types.d.ts +444 -0
  19. package/build/lib/commands/advanced-battery-types.d.ts.map +1 -0
  20. package/build/lib/commands/advanced-battery-types.js +8 -0
  21. package/build/lib/commands/advanced-battery-types.js.map +1 -0
  22. package/build/lib/commands/alert.d.ts +45 -0
  23. package/build/lib/commands/alert.d.ts.map +1 -0
  24. package/build/lib/commands/alert.js +87 -0
  25. package/build/lib/commands/alert.js.map +1 -0
  26. package/build/lib/commands/app-management.d.ts +153 -0
  27. package/build/lib/commands/app-management.d.ts.map +1 -0
  28. package/build/lib/commands/app-management.js +323 -0
  29. package/build/lib/commands/app-management.js.map +1 -0
  30. package/build/lib/commands/app-strings.d.ts +16 -0
  31. package/build/lib/commands/app-strings.d.ts.map +1 -0
  32. package/build/lib/commands/app-strings.js +30 -0
  33. package/build/lib/commands/app-strings.js.map +1 -0
  34. package/build/lib/commands/appearance.d.ts +22 -0
  35. package/build/lib/commands/appearance.d.ts.map +1 -0
  36. package/build/lib/commands/appearance.js +74 -0
  37. package/build/lib/commands/appearance.js.map +1 -0
  38. package/build/lib/commands/audit.d.ts +43 -0
  39. package/build/lib/commands/audit.d.ts.map +1 -0
  40. package/build/lib/commands/audit.js +31 -0
  41. package/build/lib/commands/audit.js.map +1 -0
  42. package/build/lib/commands/battery.d.ts +13 -0
  43. package/build/lib/commands/battery.d.ts.map +1 -0
  44. package/build/lib/commands/battery.js +49 -0
  45. package/build/lib/commands/battery.js.map +1 -0
  46. package/build/lib/commands/bidi/constants.d.ts +6 -0
  47. package/build/lib/commands/bidi/constants.d.ts.map +1 -0
  48. package/build/lib/commands/bidi/constants.js +10 -0
  49. package/build/lib/commands/bidi/constants.js.map +1 -0
  50. package/build/lib/commands/bidi/models.d.ts +9 -0
  51. package/build/lib/commands/bidi/models.d.ts.map +1 -0
  52. package/build/lib/commands/bidi/models.js +54 -0
  53. package/build/lib/commands/bidi/models.js.map +1 -0
  54. package/build/lib/commands/bidi/types.d.ts +26 -0
  55. package/build/lib/commands/bidi/types.d.ts.map +1 -0
  56. package/build/lib/commands/bidi/types.js +4 -0
  57. package/build/lib/commands/bidi/types.js.map +1 -0
  58. package/build/lib/commands/biometric.d.ts +32 -0
  59. package/build/lib/commands/biometric.d.ts.map +1 -0
  60. package/build/lib/commands/biometric.js +54 -0
  61. package/build/lib/commands/biometric.js.map +1 -0
  62. package/build/lib/commands/certificate.d.ts +50 -0
  63. package/build/lib/commands/certificate.d.ts.map +1 -0
  64. package/build/lib/commands/certificate.js +454 -0
  65. package/build/lib/commands/certificate.js.map +1 -0
  66. package/build/lib/commands/clipboard.d.ts +21 -0
  67. package/build/lib/commands/clipboard.d.ts.map +1 -0
  68. package/build/lib/commands/clipboard.js +36 -0
  69. package/build/lib/commands/clipboard.js.map +1 -0
  70. package/build/lib/commands/condition.d.ts +102 -0
  71. package/build/lib/commands/condition.d.ts.map +1 -0
  72. package/build/lib/commands/condition.js +146 -0
  73. package/build/lib/commands/condition.js.map +1 -0
  74. package/build/lib/commands/content-size.d.ts +30 -0
  75. package/build/lib/commands/content-size.d.ts.map +1 -0
  76. package/build/lib/commands/content-size.js +67 -0
  77. package/build/lib/commands/content-size.js.map +1 -0
  78. package/build/lib/commands/context.d.ts +191 -0
  79. package/build/lib/commands/context.d.ts.map +1 -0
  80. package/build/lib/commands/context.js +625 -0
  81. package/build/lib/commands/context.js.map +1 -0
  82. package/build/lib/commands/deviceInfo.d.ts +12 -0
  83. package/build/lib/commands/deviceInfo.d.ts.map +1 -0
  84. package/build/lib/commands/deviceInfo.js +25 -0
  85. package/build/lib/commands/deviceInfo.js.map +1 -0
  86. package/build/lib/commands/element.d.ts +108 -0
  87. package/build/lib/commands/element.d.ts.map +1 -0
  88. package/build/lib/commands/element.js +395 -0
  89. package/build/lib/commands/element.js.map +1 -0
  90. package/build/lib/commands/enum.d.ts +105 -0
  91. package/build/lib/commands/enum.d.ts.map +1 -0
  92. package/build/lib/commands/enum.js +113 -0
  93. package/build/lib/commands/enum.js.map +1 -0
  94. package/build/lib/commands/execute.d.ts +33 -0
  95. package/build/lib/commands/execute.d.ts.map +1 -0
  96. package/build/lib/commands/execute.js +142 -0
  97. package/build/lib/commands/execute.js.map +1 -0
  98. package/build/lib/commands/file-movement.d.ts +90 -0
  99. package/build/lib/commands/file-movement.d.ts.map +1 -0
  100. package/build/lib/commands/file-movement.js +477 -0
  101. package/build/lib/commands/file-movement.js.map +1 -0
  102. package/build/lib/commands/find.d.ts +21 -0
  103. package/build/lib/commands/find.d.ts.map +1 -0
  104. package/build/lib/commands/find.js +199 -0
  105. package/build/lib/commands/find.js.map +1 -0
  106. package/build/lib/commands/general.d.ts +137 -0
  107. package/build/lib/commands/general.d.ts.map +1 -0
  108. package/build/lib/commands/general.js +270 -0
  109. package/build/lib/commands/general.js.map +1 -0
  110. package/build/lib/commands/geolocation.d.ts +57 -0
  111. package/build/lib/commands/geolocation.d.ts.map +1 -0
  112. package/build/lib/commands/geolocation.js +58 -0
  113. package/build/lib/commands/geolocation.js.map +1 -0
  114. package/build/lib/commands/gesture.d.ts +283 -0
  115. package/build/lib/commands/gesture.d.ts.map +1 -0
  116. package/build/lib/commands/gesture.js +565 -0
  117. package/build/lib/commands/gesture.js.map +1 -0
  118. package/build/lib/commands/hid-event.d.ts +2773 -0
  119. package/build/lib/commands/hid-event.d.ts.map +1 -0
  120. package/build/lib/commands/hid-event.js +1633 -0
  121. package/build/lib/commands/hid-event.js.map +1 -0
  122. package/build/lib/commands/increase-contrast.d.ts +24 -0
  123. package/build/lib/commands/increase-contrast.d.ts.map +1 -0
  124. package/build/lib/commands/increase-contrast.js +49 -0
  125. package/build/lib/commands/increase-contrast.js.map +1 -0
  126. package/build/lib/commands/iohid.d.ts +1372 -0
  127. package/build/lib/commands/iohid.d.ts.map +1 -0
  128. package/build/lib/commands/iohid.js +63 -0
  129. package/build/lib/commands/iohid.js.map +1 -0
  130. package/build/lib/commands/keyboard.d.ts +32 -0
  131. package/build/lib/commands/keyboard.d.ts.map +1 -0
  132. package/build/lib/commands/keyboard.js +67 -0
  133. package/build/lib/commands/keyboard.js.map +1 -0
  134. package/build/lib/commands/keychains.d.ts +10 -0
  135. package/build/lib/commands/keychains.d.ts.map +1 -0
  136. package/build/lib/commands/keychains.js +22 -0
  137. package/build/lib/commands/keychains.js.map +1 -0
  138. package/build/lib/commands/localization.d.ts +17 -0
  139. package/build/lib/commands/localization.d.ts.map +1 -0
  140. package/build/lib/commands/localization.js +34 -0
  141. package/build/lib/commands/localization.js.map +1 -0
  142. package/build/lib/commands/location.d.ts +40 -0
  143. package/build/lib/commands/location.d.ts.map +1 -0
  144. package/build/lib/commands/location.js +121 -0
  145. package/build/lib/commands/location.js.map +1 -0
  146. package/build/lib/commands/lock.d.ts +23 -0
  147. package/build/lib/commands/lock.d.ts.map +1 -0
  148. package/build/lib/commands/lock.js +49 -0
  149. package/build/lib/commands/lock.js.map +1 -0
  150. package/build/lib/commands/log.d.ts +68 -0
  151. package/build/lib/commands/log.d.ts.map +1 -0
  152. package/build/lib/commands/log.js +287 -0
  153. package/build/lib/commands/log.js.map +1 -0
  154. package/build/lib/commands/memory.d.ts +11 -0
  155. package/build/lib/commands/memory.d.ts.map +1 -0
  156. package/build/lib/commands/memory.js +49 -0
  157. package/build/lib/commands/memory.js.map +1 -0
  158. package/build/lib/commands/navigation.d.ts +44 -0
  159. package/build/lib/commands/navigation.d.ts.map +1 -0
  160. package/build/lib/commands/navigation.js +121 -0
  161. package/build/lib/commands/navigation.js.map +1 -0
  162. package/build/lib/commands/notifications.d.ts +28 -0
  163. package/build/lib/commands/notifications.d.ts.map +1 -0
  164. package/build/lib/commands/notifications.js +64 -0
  165. package/build/lib/commands/notifications.js.map +1 -0
  166. package/build/lib/commands/pasteboard.d.ts +23 -0
  167. package/build/lib/commands/pasteboard.d.ts.map +1 -0
  168. package/build/lib/commands/pasteboard.js +43 -0
  169. package/build/lib/commands/pasteboard.js.map +1 -0
  170. package/build/lib/commands/pcap.d.ts +54 -0
  171. package/build/lib/commands/pcap.d.ts.map +1 -0
  172. package/build/lib/commands/pcap.js +149 -0
  173. package/build/lib/commands/pcap.js.map +1 -0
  174. package/build/lib/commands/performance.d.ts +85 -0
  175. package/build/lib/commands/performance.d.ts.map +1 -0
  176. package/build/lib/commands/performance.js +331 -0
  177. package/build/lib/commands/performance.js.map +1 -0
  178. package/build/lib/commands/permissions.d.ts +36 -0
  179. package/build/lib/commands/permissions.d.ts.map +1 -0
  180. package/build/lib/commands/permissions.js +80 -0
  181. package/build/lib/commands/permissions.js.map +1 -0
  182. package/build/lib/commands/proxy-helper.d.ts +15 -0
  183. package/build/lib/commands/proxy-helper.d.ts.map +1 -0
  184. package/build/lib/commands/proxy-helper.js +117 -0
  185. package/build/lib/commands/proxy-helper.js.map +1 -0
  186. package/build/lib/commands/record-audio.d.ts +69 -0
  187. package/build/lib/commands/record-audio.d.ts.map +1 -0
  188. package/build/lib/commands/record-audio.js +228 -0
  189. package/build/lib/commands/record-audio.js.map +1 -0
  190. package/build/lib/commands/recordscreen.d.ts +89 -0
  191. package/build/lib/commands/recordscreen.d.ts.map +1 -0
  192. package/build/lib/commands/recordscreen.js +326 -0
  193. package/build/lib/commands/recordscreen.js.map +1 -0
  194. package/build/lib/commands/screenshots.d.ts +16 -0
  195. package/build/lib/commands/screenshots.d.ts.map +1 -0
  196. package/build/lib/commands/screenshots.js +129 -0
  197. package/build/lib/commands/screenshots.js.map +1 -0
  198. package/build/lib/commands/simctl.d.ts +27 -0
  199. package/build/lib/commands/simctl.d.ts.map +1 -0
  200. package/build/lib/commands/simctl.js +65 -0
  201. package/build/lib/commands/simctl.js.map +1 -0
  202. package/build/lib/commands/source.d.ts +16 -0
  203. package/build/lib/commands/source.d.ts.map +1 -0
  204. package/build/lib/commands/source.js +128 -0
  205. package/build/lib/commands/source.js.map +1 -0
  206. package/build/lib/commands/timeouts.d.ts +53 -0
  207. package/build/lib/commands/timeouts.d.ts.map +1 -0
  208. package/build/lib/commands/timeouts.js +71 -0
  209. package/build/lib/commands/timeouts.js.map +1 -0
  210. package/build/lib/commands/types.d.ts +539 -0
  211. package/build/lib/commands/types.d.ts.map +1 -0
  212. package/build/lib/commands/types.js +3 -0
  213. package/build/lib/commands/types.js.map +1 -0
  214. package/build/lib/commands/web.d.ts +297 -0
  215. package/build/lib/commands/web.d.ts.map +1 -0
  216. package/build/lib/commands/web.js +1029 -0
  217. package/build/lib/commands/web.js.map +1 -0
  218. package/build/lib/commands/xctest-record-screen.d.ts +92 -0
  219. package/build/lib/commands/xctest-record-screen.d.ts.map +1 -0
  220. package/build/lib/commands/xctest-record-screen.js +193 -0
  221. package/build/lib/commands/xctest-record-screen.js.map +1 -0
  222. package/build/lib/commands/xctest.d.ts +71 -0
  223. package/build/lib/commands/xctest.d.ts.map +1 -0
  224. package/build/lib/commands/xctest.js +257 -0
  225. package/build/lib/commands/xctest.js.map +1 -0
  226. package/build/lib/css-converter.d.ts +10 -0
  227. package/build/lib/css-converter.d.ts.map +1 -0
  228. package/build/lib/css-converter.js +258 -0
  229. package/build/lib/css-converter.js.map +1 -0
  230. package/build/lib/desired-caps.d.ts +506 -0
  231. package/build/lib/desired-caps.d.ts.map +1 -0
  232. package/build/lib/desired-caps.js +400 -0
  233. package/build/lib/desired-caps.js.map +1 -0
  234. package/build/lib/device-connections-factory.d.ts +13 -0
  235. package/build/lib/device-connections-factory.d.ts.map +1 -0
  236. package/build/lib/device-connections-factory.js +244 -0
  237. package/build/lib/device-connections-factory.js.map +1 -0
  238. package/build/lib/device-log/helpers.d.ts +10 -0
  239. package/build/lib/device-log/helpers.d.ts.map +1 -0
  240. package/build/lib/device-log/helpers.js +37 -0
  241. package/build/lib/device-log/helpers.js.map +1 -0
  242. package/build/lib/device-log/ios-crash-log.d.ts +34 -0
  243. package/build/lib/device-log/ios-crash-log.d.ts.map +1 -0
  244. package/build/lib/device-log/ios-crash-log.js +141 -0
  245. package/build/lib/device-log/ios-crash-log.js.map +1 -0
  246. package/build/lib/device-log/ios-device-log.d.ts +19 -0
  247. package/build/lib/device-log/ios-device-log.d.ts.map +1 -0
  248. package/build/lib/device-log/ios-device-log.js +42 -0
  249. package/build/lib/device-log/ios-device-log.js.map +1 -0
  250. package/build/lib/device-log/ios-log.d.ts +24 -0
  251. package/build/lib/device-log/ios-log.d.ts.map +1 -0
  252. package/build/lib/device-log/ios-log.js +50 -0
  253. package/build/lib/device-log/ios-log.js.map +1 -0
  254. package/build/lib/device-log/ios-performance-log.d.ts +18 -0
  255. package/build/lib/device-log/ios-performance-log.d.ts.map +1 -0
  256. package/build/lib/device-log/ios-performance-log.js +43 -0
  257. package/build/lib/device-log/ios-performance-log.js.map +1 -0
  258. package/build/lib/device-log/ios-simulator-log.d.ts +38 -0
  259. package/build/lib/device-log/ios-simulator-log.d.ts.map +1 -0
  260. package/build/lib/device-log/ios-simulator-log.js +184 -0
  261. package/build/lib/device-log/ios-simulator-log.js.map +1 -0
  262. package/build/lib/device-log/line-consuming-log.d.ts +9 -0
  263. package/build/lib/device-log/line-consuming-log.d.ts.map +1 -0
  264. package/build/lib/device-log/line-consuming-log.js +16 -0
  265. package/build/lib/device-log/line-consuming-log.js.map +1 -0
  266. package/build/lib/device-log/safari-console-log.d.ts +67 -0
  267. package/build/lib/device-log/safari-console-log.d.ts.map +1 -0
  268. package/build/lib/device-log/safari-console-log.js +81 -0
  269. package/build/lib/device-log/safari-console-log.js.map +1 -0
  270. package/build/lib/device-log/safari-network-log.d.ts +75 -0
  271. package/build/lib/device-log/safari-network-log.d.ts.map +1 -0
  272. package/build/lib/device-log/safari-network-log.js +47 -0
  273. package/build/lib/device-log/safari-network-log.js.map +1 -0
  274. package/build/lib/doctor/checks.d.ts +3 -0
  275. package/build/lib/doctor/checks.d.ts.map +1 -0
  276. package/build/lib/doctor/checks.js +39 -0
  277. package/build/lib/doctor/checks.js.map +1 -0
  278. package/build/lib/doctor/optional-checks.d.ts +46 -0
  279. package/build/lib/doctor/optional-checks.d.ts.map +1 -0
  280. package/build/lib/doctor/optional-checks.js +129 -0
  281. package/build/lib/doctor/optional-checks.js.map +1 -0
  282. package/build/lib/doctor/required-checks.d.ts +42 -0
  283. package/build/lib/doctor/required-checks.d.ts.map +1 -0
  284. package/build/lib/doctor/required-checks.js +94 -0
  285. package/build/lib/doctor/required-checks.js.map +1 -0
  286. package/build/lib/doctor/utils.d.ts +8 -0
  287. package/build/lib/doctor/utils.d.ts.map +1 -0
  288. package/build/lib/doctor/utils.js +21 -0
  289. package/build/lib/doctor/utils.js.map +1 -0
  290. package/build/lib/driver.d.ts +2429 -0
  291. package/build/lib/driver.d.ts.map +1 -0
  292. package/build/lib/driver.js +1967 -0
  293. package/build/lib/driver.js.map +1 -0
  294. package/build/lib/execute-method-map.d.ts +552 -0
  295. package/build/lib/execute-method-map.d.ts.map +1 -0
  296. package/build/lib/execute-method-map.js +586 -0
  297. package/build/lib/execute-method-map.js.map +1 -0
  298. package/build/lib/ios-fs-helpers.d.ts +75 -0
  299. package/build/lib/ios-fs-helpers.d.ts.map +1 -0
  300. package/build/lib/ios-fs-helpers.js +370 -0
  301. package/build/lib/ios-fs-helpers.js.map +1 -0
  302. package/build/lib/ios-generic-simulators.d.ts +6 -0
  303. package/build/lib/ios-generic-simulators.d.ts.map +1 -0
  304. package/build/lib/ios-generic-simulators.js +14 -0
  305. package/build/lib/ios-generic-simulators.js.map +1 -0
  306. package/build/lib/logger.d.ts +3 -0
  307. package/build/lib/logger.d.ts.map +1 -0
  308. package/build/lib/logger.js +6 -0
  309. package/build/lib/logger.js.map +1 -0
  310. package/build/lib/method-map.d.ts +229 -0
  311. package/build/lib/method-map.d.ts.map +1 -0
  312. package/build/lib/method-map.js +200 -0
  313. package/build/lib/method-map.js.map +1 -0
  314. package/build/lib/real-device-clients/base-device-client.d.ts +22 -0
  315. package/build/lib/real-device-clients/base-device-client.d.ts.map +1 -0
  316. package/build/lib/real-device-clients/base-device-client.js +14 -0
  317. package/build/lib/real-device-clients/base-device-client.js.map +1 -0
  318. package/build/lib/real-device-clients/py-ios-device-client.d.ts +21 -0
  319. package/build/lib/real-device-clients/py-ios-device-client.d.ts.map +1 -0
  320. package/build/lib/real-device-clients/py-ios-device-client.js +125 -0
  321. package/build/lib/real-device-clients/py-ios-device-client.js.map +1 -0
  322. package/build/lib/real-device-management.d.ts +53 -0
  323. package/build/lib/real-device-management.d.ts.map +1 -0
  324. package/build/lib/real-device-management.js +128 -0
  325. package/build/lib/real-device-management.js.map +1 -0
  326. package/build/lib/real-device.d.ts +112 -0
  327. package/build/lib/real-device.d.ts.map +1 -0
  328. package/build/lib/real-device.js +352 -0
  329. package/build/lib/real-device.js.map +1 -0
  330. package/build/lib/simulator-management.d.ts +96 -0
  331. package/build/lib/simulator-management.d.ts.map +1 -0
  332. package/build/lib/simulator-management.js +278 -0
  333. package/build/lib/simulator-management.js.map +1 -0
  334. package/build/lib/stubs.d.ts +3 -0
  335. package/build/lib/stubs.d.ts.map +1 -0
  336. package/build/lib/stubs.js +3 -0
  337. package/build/lib/stubs.js.map +1 -0
  338. package/build/lib/types.d.ts +31 -0
  339. package/build/lib/types.d.ts.map +1 -0
  340. package/build/lib/types.js +3 -0
  341. package/build/lib/types.js.map +1 -0
  342. package/build/lib/utils.d.ts +191 -0
  343. package/build/lib/utils.d.ts.map +1 -0
  344. package/build/lib/utils.js +549 -0
  345. package/build/lib/utils.js.map +1 -0
  346. package/build/lib/xcrun.d.ts +3 -0
  347. package/build/lib/xcrun.d.ts.map +1 -0
  348. package/build/lib/xcrun.js +17 -0
  349. package/build/lib/xcrun.js.map +1 -0
  350. package/index.js +7 -0
  351. package/lib/app-infos-cache.js +187 -0
  352. package/lib/app-utils.js +710 -0
  353. package/lib/commands/active-app-info.js +12 -0
  354. package/lib/commands/advanced-battery-types.ts +454 -0
  355. package/lib/commands/alert.js +88 -0
  356. package/lib/commands/app-management.js +346 -0
  357. package/lib/commands/app-strings.js +30 -0
  358. package/lib/commands/appearance.js +71 -0
  359. package/lib/commands/audit.js +31 -0
  360. package/lib/commands/battery.js +45 -0
  361. package/lib/commands/bidi/constants.ts +6 -0
  362. package/lib/commands/bidi/models.ts +55 -0
  363. package/lib/commands/bidi/types.ts +31 -0
  364. package/lib/commands/biometric.js +53 -0
  365. package/lib/commands/certificate.js +497 -0
  366. package/lib/commands/clipboard.js +35 -0
  367. package/lib/commands/condition.js +155 -0
  368. package/lib/commands/content-size.js +68 -0
  369. package/lib/commands/context.js +705 -0
  370. package/lib/commands/deviceInfo.js +27 -0
  371. package/lib/commands/element.js +423 -0
  372. package/lib/commands/enum.ts +108 -0
  373. package/lib/commands/execute.js +153 -0
  374. package/lib/commands/file-movement.js +510 -0
  375. package/lib/commands/find.js +205 -0
  376. package/lib/commands/general.js +278 -0
  377. package/lib/commands/geolocation.js +56 -0
  378. package/lib/commands/gesture.js +596 -0
  379. package/lib/commands/hid-event.ts +1634 -0
  380. package/lib/commands/increase-contrast.js +50 -0
  381. package/lib/commands/iohid.js +64 -0
  382. package/lib/commands/keyboard.js +62 -0
  383. package/lib/commands/keychains.js +18 -0
  384. package/lib/commands/localization.js +30 -0
  385. package/lib/commands/location.js +131 -0
  386. package/lib/commands/lock.js +46 -0
  387. package/lib/commands/log.js +327 -0
  388. package/lib/commands/memory.js +51 -0
  389. package/lib/commands/navigation.js +125 -0
  390. package/lib/commands/notifications.js +66 -0
  391. package/lib/commands/pasteboard.js +42 -0
  392. package/lib/commands/pcap.js +168 -0
  393. package/lib/commands/performance.js +392 -0
  394. package/lib/commands/permissions.js +85 -0
  395. package/lib/commands/proxy-helper.js +122 -0
  396. package/lib/commands/record-audio.js +264 -0
  397. package/lib/commands/recordscreen.js +391 -0
  398. package/lib/commands/screenshots.js +137 -0
  399. package/lib/commands/simctl.js +71 -0
  400. package/lib/commands/source.js +131 -0
  401. package/lib/commands/timeouts.js +68 -0
  402. package/lib/commands/types.ts +648 -0
  403. package/lib/commands/web.js +1113 -0
  404. package/lib/commands/xctest-record-screen.js +204 -0
  405. package/lib/commands/xctest.js +285 -0
  406. package/lib/css-converter.js +311 -0
  407. package/lib/desired-caps.js +396 -0
  408. package/lib/device-connections-factory.js +269 -0
  409. package/lib/device-log/helpers.ts +40 -0
  410. package/lib/device-log/ios-crash-log.ts +166 -0
  411. package/lib/device-log/ios-device-log.ts +51 -0
  412. package/lib/device-log/ios-log.ts +70 -0
  413. package/lib/device-log/ios-performance-log.ts +50 -0
  414. package/lib/device-log/ios-simulator-log.ts +202 -0
  415. package/lib/device-log/line-consuming-log.ts +16 -0
  416. package/lib/device-log/safari-console-log.ts +117 -0
  417. package/lib/device-log/safari-network-log.ts +120 -0
  418. package/lib/doctor/checks.ts +3 -0
  419. package/lib/doctor/optional-checks.ts +173 -0
  420. package/lib/doctor/required-checks.ts +120 -0
  421. package/lib/doctor/utils.ts +18 -0
  422. package/lib/driver.js +2316 -0
  423. package/lib/execute-method-map.ts +585 -0
  424. package/lib/ios-fs-helpers.js +355 -0
  425. package/lib/ios-generic-simulators.js +11 -0
  426. package/lib/logger.js +5 -0
  427. package/lib/method-map.js +196 -0
  428. package/lib/real-device-clients/base-device-client.ts +34 -0
  429. package/lib/real-device-clients/py-ios-device-client.ts +149 -0
  430. package/lib/real-device-management.js +133 -0
  431. package/lib/real-device.js +347 -0
  432. package/lib/simulator-management.js +324 -0
  433. package/lib/stubs.ts +3 -0
  434. package/lib/types.ts +33 -0
  435. package/lib/utils.js +551 -0
  436. package/lib/xcrun.js +16 -0
  437. package/package.json +175 -0
  438. package/scripts/build-docs.js +56 -0
  439. package/scripts/build-wda.js +42 -0
  440. package/scripts/download-wda-sim.mjs +68 -0
  441. package/scripts/image-mounter.mjs +239 -0
  442. package/scripts/open-wda.mjs +15 -0
  443. package/scripts/tunnel-creation.mjs +359 -0
  444. package/scripts/utils.js +16 -0
@@ -0,0 +1,287 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.supportedLogTypes = void 0;
7
+ exports.extractLogs = extractLogs;
8
+ exports.startLogCapture = startLogCapture;
9
+ exports.mobileStartLogsBroadcast = mobileStartLogsBroadcast;
10
+ exports.mobileStopLogsBroadcast = mobileStopLogsBroadcast;
11
+ exports.assignBiDiLogListener = assignBiDiLogListener;
12
+ const lodash_1 = __importDefault(require("lodash"));
13
+ const bluebird_1 = __importDefault(require("bluebird"));
14
+ const driver_1 = require("appium/driver");
15
+ const ios_crash_log_1 = require("../device-log/ios-crash-log");
16
+ const ios_simulator_log_1 = require("../device-log/ios-simulator-log");
17
+ const ios_device_log_1 = require("../device-log/ios-device-log");
18
+ const ws_1 = __importDefault(require("ws"));
19
+ const safari_console_log_1 = require("../device-log/safari-console-log");
20
+ const safari_network_log_1 = require("../device-log/safari-network-log");
21
+ const helpers_1 = require("../device-log/helpers");
22
+ const utils_1 = require("../utils");
23
+ const constants_1 = require("./bidi/constants");
24
+ const models_1 = require("./bidi/models");
25
+ /**
26
+ * Determines the websocket endpoint based on the `sessionId`
27
+ * @param {string} sessionId
28
+ * @returns {string}
29
+ */
30
+ const WEBSOCKET_ENDPOINT = (sessionId) => `${driver_1.DEFAULT_WS_PATHNAME_PREFIX}/session/${sessionId}/appium/device/syslog`;
31
+ const COLOR_CODE_PATTERN = /\u001b\[(\d+(;\d+)*)?m/g; // eslint-disable-line no-control-regex
32
+ const GET_SERVER_LOGS_FEATURE = 'get_server_logs';
33
+ /**
34
+ * @type {import('@appium/types').LogDefRecord}
35
+ * @privateRemarks The return types for these getters should be specified
36
+ */
37
+ const SUPPORTED_LOG_TYPES = {
38
+ syslog: {
39
+ description: 'System Logs - Device logs for iOS applications on real devices and simulators',
40
+ getter: async (self) => await self.extractLogs('syslog', self.logs),
41
+ },
42
+ crashlog: {
43
+ description: 'Crash Logs - Crash reports for iOS applications on real devices and simulators',
44
+ getter: async (self) => await self.extractLogs('crashlog', self.logs),
45
+ },
46
+ performance: {
47
+ description: 'Performance Logs - Debug Timelines on real devices and simulators',
48
+ getter: async (self) => await self.extractLogs('performance', self.logs),
49
+ },
50
+ safariConsole: {
51
+ description: 'Safari Console Logs - data written to the JS console in Safari',
52
+ getter: async (self) => await self.extractLogs('safariConsole', self.logs),
53
+ },
54
+ safariNetwork: {
55
+ description: 'Safari Network Logs - information about network operations undertaken by Safari',
56
+ getter: async (self) => await self.extractLogs('safariNetwork', self.logs),
57
+ },
58
+ server: {
59
+ description: 'Appium server logs',
60
+ /**
61
+ * @returns {import('./types').LogEntry[]}
62
+ */
63
+ getter: (self) => {
64
+ self.assertFeatureEnabled(GET_SERVER_LOGS_FEATURE);
65
+ return self.log.unwrap().record.map(nativeLogEntryToSeleniumEntry);
66
+ },
67
+ },
68
+ };
69
+ const LOG_NAMES_TO_CAPABILITY_NAMES_MAP = {
70
+ safariConsole: 'showSafariConsoleLog',
71
+ safariNetwork: 'showSafariNetworkLog',
72
+ enablePerformanceLogging: 'enablePerformanceLogging',
73
+ };
74
+ exports.supportedLogTypes = SUPPORTED_LOG_TYPES;
75
+ /**
76
+ *
77
+ * @param {XCUITestDriverLogTypes} logType
78
+ * @param {Partial<Record<XCUITestDriverLogTypes,{getLogs(): Promise<any>}>>} [logsContainer]
79
+ * @this {XCUITestDriver}
80
+ */
81
+ async function extractLogs(logType, logsContainer = {}) {
82
+ // make sure that we have logs at all
83
+ // otherwise it's not been initialized
84
+ if (lodash_1.default.isEmpty(logsContainer)) {
85
+ throw new Error('No logs currently available. Is the device/simulator started?');
86
+ }
87
+ // If logs captured successfully send response with data, else send error
88
+ const logObject = logsContainer[logType];
89
+ if (logObject) {
90
+ return await logObject.getLogs();
91
+ }
92
+ if (logType in LOG_NAMES_TO_CAPABILITY_NAMES_MAP) {
93
+ throw new Error(`${logType} logs are not enabled. Make sure you've set a proper value ` +
94
+ `to the 'appium:${LOG_NAMES_TO_CAPABILITY_NAMES_MAP[logType]}' capability.`);
95
+ }
96
+ throw new Error(`No logs of type '${logType}' found. Supported log types are: ${lodash_1.default.keys(SUPPORTED_LOG_TYPES)}.`);
97
+ }
98
+ /**
99
+ * @this {XCUITestDriver}
100
+ */
101
+ async function startLogCapture() {
102
+ this.logs = this.logs || {};
103
+ if (!lodash_1.default.isUndefined(this.logs.syslog) && this.logs.syslog.isCapturing) {
104
+ this.log.warn('Trying to start iOS log capture but it has already started!');
105
+ return true;
106
+ }
107
+ if (lodash_1.default.isUndefined(this.logs.syslog)) {
108
+ [this.logs.crashlog,] = assignBiDiLogListener.bind(this)(new ios_crash_log_1.IOSCrashLog({
109
+ sim: /** @type {import('@limrun/appium-ios-simulator').Simulator} */ (this.device),
110
+ udid: this.isRealDevice() ? this.opts.udid : undefined,
111
+ log: this.log,
112
+ }), {
113
+ type: 'crashlog',
114
+ });
115
+ [this.logs.syslog,] = assignBiDiLogListener.bind(this)(this.isRealDevice()
116
+ ? new ios_device_log_1.IOSDeviceLog({
117
+ udid: this.opts.udid,
118
+ showLogs: this.opts.showIOSLog,
119
+ log: this.log,
120
+ })
121
+ : new ios_simulator_log_1.IOSSimulatorLog({
122
+ sim: /** @type {import('@limrun/appium-ios-simulator').Simulator} */ (this.device),
123
+ showLogs: this.opts.showIOSLog,
124
+ iosSimulatorLogsPredicate: this.opts.iosSimulatorLogsPredicate,
125
+ simulatorLogLevel: this.opts.simulatorLogLevel,
126
+ log: this.log,
127
+ iosSyslogFile: this.opts.iosSyslogFile
128
+ }), {
129
+ type: 'syslog',
130
+ });
131
+ if (lodash_1.default.isBoolean(this.opts.showSafariConsoleLog)) {
132
+ [this.logs.safariConsole,] = assignBiDiLogListener.bind(this)(new safari_console_log_1.SafariConsoleLog({
133
+ showLogs: this.opts.showSafariConsoleLog,
134
+ log: this.log,
135
+ }), {
136
+ type: 'safariConsole',
137
+ });
138
+ }
139
+ if (lodash_1.default.isBoolean(this.opts.showSafariNetworkLog)) {
140
+ [this.logs.safariNetwork,] = assignBiDiLogListener.bind(this)(new safari_network_log_1.SafariNetworkLog({
141
+ showLogs: this.opts.showSafariNetworkLog,
142
+ log: this.log,
143
+ }), {
144
+ type: 'safariNetwork',
145
+ });
146
+ }
147
+ if (this.isFeatureEnabled(GET_SERVER_LOGS_FEATURE)) {
148
+ [, this._bidiServerLogListener] = assignBiDiLogListener.bind(this)(this.log.unwrap(), {
149
+ type: 'server',
150
+ srcEventName: 'log',
151
+ entryTransformer: nativeLogEntryToSeleniumEntry,
152
+ });
153
+ }
154
+ }
155
+ let didStartSyslog = false;
156
+ /** @type {Promise[]} */
157
+ const promises = [
158
+ (async () => {
159
+ try {
160
+ await this.logs.syslog?.startCapture();
161
+ didStartSyslog = true;
162
+ this.eventEmitter.emit('syslogStarted', this.logs.syslog);
163
+ }
164
+ catch (err) {
165
+ this.log.debug(err.stack);
166
+ this.log.warn(`Continuing without capturing device logs: ${err.message}`);
167
+ }
168
+ })(),
169
+ this.logs.crashlog?.startCapture() ?? bluebird_1.default.resolve(),
170
+ ];
171
+ await bluebird_1.default.all(promises);
172
+ return didStartSyslog;
173
+ }
174
+ /**
175
+ * Starts an iOS system logs broadcast websocket.
176
+ *
177
+ * The websocket listens on the same host and port as Appium. The endpoint created is `/ws/session/:sessionId:/appium/syslog`.
178
+ *
179
+ * If the websocket is already running, this command does nothing.
180
+ *
181
+ * Each connected webcoket listener will receive syslog lines as soon as they are visible to Appium.
182
+ * @see https://appiumpro.com/editions/55-using-mobile-execution-commands-to-continuously-stream-device-logs-with-appium
183
+ * @returns {Promise<void>}
184
+ * @this {XCUITestDriver}
185
+ */
186
+ async function mobileStartLogsBroadcast() {
187
+ const pathname = WEBSOCKET_ENDPOINT(/** @type {string} */ (this.sessionId));
188
+ if (!lodash_1.default.isEmpty(await /** @type {import('@appium/types').AppiumServer} */ (this.server).getWebSocketHandlers(pathname))) {
189
+ this.log.debug(`The system logs broadcasting web socket server is already listening at ${pathname}`);
190
+ return;
191
+ }
192
+ this.log.info(`Assigning system logs broadcasting web socket server to ${pathname}`);
193
+ // https://github.com/websockets/ws/blob/master/doc/ws.md
194
+ const wss = new ws_1.default.Server({
195
+ noServer: true,
196
+ });
197
+ wss.on('connection', (ws, req) => {
198
+ if (req) {
199
+ const remoteIp = lodash_1.default.isEmpty(req.headers['x-forwarded-for'])
200
+ ? req.connection?.remoteAddress
201
+ : req.headers['x-forwarded-for'];
202
+ this.log.debug(`Established a new system logs listener web socket connection from ${remoteIp}`);
203
+ }
204
+ else {
205
+ this.log.debug('Established a new system logs listener web socket connection');
206
+ }
207
+ if (lodash_1.default.isEmpty(this._syslogWebsocketListener)) {
208
+ this._syslogWebsocketListener = (logRecord) => {
209
+ if (ws?.readyState === ws_1.default.OPEN) {
210
+ ws.send(logRecord.message);
211
+ }
212
+ };
213
+ }
214
+ this.logs.syslog?.on('output', this._syslogWebsocketListener);
215
+ ws.on('close', (code, reason) => {
216
+ if (!lodash_1.default.isEmpty(this._syslogWebsocketListener)) {
217
+ this.logs.syslog?.removeListener('output', this._syslogWebsocketListener);
218
+ this._syslogWebsocketListener = null;
219
+ }
220
+ let closeMsg = 'System logs listener web socket is closed.';
221
+ if (!lodash_1.default.isEmpty(code)) {
222
+ closeMsg += ` Code: ${code}.`;
223
+ }
224
+ if (!lodash_1.default.isEmpty(reason)) {
225
+ closeMsg += ` Reason: ${reason.toString()}.`;
226
+ }
227
+ this.log.debug(closeMsg);
228
+ });
229
+ });
230
+ await /** @type {AppiumServer} */ (this.server).addWebSocketHandler(pathname,
231
+ /** @type {import('@appium/types').WSServer} */ (wss));
232
+ }
233
+ /**
234
+ * Stops the syslog broadcasting wesocket server previously started by `mobile: startLogsBroadcast`.
235
+ * If no websocket server is running, this command does nothing.
236
+ * @this {XCUITestDriver}
237
+ * @returns {Promise<void>}
238
+ */
239
+ async function mobileStopLogsBroadcast() {
240
+ const pathname = WEBSOCKET_ENDPOINT(/** @type {string} */ (this.sessionId));
241
+ if (lodash_1.default.isEmpty(await /** @type {AppiumServer} */ (this.server).getWebSocketHandlers(pathname))) {
242
+ return;
243
+ }
244
+ this.log.debug('Stopping the system logs broadcasting web socket server');
245
+ await /** @type {AppiumServer} */ (this.server).removeWebSocketHandler(pathname);
246
+ }
247
+ /**
248
+ * https://w3c.github.io/webdriver-bidi/#event-log-entryAdded
249
+ *
250
+ * @template {import('node:events').EventEmitter} EE
251
+ * @this {XCUITestDriver}
252
+ * @param {EE} logEmitter
253
+ * @param {BiDiListenerProperties} properties
254
+ * @returns {[EE, import('./types').LogListener]}
255
+ */
256
+ function assignBiDiLogListener(logEmitter, properties) {
257
+ const { type, context = utils_1.NATIVE_WIN, srcEventName = 'output', entryTransformer, } = properties;
258
+ const listener = (/** @type {import('./types').LogEntry} */ logEntry) => {
259
+ const finalEntry = entryTransformer ? entryTransformer(logEntry) : logEntry;
260
+ this.eventEmitter.emit(constants_1.BIDI_EVENT_NAME, (0, models_1.makeLogEntryAddedEvent)(finalEntry, context, type));
261
+ };
262
+ logEmitter.on(srcEventName, listener);
263
+ return [logEmitter, listener];
264
+ }
265
+ /**
266
+ *
267
+ * @param {Object} x
268
+ * @returns {import('./types').LogEntry}
269
+ */
270
+ function nativeLogEntryToSeleniumEntry(x) {
271
+ const msg = lodash_1.default.isEmpty(x.prefix) ? x.message : `[${x.prefix}] ${x.message}`;
272
+ return (0, helpers_1.toLogEntry)(lodash_1.default.replace(msg, COLOR_CODE_PATTERN, ''),
273
+ /** @type {any} */ (x).timestamp ?? Date.now());
274
+ }
275
+ /**
276
+ * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
277
+ * @typedef {keyof typeof SUPPORTED_LOG_TYPES} XCUITestDriverLogTypes
278
+ * @typedef {import('@appium/types').AppiumServer} AppiumServer
279
+ */
280
+ /**
281
+ * @typedef {Object} BiDiListenerProperties
282
+ * @property {string} type
283
+ * @property {string} [srcEventName='output']
284
+ * @property {string} [context=NATIVE_WIN]
285
+ * @property {(x: Object) => import('./types').LogEntry} [entryTransformer]
286
+ */
287
+ //# sourceMappingURL=log.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log.js","sourceRoot":"","sources":["../../../lib/commands/log.js"],"names":[],"mappings":";;;;;;AA2EA,kCAqBC;AAKD,0CAqFC;AAcD,4DA2DC;AAQD,0DAQC;AAWD,sDAaC;AA3SD,oDAAuB;AACvB,wDAAyB;AACzB,0CAAyD;AACzD,+DAAwD;AACxD,uEAAgE;AAChE,iEAA0D;AAC1D,4CAA2B;AAC3B,yEAAoE;AACpE,yEAAoE;AACpE,mDAAmD;AACnD,oCAAsC;AACtC,gDAAmD;AACnD,0CAAuD;AAEvD;;;;GAIG;AACH,MAAM,kBAAkB,GAAG,CAAC,SAAS,EAAE,EAAE,CACvC,GAAG,mCAA0B,YAAY,SAAS,uBAAuB,CAAC;AAC5E,MAAM,kBAAkB,GAAG,yBAAyB,CAAC,CAAC,uCAAuC;AAC7F,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;AAElD;;;GAGG;AACH,MAAM,mBAAmB,GAAG;IAC1B,MAAM,EAAE;QACN,WAAW,EAAE,+EAA+E;QAC5F,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,CAAC,M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,CAAC;AAED;;;;GAIG;AACH,SAAS,6BAA6B,CAAE,CAAC;IACvC,MAAM,GAAG,GAAG,gBAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;IAC3E,OAAO,IAAA,oBAAU,EACf,gBAAC,CAAC,OAAO,CAAC,GAAG,EAAE,kBAAkB,EAAE,EAAE,CAAC;IACtC,kBAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC,GAAG,EAAE,CAC/C,CAAC;AACJ,CAAC;AAED;;;;GAIG;AAEH;;;;;;GAMG"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Simulates Low Memory warning on the given application
3
+ *
4
+ * @since Xcode 15
5
+ * @param {string} bundleId - The bundle identifier of the target app. The app must be running
6
+ * @this {XCUITestDriver}
7
+ * @throws {Error} if the app is not running or is not installed
8
+ */
9
+ export function mobileSendMemoryWarning(this: import("../driver").XCUITestDriver, bundleId: string): Promise<void>;
10
+ export type XCUITestDriver = import("../driver").XCUITestDriver;
11
+ //# sourceMappingURL=memory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../../lib/commands/memory.js"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,4FAJW,MAAM,iBAuChB;6BAGY,OAAO,WAAW,EAAE,cAAc"}
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.mobileSendMemoryWarning = mobileSendMemoryWarning;
7
+ const lodash_1 = __importDefault(require("lodash"));
8
+ const driver_1 = require("appium/driver");
9
+ /**
10
+ * Simulates Low Memory warning on the given application
11
+ *
12
+ * @since Xcode 15
13
+ * @param {string} bundleId - The bundle identifier of the target app. The app must be running
14
+ * @this {XCUITestDriver}
15
+ * @throws {Error} if the app is not running or is not installed
16
+ */
17
+ async function mobileSendMemoryWarning(bundleId) {
18
+ if (!this.isRealDevice()) {
19
+ throw new Error('Memory warning simulation is only supported on real devices');
20
+ }
21
+ const device = /** @type {import('../real-device').RealDevice} */ (this.device);
22
+ const appInfos = await device.devicectl.listApps(bundleId);
23
+ if (lodash_1.default.isEmpty(appInfos)) {
24
+ throw new driver_1.errors.InvalidArgumentError(`The application identified by ${bundleId} cannot be found on the device. Is it installed?`);
25
+ }
26
+ // This regexp tries to match the process name of the main bundle executable.
27
+ // For example, if 'url' contains something like
28
+ // `file:///private/var/containers/Bundle/Application/093ACA6D-8F0B-4601-87B9-4099E43A1A20/Target.app/`
29
+ // and the following processes might be running:
30
+ // `file:///private/var/containers/Bundle/Application/093ACA6D-8F0B-4601-87B9-4099E43A1A20/Target.app/Target`
31
+ // `file:///private/var/containers/Bundle/Application/093ACA6D-8F0B-4601-87B9-4099E43A1A20/Target.app/PlugIns/WidgetExtension.appex/WidgetExtension`
32
+ // then we only want to match the first one.
33
+ // Unfortunately devicectl does not provide more info which would
34
+ // allow to connect a bundle id to a process id.
35
+ const pattern = new RegExp(`^${lodash_1.default.escapeRegExp(appInfos[0].url)}[^/]+$`);
36
+ /** @type {number[]} */
37
+ const pids = (await device.devicectl.listProcesses())
38
+ .filter(({ executable }) => pattern.test(executable))
39
+ .map(({ processIdentifier }) => processIdentifier);
40
+ if (lodash_1.default.isEmpty(pids)) {
41
+ throw new driver_1.errors.InvalidArgumentError(`The application identified by ${bundleId} must be running in order to simulate the Low Memory warning`);
42
+ }
43
+ this.log.info(`Emulating Low Memory warning for the process id ${pids[0]}, bundle id ${bundleId}`);
44
+ await device.devicectl.sendMemoryWarning(pids[0]);
45
+ }
46
+ /**
47
+ * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
48
+ */
49
+ //# sourceMappingUR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I,CAAC,EAAE,CAAC;QACpB,MAAM,IAAI,eAAM,CAAC,oBAAoB,CACnC,iCAAiC,QAAQ,8DAA8D,CACxG,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,mDAAmD,IAAI,CAAC,CAAC,CAAC,eAAe,QAAQ,EAAE,CAAC,CAAC;IACnG,MAAM,MAAM,CAAC,SAAS,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC;AAED;;GAEG"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * @this {XCUITestDriver}
3
+ */
4
+ export function back(this: import("../driver").XCUITestDriver): Promise<void>;
5
+ /**
6
+ * @this {XCUITestDriver}
7
+ */
8
+ export function forward(this: import("../driver").XCUITestDriver): Promise<void>;
9
+ /**
10
+ * @this {XCUITestDriver}
11
+ */
12
+ export function closeWindow(this: import("../driver").XCUITestDriver): Promise<any>;
13
+ /**
14
+ * Opens the given URL with the default application assigned to handle it based on the URL
15
+ * scheme, or the application provided as an optional parameter
16
+ *
17
+ * (Note: the version of Xcode must be 14.3+ and iOS must be 16.4+)
18
+ *
19
+ * @param {string} url - the URL to be opened, e.g. `myscheme://yolo`
20
+ * @param {string} [bundleId] - the application to open the given URL with. If not provided, then
21
+ * the application assigned by the operating system to handle URLs of the appropriate type
22
+ * @returns {Promise<void>}
23
+ * @since 4.17
24
+ * @this {XCUITestDriver}
25
+ */
26
+ export function mobileDeepLink(this: import("../driver").XCUITestDriver, url: string, bundleId?: string): Promise<void>;
27
+ /**
28
+ * @this {XCUITestDriver}
29
+ */
30
+ export function nativeBack(this: import("../driver").XCUITestDriver): Promise<unknown>;
31
+ export type XCUITestDriver = import("../driver").XCUITestDriver;
32
+ export type DeepLinkOptions = {
33
+ /**
34
+ * The URL to be opened. This parameter is manadatory
35
+ */
36
+ url: string;
37
+ /**
38
+ * The bundle identifier of an application to open the
39
+ * given url with. If not provided then the default application for the given url scheme
40
+ * is going to be used.
41
+ */
42
+ bundleId: string | null;
43
+ };
44
+ //# sourceMappingURL=navigation.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,121 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
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;
11
+ const driver_1 = require("appium/driver");
12
+ const lodash_1 = __importDefault(require("lodash"));
13
+ const asyncbox_1 = require("asyncbox");
14
+ const utils_1 = require("../utils");
15
+ // these two constitute the wait after closing a window
16
+ const CLOSE_WINDOW_TIMEOUT = 5000;
17
+ const CLOSE_WINDOW_INTERVAL = 100;
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...
53
+ try {
54
+ await (0, asyncbox_1.waitForCondition)(() => this.curContext !== context, {
55
+ waitMs: CLOSE_WINDOW_TIMEOUT,
56
+ intervalMs: CLOSE_WINDOW_INTERVAL,
57
+ });
58
+ }
59
+ catch {
60
+ this.log.debug('Context has not yet been changed after closing window. Continuing...');
61
+ }
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');
96
+ }
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.`);
100
+ }
101
+ else {
102
+ this.log.debug(`Unable to find 'Back' button. Trying first button in navigation bar`);
103
+ backButton = buttons?.[0];
104
+ }
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
+ /**
112
+ * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
113
+ */
114
+ /**
115
+ * @typedef {Object} DeepLinkOptions
116
+ * @property {string} url The URL to be opened. This parameter is manadatory
117
+ * @property {string?} bundleId The bundle identifier of an application to open the
118
+ * given url with. If not provided then the default application for the given url scheme
119
+ * is going to be used.
120
+ */
121
+ //# sourceMappingURL=navigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"navigation.js","sourceRoot":"","sources":["../../../lib/commands/navigation.js"],"names":[],"mappings":";;;;;AAYA,oBAMC;AAKD,0BAIC;AAKD,kCAsBC;AAeD,wCAKC;AAKD,gCAiCC;AAhHD,0CAAqC;AACrC,oDAAuB;AACvB,uCAA0C;AAC1C,oCAAkC;AAElC,uDAAuD;AACvD,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAClC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AAElC;;GAEG;AACI,KAAK,UAAU,IAAI;IACxB,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;QACzB,MAAM,IAAI,CAAC,UAAU,EAAE,CAAC;IAC1B,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IAClC,CAAC;AACH,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,OAAO;IAC3B,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;IAC3B,CAAC;IACD,MAAM,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;AACrC,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,WAAW;IAC/B,IAAI,C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KAAK,CACN,CAAC;QACF,IAAI,OAAO,GAAG,MAAM,IAAI,CAAC,2BAA2B,CAClD,YAAY,EACZ,uBAAuB,EACvB,IAAI,EACJ,MAAM,CACP,CAAC;QACF,IAAI,OAAO,EAAE,MAAM,KAAK,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;QACxD,CAAC;QAED,IAAI,UAAU,GAAG,gBAAC,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;QACzE,IAAI,UAAU,EAAE,CAAC;YACf,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,+CAA+C,CAAC,CAAC;QAClE,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,qEAAqE,CAAC,CAAC;YACtF,UAAU,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC;QAC5B,CAAC;QACD,MAAM,IAAI,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;IAC7D,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,kDAAkD,GAAG,CAAC,OAAO,EAAE,CAAC,CAAC;IAClF,CAAC;AACH,CAAC;AAED;;GAEG;AAEH;;;;;;GAMG"}
@@ -0,0 +1,28 @@
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>;
27
+ export type XCUITestDriver = import("../driver").XCUITestDriver;
28
+ //# sourceMappingURL=notifications.d.ts.map
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.mobilePushNotification = mobilePushNotification;
7
+ exports.mobileExpectNotification = mobileExpectNotification;
8
+ const driver_1 = require("appium/driver");
9
+ const lodash_1 = __importDefault(require("lodash"));
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
+ /**
62
+ * @typedef {import('../driver').XCUITestDriver} XCUITestDriver
63
+ */
64
+ //# sourceMappingURL=notifications.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../../lib/commands/notifications.js"],"names":[],"mappings":";;;;;AAcA,wDA0BC;AAeD,4DAMC;AA7DD,0CAAqC;AACrC,oDAAuB;AAEvB;;;;;;;;;;GAUG;AACI,KAAK,UAAU,sBAAsB,CAAC,QAAQ,EAAE,OAAO;IAC5D,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IAED,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,MAAM,IAAI,eAAM,CAAC,oBAAoB,CACnC,8DAA8D,CAC/D,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,gBAAC,CAAC,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,CA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