@solidxai/core 0.1.22-beta.1 → 0.1.22-beta.2

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 (399) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/controllers/module-package.controller.d.ts +198 -0
  3. package/dist/controllers/module-package.controller.d.ts.map +1 -1
  4. package/dist/controllers/test-run.controller.d.ts +5 -0
  5. package/dist/controllers/test-run.controller.d.ts.map +1 -1
  6. package/dist/controllers/test-run.controller.js +17 -0
  7. package/dist/controllers/test-run.controller.js.map +1 -1
  8. package/dist/dtos/confirm-module-package-import.dto.d.ts +2 -0
  9. package/dist/dtos/confirm-module-package-import.dto.d.ts.map +1 -1
  10. package/dist/dtos/confirm-module-package-import.dto.js +21 -1
  11. package/dist/dtos/confirm-module-package-import.dto.js.map +1 -1
  12. package/dist/dtos/create-field-metadata.dto.d.ts.map +1 -1
  13. package/dist/dtos/create-field-metadata.dto.js +3 -3
  14. package/dist/dtos/create-field-metadata.dto.js.map +1 -1
  15. package/dist/dtos/create-model-metadata.dto.d.ts +6 -6
  16. package/dist/dtos/create-model-metadata.dto.d.ts.map +1 -1
  17. package/dist/dtos/create-model-metadata.dto.js +13 -7
  18. package/dist/dtos/create-model-metadata.dto.js.map +1 -1
  19. package/dist/dtos/test-run-request.dto.d.ts +12 -1
  20. package/dist/dtos/test-run-request.dto.d.ts.map +1 -1
  21. package/dist/dtos/test-run-request.dto.js +16 -1
  22. package/dist/dtos/test-run-request.dto.js.map +1 -1
  23. package/dist/helpers/module-package-sync.helper.d.ts +71 -0
  24. package/dist/helpers/module-package-sync.helper.d.ts.map +1 -0
  25. package/dist/helpers/module-package-sync.helper.js +318 -0
  26. package/dist/helpers/module-package-sync.helper.js.map +1 -0
  27. package/dist/helpers/module-package-sync.helper.spec.d.ts +2 -0
  28. package/dist/helpers/module-package-sync.helper.spec.d.ts.map +1 -0
  29. package/dist/helpers/module-package-sync.helper.spec.js +229 -0
  30. package/dist/helpers/module-package-sync.helper.spec.js.map +1 -0
  31. package/dist/index.d.ts +1 -0
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js.map +1 -1
  34. package/dist/jobs/database/test-run-queue-subscriber-database.service.d.ts +3 -1
  35. package/dist/jobs/database/test-run-queue-subscriber-database.service.d.ts.map +1 -1
  36. package/dist/jobs/database/test-run-queue-subscriber-database.service.js +19 -6
  37. package/dist/jobs/database/test-run-queue-subscriber-database.service.js.map +1 -1
  38. package/dist/seeders/module-metadata-seeder.service.d.ts +9 -0
  39. package/dist/seeders/module-metadata-seeder.service.d.ts.map +1 -1
  40. package/dist/seeders/module-metadata-seeder.service.js +138 -0
  41. package/dist/seeders/module-metadata-seeder.service.js.map +1 -1
  42. package/dist/seeders/seed-data/solid-core-metadata.json +0 -47
  43. package/dist/services/module-package.service.d.ts +38 -0
  44. package/dist/services/module-package.service.d.ts.map +1 -1
  45. package/dist/services/module-package.service.js +314 -33
  46. package/dist/services/module-package.service.js.map +1 -1
  47. package/dist/services/module-package.service.spec.d.ts +2 -0
  48. package/dist/services/module-package.service.spec.d.ts.map +1 -0
  49. package/dist/services/module-package.service.spec.js +347 -0
  50. package/dist/services/module-package.service.spec.js.map +1 -0
  51. package/dist/services/view-metadata.service.d.ts.map +1 -1
  52. package/dist/services/view-metadata.service.js +5 -4
  53. package/dist/services/view-metadata.service.js.map +1 -1
  54. package/dist/testing/__integration__/mobile-emulator.integration.d.ts +2 -0
  55. package/dist/testing/__integration__/mobile-emulator.integration.d.ts.map +1 -0
  56. package/dist/testing/__integration__/mobile-emulator.integration.js +368 -0
  57. package/dist/testing/__integration__/mobile-emulator.integration.js.map +1 -0
  58. package/dist/testing/adapters/mobile/capabilities.d.ts +4 -0
  59. package/dist/testing/adapters/mobile/capabilities.d.ts.map +1 -0
  60. package/dist/testing/adapters/mobile/capabilities.js +85 -0
  61. package/dist/testing/adapters/mobile/capabilities.js.map +1 -0
  62. package/dist/testing/adapters/mobile/capabilities.spec.d.ts +2 -0
  63. package/dist/testing/adapters/mobile/capabilities.spec.d.ts.map +1 -0
  64. package/dist/testing/adapters/mobile/capabilities.spec.js +215 -0
  65. package/dist/testing/adapters/mobile/capabilities.spec.js.map +1 -0
  66. package/dist/testing/adapters/mobile/fake-driver.d.ts +113 -0
  67. package/dist/testing/adapters/mobile/fake-driver.d.ts.map +1 -0
  68. package/dist/testing/adapters/mobile/fake-driver.js +122 -0
  69. package/dist/testing/adapters/mobile/fake-driver.js.map +1 -0
  70. package/dist/testing/adapters/mobile/ios-keyboard.d.ts +31 -0
  71. package/dist/testing/adapters/mobile/ios-keyboard.d.ts.map +1 -0
  72. package/dist/testing/adapters/mobile/ios-keyboard.js +157 -0
  73. package/dist/testing/adapters/mobile/ios-keyboard.js.map +1 -0
  74. package/dist/testing/adapters/mobile/ios-keyboard.spec.d.ts +2 -0
  75. package/dist/testing/adapters/mobile/ios-keyboard.spec.d.ts.map +1 -0
  76. package/dist/testing/adapters/mobile/ios-keyboard.spec.js +36 -0
  77. package/dist/testing/adapters/mobile/ios-keyboard.spec.js.map +1 -0
  78. package/dist/testing/adapters/mobile/locator.d.ts +12 -0
  79. package/dist/testing/adapters/mobile/locator.d.ts.map +1 -0
  80. package/dist/testing/adapters/mobile/locator.js +96 -0
  81. package/dist/testing/adapters/mobile/locator.js.map +1 -0
  82. package/dist/testing/adapters/mobile/locator.spec.d.ts +2 -0
  83. package/dist/testing/adapters/mobile/locator.spec.d.ts.map +1 -0
  84. package/dist/testing/adapters/mobile/locator.spec.js +136 -0
  85. package/dist/testing/adapters/mobile/locator.spec.js.map +1 -0
  86. package/dist/testing/adapters/mobile/logcat.d.ts +9 -0
  87. package/dist/testing/adapters/mobile/logcat.d.ts.map +1 -0
  88. package/dist/testing/adapters/mobile/logcat.js +28 -0
  89. package/dist/testing/adapters/mobile/logcat.js.map +1 -0
  90. package/dist/testing/adapters/mobile/logcat.spec.d.ts +2 -0
  91. package/dist/testing/adapters/mobile/logcat.spec.d.ts.map +1 -0
  92. package/dist/testing/adapters/mobile/logcat.spec.js +46 -0
  93. package/dist/testing/adapters/mobile/logcat.spec.js.map +1 -0
  94. package/dist/testing/adapters/mobile/mobile-adapter.d.ts +67 -0
  95. package/dist/testing/adapters/mobile/mobile-adapter.d.ts.map +1 -0
  96. package/dist/testing/adapters/mobile/mobile-adapter.ios.spec.d.ts +2 -0
  97. package/dist/testing/adapters/mobile/mobile-adapter.ios.spec.d.ts.map +1 -0
  98. package/dist/testing/adapters/mobile/mobile-adapter.ios.spec.js +240 -0
  99. package/dist/testing/adapters/mobile/mobile-adapter.ios.spec.js.map +1 -0
  100. package/dist/testing/adapters/mobile/mobile-adapter.js +494 -0
  101. package/dist/testing/adapters/mobile/mobile-adapter.js.map +1 -0
  102. package/dist/testing/adapters/mobile/mobile-adapter.spec.d.ts +2 -0
  103. package/dist/testing/adapters/mobile/mobile-adapter.spec.d.ts.map +1 -0
  104. package/dist/testing/adapters/mobile/mobile-adapter.spec.js +567 -0
  105. package/dist/testing/adapters/mobile/mobile-adapter.spec.js.map +1 -0
  106. package/dist/testing/adapters/mobile/mobile.types.d.ts +111 -0
  107. package/dist/testing/adapters/mobile/mobile.types.d.ts.map +1 -0
  108. package/dist/testing/adapters/mobile/mobile.types.js +3 -0
  109. package/dist/testing/adapters/mobile/mobile.types.js.map +1 -0
  110. package/dist/testing/adapters/mobile/phone-errors.d.ts +6 -0
  111. package/dist/testing/adapters/mobile/phone-errors.d.ts.map +1 -0
  112. package/dist/testing/adapters/mobile/phone-errors.js +43 -0
  113. package/dist/testing/adapters/mobile/phone-errors.js.map +1 -0
  114. package/dist/testing/adapters/mobile/platform.d.ts +7 -0
  115. package/dist/testing/adapters/mobile/platform.d.ts.map +1 -0
  116. package/dist/testing/adapters/mobile/platform.js +11 -0
  117. package/dist/testing/adapters/mobile/platform.js.map +1 -0
  118. package/dist/testing/adapters/mobile/resolve-mobile-target.d.ts +6 -0
  119. package/dist/testing/adapters/mobile/resolve-mobile-target.d.ts.map +1 -0
  120. package/dist/testing/adapters/mobile/resolve-mobile-target.js +95 -0
  121. package/dist/testing/adapters/mobile/resolve-mobile-target.js.map +1 -0
  122. package/dist/testing/adapters/mobile/resolve-mobile-target.spec.d.ts +2 -0
  123. package/dist/testing/adapters/mobile/resolve-mobile-target.spec.d.ts.map +1 -0
  124. package/dist/testing/adapters/mobile/resolve-mobile-target.spec.js +199 -0
  125. package/dist/testing/adapters/mobile/resolve-mobile-target.spec.js.map +1 -0
  126. package/dist/testing/adapters/mobile/run-options.d.ts +11 -0
  127. package/dist/testing/adapters/mobile/run-options.d.ts.map +1 -0
  128. package/dist/testing/adapters/mobile/run-options.js +41 -0
  129. package/dist/testing/adapters/mobile/run-options.js.map +1 -0
  130. package/dist/testing/adapters/mobile/run-options.spec.d.ts +2 -0
  131. package/dist/testing/adapters/mobile/run-options.spec.d.ts.map +1 -0
  132. package/dist/testing/adapters/mobile/run-options.spec.js +100 -0
  133. package/dist/testing/adapters/mobile/run-options.spec.js.map +1 -0
  134. package/dist/testing/adapters/mobile/syslog.d.ts +9 -0
  135. package/dist/testing/adapters/mobile/syslog.d.ts.map +1 -0
  136. package/dist/testing/adapters/mobile/syslog.js +45 -0
  137. package/dist/testing/adapters/mobile/syslog.js.map +1 -0
  138. package/dist/testing/adapters/mobile/syslog.spec.d.ts +2 -0
  139. package/dist/testing/adapters/mobile/syslog.spec.d.ts.map +1 -0
  140. package/dist/testing/adapters/mobile/syslog.spec.js +81 -0
  141. package/dist/testing/adapters/mobile/syslog.spec.js.map +1 -0
  142. package/dist/testing/adapters/ui/playwright-adapter.d.ts +24 -3
  143. package/dist/testing/adapters/ui/playwright-adapter.d.ts.map +1 -1
  144. package/dist/testing/adapters/ui/playwright-adapter.js +113 -14
  145. package/dist/testing/adapters/ui/playwright-adapter.js.map +1 -1
  146. package/dist/testing/adapters/ui/resolve-target.d.ts +12 -0
  147. package/dist/testing/adapters/ui/resolve-target.d.ts.map +1 -0
  148. package/dist/testing/adapters/ui/resolve-target.js +95 -0
  149. package/dist/testing/adapters/ui/resolve-target.js.map +1 -0
  150. package/dist/testing/adapters/ui/ui.types.d.ts +12 -0
  151. package/dist/testing/adapters/ui/ui.types.d.ts.map +1 -1
  152. package/dist/testing/adapters/ui/ui.types.js.map +1 -1
  153. package/dist/testing/contracts/runtime-context.types.d.ts +14 -0
  154. package/dist/testing/contracts/runtime-context.types.d.ts.map +1 -1
  155. package/dist/testing/contracts/runtime-context.types.js.map +1 -1
  156. package/dist/testing/contracts/testing-metadata.types.d.ts +28 -1
  157. package/dist/testing/contracts/testing-metadata.types.d.ts.map +1 -1
  158. package/dist/testing/contracts/testing-metadata.types.js.map +1 -1
  159. package/dist/testing/core/step-registry.d.ts +1 -0
  160. package/dist/testing/core/step-registry.d.ts.map +1 -1
  161. package/dist/testing/core/step-registry.js +3 -0
  162. package/dist/testing/core/step-registry.js.map +1 -1
  163. package/dist/testing/core/testing-engine.d.ts +16 -4
  164. package/dist/testing/core/testing-engine.d.ts.map +1 -1
  165. package/dist/testing/core/testing-engine.js +109 -33
  166. package/dist/testing/core/testing-engine.js.map +1 -1
  167. package/dist/testing/reporter/console-reporter.d.ts +7 -13
  168. package/dist/testing/reporter/console-reporter.d.ts.map +1 -1
  169. package/dist/testing/reporter/console-reporter.js +15 -1
  170. package/dist/testing/reporter/console-reporter.js.map +1 -1
  171. package/dist/testing/reporter/file-service-artifact-sink.d.ts +2 -0
  172. package/dist/testing/reporter/file-service-artifact-sink.d.ts.map +1 -1
  173. package/dist/testing/reporter/file-service-artifact-sink.js +2 -1
  174. package/dist/testing/reporter/file-service-artifact-sink.js.map +1 -1
  175. package/dist/testing/reporter/lifecycle-events.types.d.ts +11 -0
  176. package/dist/testing/reporter/lifecycle-events.types.d.ts.map +1 -1
  177. package/dist/testing/reporter/lifecycle-events.types.js.map +1 -1
  178. package/dist/testing/reporter/lifecycle-webhook-reporter.d.ts +7 -5
  179. package/dist/testing/reporter/lifecycle-webhook-reporter.d.ts.map +1 -1
  180. package/dist/testing/reporter/lifecycle-webhook-reporter.js +25 -1
  181. package/dist/testing/reporter/lifecycle-webhook-reporter.js.map +1 -1
  182. package/dist/testing/reporter/lifecycle-webhook-reporter.spec.d.ts +2 -0
  183. package/dist/testing/reporter/lifecycle-webhook-reporter.spec.d.ts.map +1 -0
  184. package/dist/testing/reporter/lifecycle-webhook-reporter.spec.js +72 -0
  185. package/dist/testing/reporter/lifecycle-webhook-reporter.spec.js.map +1 -0
  186. package/dist/testing/reporter/progress-reporter.d.ts +4 -13
  187. package/dist/testing/reporter/progress-reporter.d.ts.map +1 -1
  188. package/dist/testing/reporter/progress-reporter.js +5 -1
  189. package/dist/testing/reporter/progress-reporter.js.map +1 -1
  190. package/dist/testing/reporter/reporter.types.d.ts +27 -13
  191. package/dist/testing/reporter/reporter.types.d.ts.map +1 -1
  192. package/dist/testing/reporter/reporter.types.js.map +1 -1
  193. package/dist/testing/runner/lifecycle.d.ts +8 -0
  194. package/dist/testing/runner/lifecycle.d.ts.map +1 -1
  195. package/dist/testing/runner/lifecycle.js +80 -0
  196. package/dist/testing/runner/lifecycle.js.map +1 -1
  197. package/dist/testing/runner/lifecycle.spec.d.ts +2 -0
  198. package/dist/testing/runner/lifecycle.spec.d.ts.map +1 -0
  199. package/dist/testing/runner/lifecycle.spec.js +33 -0
  200. package/dist/testing/runner/lifecycle.spec.js.map +1 -0
  201. package/dist/testing/runner/mobile-session.d.ts +24 -0
  202. package/dist/testing/runner/mobile-session.d.ts.map +1 -0
  203. package/dist/testing/runner/mobile-session.js +96 -0
  204. package/dist/testing/runner/mobile-session.js.map +1 -0
  205. package/dist/testing/runner/mobile-session.spec.d.ts +2 -0
  206. package/dist/testing/runner/mobile-session.spec.d.ts.map +1 -0
  207. package/dist/testing/runner/mobile-session.spec.js +89 -0
  208. package/dist/testing/runner/mobile-session.spec.js.map +1 -0
  209. package/dist/testing/runner/recording-reporter.d.ts +62 -0
  210. package/dist/testing/runner/recording-reporter.d.ts.map +1 -0
  211. package/dist/testing/runner/recording-reporter.js +35 -0
  212. package/dist/testing/runner/recording-reporter.js.map +1 -0
  213. package/dist/testing/runner/run-cancellation.d.ts +7 -0
  214. package/dist/testing/runner/run-cancellation.d.ts.map +1 -0
  215. package/dist/testing/runner/run-cancellation.js +30 -0
  216. package/dist/testing/runner/run-cancellation.js.map +1 -0
  217. package/dist/testing/runner/run-from-metadata.cancel.spec.d.ts +2 -0
  218. package/dist/testing/runner/run-from-metadata.cancel.spec.d.ts.map +1 -0
  219. package/dist/testing/runner/run-from-metadata.cancel.spec.js +58 -0
  220. package/dist/testing/runner/run-from-metadata.cancel.spec.js.map +1 -0
  221. package/dist/testing/runner/run-from-metadata.d.ts +4 -0
  222. package/dist/testing/runner/run-from-metadata.d.ts.map +1 -1
  223. package/dist/testing/runner/run-from-metadata.js +152 -25
  224. package/dist/testing/runner/run-from-metadata.js.map +1 -1
  225. package/dist/testing/runner/run-from-metadata.mobile.spec.d.ts +2 -0
  226. package/dist/testing/runner/run-from-metadata.mobile.spec.d.ts.map +1 -0
  227. package/dist/testing/runner/run-from-metadata.mobile.spec.js +498 -0
  228. package/dist/testing/runner/run-from-metadata.mobile.spec.js.map +1 -0
  229. package/dist/testing/runner/run-from-metadata.spec.js +188 -0
  230. package/dist/testing/runner/run-from-metadata.spec.js.map +1 -1
  231. package/dist/testing/runner/scenario-graph.d.ts +8 -0
  232. package/dist/testing/runner/scenario-graph.d.ts.map +1 -0
  233. package/dist/testing/runner/scenario-graph.js +120 -0
  234. package/dist/testing/runner/scenario-graph.js.map +1 -0
  235. package/dist/testing/runner/scenario-graph.spec.d.ts +2 -0
  236. package/dist/testing/runner/scenario-graph.spec.d.ts.map +1 -0
  237. package/dist/testing/runner/scenario-graph.spec.js +97 -0
  238. package/dist/testing/runner/scenario-graph.spec.js.map +1 -0
  239. package/dist/testing/runtime/default-registry.d.ts +3 -0
  240. package/dist/testing/runtime/default-registry.d.ts.map +1 -0
  241. package/dist/testing/runtime/default-registry.js +21 -0
  242. package/dist/testing/runtime/default-registry.js.map +1 -0
  243. package/dist/testing/runtime/index.d.ts +22 -0
  244. package/dist/testing/runtime/index.d.ts.map +1 -0
  245. package/dist/testing/runtime/index.js +63 -0
  246. package/dist/testing/runtime/index.js.map +1 -0
  247. package/dist/testing/runtime/mobile-step-executor.spec.d.ts +2 -0
  248. package/dist/testing/runtime/mobile-step-executor.spec.d.ts.map +1 -0
  249. package/dist/testing/runtime/mobile-step-executor.spec.js +157 -0
  250. package/dist/testing/runtime/mobile-step-executor.spec.js.map +1 -0
  251. package/dist/testing/runtime/step-executor.d.ts +92 -0
  252. package/dist/testing/runtime/step-executor.d.ts.map +1 -0
  253. package/dist/testing/runtime/step-executor.js +171 -0
  254. package/dist/testing/runtime/step-executor.js.map +1 -0
  255. package/dist/testing/runtime/step-executor.spec.d.ts +2 -0
  256. package/dist/testing/runtime/step-executor.spec.d.ts.map +1 -0
  257. package/dist/testing/runtime/step-executor.spec.js +137 -0
  258. package/dist/testing/runtime/step-executor.spec.js.map +1 -0
  259. package/dist/testing/steps/mobile/actions.step.d.ts +3 -0
  260. package/dist/testing/steps/mobile/actions.step.d.ts.map +1 -0
  261. package/dist/testing/steps/mobile/actions.step.js +151 -0
  262. package/dist/testing/steps/mobile/actions.step.js.map +1 -0
  263. package/dist/testing/steps/mobile/app.step.d.ts +3 -0
  264. package/dist/testing/steps/mobile/app.step.d.ts.map +1 -0
  265. package/dist/testing/steps/mobile/app.step.js +20 -0
  266. package/dist/testing/steps/mobile/app.step.js.map +1 -0
  267. package/dist/testing/steps/mobile/assertions.step.d.ts +3 -0
  268. package/dist/testing/steps/mobile/assertions.step.d.ts.map +1 -0
  269. package/dist/testing/steps/mobile/assertions.step.js +55 -0
  270. package/dist/testing/steps/mobile/assertions.step.js.map +1 -0
  271. package/dist/testing/steps/mobile/gestures.step.d.ts +3 -0
  272. package/dist/testing/steps/mobile/gestures.step.d.ts.map +1 -0
  273. package/dist/testing/steps/mobile/gestures.step.js +85 -0
  274. package/dist/testing/steps/mobile/gestures.step.js.map +1 -0
  275. package/dist/testing/steps/mobile/index.d.ts +3 -0
  276. package/dist/testing/steps/mobile/index.d.ts.map +1 -0
  277. package/dist/testing/steps/mobile/index.js +14 -0
  278. package/dist/testing/steps/mobile/index.js.map +1 -0
  279. package/dist/testing/steps/mobile/mobile-steps.ios.spec.d.ts +2 -0
  280. package/dist/testing/steps/mobile/mobile-steps.ios.spec.d.ts.map +1 -0
  281. package/dist/testing/steps/mobile/mobile-steps.ios.spec.js +315 -0
  282. package/dist/testing/steps/mobile/mobile-steps.ios.spec.js.map +1 -0
  283. package/dist/testing/steps/mobile/mobile-steps.spec.d.ts +2 -0
  284. package/dist/testing/steps/mobile/mobile-steps.spec.d.ts.map +1 -0
  285. package/dist/testing/steps/mobile/mobile-steps.spec.js +338 -0
  286. package/dist/testing/steps/mobile/mobile-steps.spec.js.map +1 -0
  287. package/dist/testing/steps/mobile/shared.d.ts +13 -0
  288. package/dist/testing/steps/mobile/shared.d.ts.map +1 -0
  289. package/dist/testing/steps/mobile/shared.js +41 -0
  290. package/dist/testing/steps/mobile/shared.js.map +1 -0
  291. package/dist/testing/steps/mobile/swipe-line.d.ts +14 -0
  292. package/dist/testing/steps/mobile/swipe-line.d.ts.map +1 -0
  293. package/dist/testing/steps/mobile/swipe-line.js +20 -0
  294. package/dist/testing/steps/mobile/swipe-line.js.map +1 -0
  295. package/dist/testing/steps/mobile/swipe-line.spec.d.ts +2 -0
  296. package/dist/testing/steps/mobile/swipe-line.spec.d.ts.map +1 -0
  297. package/dist/testing/steps/mobile/swipe-line.spec.js +25 -0
  298. package/dist/testing/steps/mobile/swipe-line.spec.js.map +1 -0
  299. package/dist/testing/steps/ui/actions.step.d.ts.map +1 -1
  300. package/dist/testing/steps/ui/actions.step.js +8 -5
  301. package/dist/testing/steps/ui/actions.step.js.map +1 -1
  302. package/dist/testing/steps/ui/aria-snapshot.step.d.ts +3 -0
  303. package/dist/testing/steps/ui/aria-snapshot.step.d.ts.map +1 -0
  304. package/dist/testing/steps/ui/aria-snapshot.step.js +70 -0
  305. package/dist/testing/steps/ui/aria-snapshot.step.js.map +1 -0
  306. package/dist/testing/steps/ui/assertions.step.d.ts.map +1 -1
  307. package/dist/testing/steps/ui/assertions.step.js +5 -2
  308. package/dist/testing/steps/ui/assertions.step.js.map +1 -1
  309. package/dist/testing/steps/ui/form.step.d.ts.map +1 -1
  310. package/dist/testing/steps/ui/form.step.js +7 -3
  311. package/dist/testing/steps/ui/form.step.js.map +1 -1
  312. package/dist/testing/steps/ui/index.d.ts.map +1 -1
  313. package/dist/testing/steps/ui/index.js +2 -0
  314. package/dist/testing/steps/ui/index.js.map +1 -1
  315. package/package.json +15 -5
  316. package/src/controllers/test-run.controller.ts +17 -1
  317. package/src/dtos/confirm-module-package-import.dto.ts +16 -0
  318. package/src/dtos/create-field-metadata.dto.ts +4 -3
  319. package/src/dtos/create-model-metadata.dto.ts +19 -13
  320. package/src/dtos/test-run-request.dto.ts +18 -0
  321. package/src/entities/media-migration-plan.md +20 -0
  322. package/src/helpers/module-package-sync.helper.spec.ts +253 -0
  323. package/src/helpers/module-package-sync.helper.ts +381 -0
  324. package/src/index.ts +3 -0
  325. package/src/jobs/database/test-run-queue-subscriber-database.service.ts +21 -5
  326. package/src/seeders/module-metadata-seeder.service.ts +154 -0
  327. package/src/seeders/seed-data/solid-core-metadata.json +0 -47
  328. package/src/services/module-package.service.spec.ts +398 -0
  329. package/src/services/module-package.service.ts +433 -37
  330. package/src/services/view-metadata.service.ts +6 -4
  331. package/src/testing/README.md +198 -1
  332. package/src/testing/__integration__/mobile-emulator.integration.ts +409 -0
  333. package/src/testing/adapters/mobile/capabilities.spec.ts +247 -0
  334. package/src/testing/adapters/mobile/capabilities.ts +108 -0
  335. package/src/testing/adapters/mobile/fake-driver.ts +133 -0
  336. package/src/testing/adapters/mobile/ios-keyboard.spec.ts +40 -0
  337. package/src/testing/adapters/mobile/ios-keyboard.ts +187 -0
  338. package/src/testing/adapters/mobile/locator.spec.ts +200 -0
  339. package/src/testing/adapters/mobile/locator.ts +118 -0
  340. package/src/testing/adapters/mobile/logcat.spec.ts +63 -0
  341. package/src/testing/adapters/mobile/logcat.ts +44 -0
  342. package/src/testing/adapters/mobile/mobile-adapter.ios.spec.ts +277 -0
  343. package/src/testing/adapters/mobile/mobile-adapter.spec.ts +632 -0
  344. package/src/testing/adapters/mobile/mobile-adapter.ts +599 -0
  345. package/src/testing/adapters/mobile/mobile.types.ts +177 -0
  346. package/src/testing/adapters/mobile/phone-errors.ts +59 -0
  347. package/src/testing/adapters/mobile/platform.ts +15 -0
  348. package/src/testing/adapters/mobile/resolve-mobile-target.spec.ts +227 -0
  349. package/src/testing/adapters/mobile/resolve-mobile-target.ts +104 -0
  350. package/src/testing/adapters/mobile/run-options.spec.ts +121 -0
  351. package/src/testing/adapters/mobile/run-options.ts +49 -0
  352. package/src/testing/adapters/mobile/syslog.spec.ts +108 -0
  353. package/src/testing/adapters/mobile/syslog.ts +57 -0
  354. package/src/testing/adapters/ui/playwright-adapter.ts +149 -22
  355. package/src/testing/adapters/ui/resolve-target.ts +121 -0
  356. package/src/testing/adapters/ui/ui.types.ts +23 -0
  357. package/src/testing/contracts/runtime-context.types.ts +24 -0
  358. package/src/testing/contracts/testing-metadata.types.ts +72 -1
  359. package/src/testing/core/step-registry.ts +4 -0
  360. package/src/testing/core/testing-engine.ts +148 -42
  361. package/src/testing/reporter/console-reporter.ts +22 -10
  362. package/src/testing/reporter/file-service-artifact-sink.ts +9 -3
  363. package/src/testing/reporter/lifecycle-events.types.ts +17 -0
  364. package/src/testing/reporter/lifecycle-webhook-reporter.spec.ts +77 -0
  365. package/src/testing/reporter/lifecycle-webhook-reporter.ts +31 -2
  366. package/src/testing/reporter/progress-reporter.ts +9 -10
  367. package/src/testing/reporter/reporter.types.ts +37 -9
  368. package/src/testing/runner/lifecycle.spec.ts +41 -0
  369. package/src/testing/runner/lifecycle.ts +95 -0
  370. package/src/testing/runner/mobile-session.spec.ts +106 -0
  371. package/src/testing/runner/mobile-session.ts +138 -0
  372. package/src/testing/runner/recording-reporter.ts +34 -0
  373. package/src/testing/runner/run-cancellation.ts +38 -0
  374. package/src/testing/runner/run-from-metadata.cancel.spec.ts +75 -0
  375. package/src/testing/runner/run-from-metadata.mobile.spec.ts +580 -0
  376. package/src/testing/runner/run-from-metadata.spec.ts +180 -2
  377. package/src/testing/runner/run-from-metadata.ts +215 -33
  378. package/src/testing/runner/scenario-graph.spec.ts +122 -0
  379. package/src/testing/runner/scenario-graph.ts +142 -0
  380. package/src/testing/runtime/default-registry.ts +19 -0
  381. package/src/testing/runtime/index.ts +79 -0
  382. package/src/testing/runtime/mobile-step-executor.spec.ts +177 -0
  383. package/src/testing/runtime/step-executor.spec.ts +156 -0
  384. package/src/testing/runtime/step-executor.ts +315 -0
  385. package/src/testing/steps/mobile/actions.step.ts +176 -0
  386. package/src/testing/steps/mobile/app.step.ts +23 -0
  387. package/src/testing/steps/mobile/assertions.step.ts +59 -0
  388. package/src/testing/steps/mobile/gestures.step.ts +102 -0
  389. package/src/testing/steps/mobile/index.ts +12 -0
  390. package/src/testing/steps/mobile/mobile-steps.ios.spec.ts +364 -0
  391. package/src/testing/steps/mobile/mobile-steps.spec.ts +415 -0
  392. package/src/testing/steps/mobile/shared.ts +48 -0
  393. package/src/testing/steps/mobile/swipe-line.spec.ts +27 -0
  394. package/src/testing/steps/mobile/swipe-line.ts +30 -0
  395. package/src/testing/steps/ui/actions.step.ts +11 -8
  396. package/src/testing/steps/ui/aria-snapshot.step.ts +101 -0
  397. package/src/testing/steps/ui/assertions.step.ts +7 -9
  398. package/src/testing/steps/ui/form.step.ts +10 -10
  399. package/src/testing/steps/ui/index.ts +2 -0
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=mobile-steps.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mobile-steps.spec.d.ts","sourceRoot":"","sources":["../../../../src/testing/steps/mobile/mobile-steps.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,338 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const fake_driver_1 = require("../../adapters/mobile/fake-driver");
4
+ const mobile_adapter_1 = require("../../adapters/mobile/mobile-adapter");
5
+ const step_registry_1 = require("../../core/step-registry");
6
+ const index_1 = require("./index");
7
+ const ALL_OPS = [
8
+ "mobile.launch",
9
+ "mobile.reset",
10
+ "mobile.terminate",
11
+ "mobile.tap",
12
+ "mobile.type",
13
+ "mobile.clear",
14
+ "mobile.swipe",
15
+ "mobile.scrollTo",
16
+ "mobile.back",
17
+ "mobile.hideKeyboard",
18
+ "mobile.submit",
19
+ "mobile.expectVisible",
20
+ "mobile.expectHidden",
21
+ "mobile.expectText",
22
+ "mobile.getText",
23
+ ];
24
+ const save = { by: "accessibilityId", value: "Save" };
25
+ async function setup(started = true, clock = new fake_driver_1.FakeClock(), defaultTimeoutMs) {
26
+ const driver = new fake_driver_1.FakeDriver();
27
+ const mobile = new mobile_adapter_1.MobileAdapter({
28
+ appiumUrl: "http://localhost:4723",
29
+ udid: "emulator-5554",
30
+ appSource: "installed",
31
+ appPackage: "com.acme.app",
32
+ appActivity: ".MainActivity",
33
+ recordVideo: false,
34
+ driverFactory: async () => driver,
35
+ clock,
36
+ defaultTimeoutMs,
37
+ });
38
+ if (started)
39
+ await mobile.start();
40
+ const registry = new step_registry_1.StepRegistry();
41
+ (0, index_1.registerMobileSteps)(registry);
42
+ const ctx = { scenarioId: "s1", scenarioType: "mobile", params: {}, mobile };
43
+ const run = (op, withArgs, extra = {}) => registry.get(op)(ctx, { op, with: withArgs, ...extra });
44
+ return { driver, mobile, registry, ctx, run };
45
+ }
46
+ const executes = (driver) => driver.callsTo("execute").map((call) => call.args);
47
+ describe("mobile steps", () => {
48
+ it("registers every op", async () => {
49
+ const { registry } = await setup();
50
+ for (const op of ALL_OPS)
51
+ expect(registry.has(op)).toBe(true);
52
+ });
53
+ it("every op needs a started mobile session", async () => {
54
+ const { run } = await setup(false);
55
+ for (const op of ALL_OPS) {
56
+ await expect(run(op, { locator: save, text: "x", equals: "x", direction: "up" })).rejects.toThrow(`Missing mobile session on context for op "${op}"`);
57
+ }
58
+ });
59
+ describe("app steps", () => {
60
+ it("launch restarts the app without clearing data", async () => {
61
+ const { run, driver } = await setup();
62
+ await run("mobile.launch");
63
+ expect(executes(driver).map((args) => args[0])).toEqual([
64
+ "mobile: terminateApp",
65
+ "mobile: activateApp",
66
+ "mobile: queryAppState",
67
+ ]);
68
+ });
69
+ it("launch with clearData wipes the app's data", async () => {
70
+ const { run, driver } = await setup();
71
+ await run("mobile.launch", { clearData: true });
72
+ expect(executes(driver).map((args) => args[0])).toContain("mobile: clearApp");
73
+ });
74
+ it("launch rejects a clearData that is not a boolean", async () => {
75
+ const { run } = await setup();
76
+ await expect(run("mobile.launch", { clearData: "yes" })).rejects.toThrow('"clearData" must be true or false for op "mobile.launch"');
77
+ });
78
+ it("reset always clears data", async () => {
79
+ const { run, driver } = await setup();
80
+ await run("mobile.reset");
81
+ expect(executes(driver).map((args) => args[0])).toContain("mobile: clearApp");
82
+ });
83
+ it("terminate stops the app", async () => {
84
+ const { run, driver } = await setup();
85
+ await run("mobile.terminate");
86
+ expect(executes(driver)).toEqual([["mobile: terminateApp", { appId: "com.acme.app" }]]);
87
+ });
88
+ });
89
+ describe("tap, type and clear", () => {
90
+ it("tap waits for the element and clicks it", async () => {
91
+ const { run, driver } = await setup();
92
+ const [button] = driver.add("~Save", new fake_driver_1.FakeElement());
93
+ await run("mobile.tap", { locator: save });
94
+ expect(button.displayChecks).toBe(1);
95
+ expect(button.calls).toContain("click");
96
+ });
97
+ it("tap needs a locator", async () => {
98
+ const { run } = await setup();
99
+ await expect(run("mobile.tap", {})).rejects.toThrow('Missing "locator" in step.with for op "mobile.tap"');
100
+ });
101
+ it("tap fails on an ambiguous locator", async () => {
102
+ const { run, driver } = await setup();
103
+ driver.add("~Save", new fake_driver_1.FakeElement(), new fake_driver_1.FakeElement());
104
+ await expect(run("mobile.tap", { locator: save })).rejects.toThrow("matched 2 elements");
105
+ });
106
+ it("tap taps the match at index", async () => {
107
+ const { run, driver } = await setup();
108
+ const [, second] = driver.add("~Save", new fake_driver_1.FakeElement(), new fake_driver_1.FakeElement());
109
+ await run("mobile.tap", { locator: { ...save, index: 1 } });
110
+ expect(second.calls).toContain("click");
111
+ });
112
+ it("uses the step's timeout, from with.timeoutMs or step.timeoutMs", async () => {
113
+ const { run } = await setup();
114
+ await expect(run("mobile.tap", { locator: save, timeoutMs: 3000 })).rejects.toThrow("after 3000 ms");
115
+ await expect(run("mobile.tap", { locator: save }, { timeoutMs: 4000 })).rejects.toThrow("after 4000 ms");
116
+ });
117
+ it("type replaces the text by default", async () => {
118
+ const { run, driver } = await setup();
119
+ const [field] = driver.add("~Name", new fake_driver_1.FakeElement({ text: "old" }));
120
+ await run("mobile.type", { locator: { by: "accessibilityId", value: "Name" }, text: "bob" });
121
+ expect(field.calls).toContain("setValue:bob");
122
+ expect(field.text).toBe("bob");
123
+ });
124
+ it("type appends with clear: false, and accepts a number", async () => {
125
+ const { run, driver } = await setup();
126
+ const [field] = driver.add("~Pin", new fake_driver_1.FakeElement({ text: "12" }));
127
+ await run("mobile.type", { locator: { by: "accessibilityId", value: "Pin" }, text: 34, clear: false });
128
+ expect(field.text).toBe("1234");
129
+ });
130
+ it("type needs text", async () => {
131
+ const { run } = await setup();
132
+ await expect(run("mobile.type", { locator: save })).rejects.toThrow('Missing "text" in step.with for op "mobile.type"');
133
+ });
134
+ it("type rejects a clear that is not a boolean", async () => {
135
+ const { run } = await setup();
136
+ await expect(run("mobile.type", { locator: save, text: "x", clear: "no" })).rejects.toThrow('"clear" must be true or false for op "mobile.type"');
137
+ });
138
+ it("clear empties the field", async () => {
139
+ const { run, driver } = await setup();
140
+ const [field] = driver.add("~Name", new fake_driver_1.FakeElement({ text: "bob" }));
141
+ await run("mobile.clear", { locator: { by: "accessibilityId", value: "Name" } });
142
+ expect(field.text).toBe("");
143
+ });
144
+ });
145
+ describe("back and hideKeyboard", () => {
146
+ it("back presses back", async () => {
147
+ const { run, driver } = await setup();
148
+ await run("mobile.back");
149
+ expect(driver.callsTo("back")).toHaveLength(1);
150
+ });
151
+ it("hideKeyboard hides it only when it is shown", async () => {
152
+ const { run, driver } = await setup();
153
+ await run("mobile.hideKeyboard");
154
+ expect(driver.callsTo("hideKeyboard")).toHaveLength(0);
155
+ driver.keyboardShown = true;
156
+ await run("mobile.hideKeyboard");
157
+ expect(driver.callsTo("hideKeyboard")).toHaveLength(1);
158
+ });
159
+ });
160
+ describe("swipe", () => {
161
+ it("swipes across the screen, clear of the system bars, when there is no locator", async () => {
162
+ const { run, driver } = await setup();
163
+ await run("mobile.swipe", { direction: "up" });
164
+ expect(executes(driver)[0]).toEqual([
165
+ "mobile: swipeGesture",
166
+ { left: 108, top: 240, width: 864, height: 1920, direction: "up", percent: 0.75 },
167
+ ]);
168
+ });
169
+ it("swipes inside an element when it has a locator, with a custom percent", async () => {
170
+ const { run, driver } = await setup();
171
+ driver.add("~List", new fake_driver_1.FakeElement({ location: { x: 10, y: 20 }, size: { width: 500, height: 800 } }));
172
+ await run("mobile.swipe", { direction: "left", percent: 0.5, locator: { by: "accessibilityId", value: "List" } });
173
+ expect(executes(driver)[0]).toEqual([
174
+ "mobile: swipeGesture",
175
+ { left: 10, top: 20, width: 500, height: 800, direction: "left", percent: 0.5 },
176
+ ]);
177
+ });
178
+ it.each([[undefined], ["sideways"], [3]])("rejects direction %p", async (direction) => {
179
+ const { run } = await setup();
180
+ await expect(run("mobile.swipe", { direction })).rejects.toThrow('"direction" must be one of up, down, left, right for op "mobile.swipe"');
181
+ });
182
+ it.each([[0], [1.5], ["half"]])("rejects percent %p", async (percent) => {
183
+ const { run } = await setup();
184
+ await expect(run("mobile.swipe", { direction: "up", percent })).rejects.toThrow('"percent" must be a number from 0.1 to 1 for op "mobile.swipe"');
185
+ });
186
+ });
187
+ describe("scrollTo", () => {
188
+ const target = { by: "accessibilityId", value: "Target" };
189
+ it("does not swipe when the element is already on screen", async () => {
190
+ const { run, driver } = await setup();
191
+ driver.add("~Target", new fake_driver_1.FakeElement());
192
+ await run("mobile.scrollTo", { locator: target });
193
+ expect(executes(driver)).toHaveLength(0);
194
+ });
195
+ it("swipes up to scroll down until the element appears", async () => {
196
+ const { run, driver } = await setup();
197
+ const original = driver.execute.bind(driver);
198
+ let swipes = 0;
199
+ driver.execute = async (script, ...args) => {
200
+ if (script === "mobile: swipeGesture") {
201
+ swipes += 1;
202
+ if (swipes === 2)
203
+ driver.add("~Target", new fake_driver_1.FakeElement());
204
+ }
205
+ return original(script, ...args);
206
+ };
207
+ await run("mobile.scrollTo", { locator: target });
208
+ expect(swipes).toBe(2);
209
+ const swipeArgs = driver.callsTo("execute").filter((c) => c.args[0] === "mobile: swipeGesture");
210
+ expect(swipeArgs[0].args[1].direction).toBe("up");
211
+ });
212
+ it("scrolls up by swiping down", async () => {
213
+ const { run, driver } = await setup();
214
+ await expect(run("mobile.scrollTo", { locator: target, direction: "up", maxSwipes: 1 })).rejects.toThrow();
215
+ const swipeArgs = driver.callsTo("execute").filter((c) => c.args[0] === "mobile: swipeGesture");
216
+ expect(swipeArgs[0].args[1].direction).toBe("down");
217
+ });
218
+ it("gives up after maxSwipes, naming the locator", async () => {
219
+ const { run, driver } = await setup();
220
+ await expect(run("mobile.scrollTo", { locator: target, maxSwipes: 3 })).rejects.toThrow('{ by: "accessibilityId", value: "Target" } not found after 3 swipes');
221
+ expect(executes(driver).filter((args) => args[0] === "mobile: swipeGesture")).toHaveLength(3);
222
+ });
223
+ it("does not keep scrolling when the locator is ambiguous", async () => {
224
+ const { run, driver } = await setup();
225
+ driver.add("~Target", new fake_driver_1.FakeElement(), new fake_driver_1.FakeElement());
226
+ await expect(run("mobile.scrollTo", { locator: target })).rejects.toThrow("matched 2 elements");
227
+ expect(executes(driver)).toHaveLength(0);
228
+ });
229
+ it("validates its options", async () => {
230
+ const { run } = await setup();
231
+ await expect(run("mobile.scrollTo", { locator: target, direction: "left" })).rejects.toThrow('"direction" must be down or up for op "mobile.scrollTo"');
232
+ await expect(run("mobile.scrollTo", { locator: target, maxSwipes: 0 })).rejects.toThrow('"maxSwipes" must be a whole number >= 1 for op "mobile.scrollTo"');
233
+ await expect(run("mobile.scrollTo", {})).rejects.toThrow('Missing "locator" in step.with for op "mobile.scrollTo"');
234
+ });
235
+ });
236
+ describe("assertions", () => {
237
+ const title = { by: "accessibilityId", value: "Title" };
238
+ it("expectVisible passes for a displayed element and fails for a missing one", async () => {
239
+ const { run, driver } = await setup();
240
+ driver.add("~Title", new fake_driver_1.FakeElement());
241
+ await run("mobile.expectVisible", { locator: title });
242
+ await expect(run("mobile.expectVisible", { locator: { by: "accessibilityId", value: "Nope" }, timeoutMs: 2000 })).rejects.toThrow('No element matches { by: "accessibilityId", value: "Nope" } after 2000 ms');
243
+ });
244
+ it("expectHidden passes when absent, and fails while visible", async () => {
245
+ const { run, driver } = await setup();
246
+ driver.add("~Title", new fake_driver_1.FakeElement());
247
+ await run("mobile.expectHidden", { locator: { by: "accessibilityId", value: "Gone" } });
248
+ await expect(run("mobile.expectHidden", { locator: title, timeoutMs: 1000 })).rejects.toThrow("is still visible after 1000 ms");
249
+ });
250
+ it("getText returns the text", async () => {
251
+ const { run, driver } = await setup();
252
+ driver.add("~Title", new fake_driver_1.FakeElement({ text: "Hello" }));
253
+ expect(await run("mobile.getText", { locator: title })).toBe("Hello");
254
+ });
255
+ describe("expectText", () => {
256
+ it("equals", async () => {
257
+ const { run, driver } = await setup();
258
+ driver.add("~Title", new fake_driver_1.FakeElement({ text: "Hello" }));
259
+ expect(await run("mobile.expectText", { locator: title, equals: "Hello" })).toBe("Hello");
260
+ await expect(run("mobile.expectText", { locator: title, equals: "Bye" })).rejects.toThrow('Expected text of { by: "accessibilityId", value: "Title" } to equal "Bye", got "Hello"');
261
+ });
262
+ it("contains", async () => {
263
+ const { run, driver } = await setup();
264
+ driver.add("~Title", new fake_driver_1.FakeElement({ text: "Hello world" }));
265
+ await run("mobile.expectText", { locator: title, contains: "world" });
266
+ await expect(run("mobile.expectText", { locator: title, contains: "moon" })).rejects.toThrow('to contain "moon", got "Hello world"');
267
+ });
268
+ it("matches", async () => {
269
+ const { run, driver } = await setup();
270
+ driver.add("~Title", new fake_driver_1.FakeElement({ text: "Order 123" }));
271
+ await run("mobile.expectText", { locator: title, matches: "^Order \\d+$" });
272
+ await expect(run("mobile.expectText", { locator: title, matches: "^Cart" })).rejects.toThrow('to match "^Cart"');
273
+ });
274
+ it("needs exactly one comparison", async () => {
275
+ const { run } = await setup();
276
+ const message = 'mobile.expectText needs exactly one of "equals", "contains", "matches"';
277
+ await expect(run("mobile.expectText", { locator: title })).rejects.toThrow(message);
278
+ await expect(run("mobile.expectText", { locator: title, equals: "a", contains: "b" })).rejects.toThrow(message);
279
+ });
280
+ it("rejects an invalid regular expression before touching the device", async () => {
281
+ const { run, driver } = await setup();
282
+ await expect(run("mobile.expectText", { locator: title, matches: "(" })).rejects.toThrow('"matches" is not a valid regular expression');
283
+ expect(driver.callsTo("$$")).toHaveLength(0);
284
+ });
285
+ });
286
+ });
287
+ });
288
+ describe("optional steps on a slow device", () => {
289
+ const realClock = { now: () => Date.now(), sleep: (ms) => new Promise((r) => setTimeout(r, ms)) };
290
+ const maybe = { by: "accessibilityId", value: "Maybe" };
291
+ it("skips an element that is not there even when the device is slower than the optional wait to say so", async () => {
292
+ const { run, driver } = await setup(true, realClock);
293
+ driver.lookupDelayMs = 400;
294
+ await expect(run("mobile.tap", { locator: maybe, optional: true, timeoutMs: 100 })).resolves.toEqual({ skipped: "optional-not-found" });
295
+ });
296
+ it("taps an element a slow device reports late", async () => {
297
+ const { run, driver } = await setup(true, realClock);
298
+ const [element] = driver.add("~Maybe", new fake_driver_1.FakeElement());
299
+ driver.lookupDelayMs = 400;
300
+ await run("mobile.tap", { locator: maybe, optional: true, timeoutMs: 100 });
301
+ expect(element.calls).toContain("click");
302
+ });
303
+ it("still fails when the device does not answer at all", async () => {
304
+ const { run, driver } = await setup(true, realClock, 300);
305
+ driver.lookupDelayMs = 1500;
306
+ await expect(run("mobile.tap", { locator: maybe, optional: true, timeoutMs: 100 })).rejects.toThrow("The device did not answer");
307
+ });
308
+ it("scrollTo takes a slow device's answer that the element is already on screen", async () => {
309
+ const { run, driver } = await setup(true, realClock);
310
+ driver.add("~Target", new fake_driver_1.FakeElement());
311
+ driver.lookupDelayMs = 1500;
312
+ await run("mobile.scrollTo", { locator: { by: "accessibilityId", value: "Target" } });
313
+ expect(executes(driver)).toHaveLength(0);
314
+ });
315
+ });
316
+ describe("mobile.submit on Android", () => {
317
+ it("performs the editor action the field asked for", async () => {
318
+ const { run, driver } = await setup();
319
+ await run("mobile.submit", { action: "search" });
320
+ expect(executes(driver)).toEqual([["mobile: performEditorAction", { action: "search" }]]);
321
+ });
322
+ it("performs 'done' when no action is named", async () => {
323
+ const { run, driver } = await setup();
324
+ await run("mobile.submit");
325
+ expect(executes(driver)).toEqual([["mobile: performEditorAction", { action: "done" }]]);
326
+ });
327
+ it("presses the Enter key for a native field that listens for the key itself", async () => {
328
+ const { run, driver } = await setup();
329
+ await run("mobile.submit", { action: "enter" });
330
+ expect(executes(driver)).toEqual([["mobile: pressKey", { keycode: 66 }]]);
331
+ });
332
+ it("refuses an action it does not know", async () => {
333
+ const { run, driver } = await setup();
334
+ await expect(run("mobile.submit", { action: "bogus" })).rejects.toThrow('"action" must be one of search, go, send, done, next, enter for op "mobile.submit"');
335
+ expect(executes(driver)).toEqual([]);
336
+ });
337
+ });
338
+ //# sourceMappingURL=mobile-steps.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mobile-steps.spec.js","sourceRoot":"","sources":["../../../../src/testing/steps/mobile/mobile-steps.spec.ts"],"names":[],"mappings":";;AAAA,mEAAuF;AACvF,yEAAqE;AAGrE,4DAAwD;AAExD,mCAA8C;AAE9C,MAAM,OAAO,GAAG;IACd,eAAe;IACf,cAAc;IACd,kBAAk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C;IAEH,EAAE,CAAC,yCAAyC,EAAE,KAAK,IAAI,EAAE;QACvD,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,KAAK,EAAE,CAAC;QACtC,MAAM,GAAG,CAAC,eAAe,CAAC,CAAC;QAC3B,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,6BAA6B,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC;IAC1F,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0EAA0E,EAAE,KAAK,IAAI,EAAE;QACxF,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,KAAK,EAAE,CAAC;QACtC,MAAM,GAAG,CAAC,eAAe,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;QAChD,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,kBAAkB,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oCAAoC,EAAE,KAAK,IAAI,EAAE;QAClD,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,KAAK,EAAE,CAAC;QACtC,MAAM,MAAM,CAAC,GAAG,CAAC,eAAe,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CACrE,oFAAoF,CACrF,CAAC;QACF,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { FakeClock, FakeDriver, FakeElement } from \"../../adapters/mobile/fake-driver\";\nimport { MobileAdapter } from \"../../adapters/mobile/mobile-adapter\";\nimport type { TestContext } from \"../../contracts/runtime-context.types\";\nimport type { OpStep } from \"../../contracts/testing-metadata.types\";\nimport { StepRegistry } from \"../../core/step-registry\";\nimport type { MobileClock } from \"../../adapters/mobile/mobile.types\";\nimport { registerMobileSteps } from \"./index\";\n\nconst ALL_OPS = [\n \"mobile.launch\",\n \"mobile.reset\",\n \"mobile.terminate\",\n \"mobile.tap\",\n \"mobile.type\",\n \"mobile.clear\",\n \"mobile.swipe\",\n \"mobile.scrollTo\",\n \"mobile.back\",\n \"mobile.hideKeyboard\",\n \"mobile.submit\",\n \"mobile.expectVisible\",\n \"mobile.expectHidden\",\n \"mobile.expectText\",\n \"mobile.getText\",\n];\n\nconst save = { by: \"accessibilityId\", value: \"Save\" };\n\nasync function setup(started = true, clock: MobileClock = new FakeClock(), defaultTimeoutMs?: number) {\n const driver = new FakeDriver();\n const mobile = new MobileAdapter({\n appiumUrl: \"http://localhost:4723\",\n udid: \"emulator-5554\",\n appSource: \"installed\",\n appPackage: \"com.acme.app\",\n appActivity: \".MainActivity\",\n recordVideo: false,\n driverFactory: async () => driver,\n clock,\n defaultTimeoutMs,\n });\n if (started) await mobile.start();\n const registry = new StepRegistry();\n registerMobileSteps(registry);\n const ctx = { scenarioId: \"s1\", scenarioType: \"mobile\", params: {}, mobile } as unknown as TestContext;\n const run = (op: string, withArgs?: Record<string, unknown>, extra: Partial<OpStep> = {}) =>\n registry.get(op)(ctx, { op, with: withArgs, ...extra });\n return { driver, mobile, registry, ctx, run };\n}\n\nconst executes = (driver: FakeDriver) => driver.callsTo(\"execute\").map((call) => call.args);\n\ndescribe(\"mobile steps\", () => {\n it(\"registers every op\", async () => {\n const { registry } = await setup();\n for (const op of ALL_OPS) expect(registry.has(op)).toBe(true);\n });\n\n it(\"every op needs a started mobile session\", async () => {\n const { run } = await setup(false);\n for (const op of ALL_OPS) {\n await expect(run(op, { locator: save, text: \"x\", equals: \"x\", direction: \"up\" })).rejects.toThrow(\n `Missing mobile session on context for op \"${op}\"`,\n );\n }\n });\n\n describe(\"app steps\", () => {\n it(\"launch restarts the app without clearing data\", async () => {\n const { run, driver } = await setup();\n await run(\"mobile.launch\");\n expect(executes(driver).map((args) => args[0])).toEqual([\n \"mobile: terminateApp\",\n \"mobile: activateApp\",\n \"mobile: queryAppState\",\n ]);\n });\n\n it(\"launch with clearData wipes the app's data\", async () => {\n const { run, driver } = await setup();\n await run(\"mobile.launch\", { clearData: true });\n expect(executes(driver).map((args) => args[0])).toContain(\"mobile: clearApp\");\n });\n\n it(\"launch rejects a clearData that is not a boolean\", async () => {\n const { run } = await setup();\n await expect(run(\"mobile.launch\", { clearData: \"yes\" })).rejects.toThrow(\n '\"clearData\" must be true or false for op \"mobile.launch\"',\n );\n });\n\n it(\"reset always clears data\", async () => {\n const { run, driver } = await setup();\n await run(\"mobile.reset\");\n expect(executes(driver).map((args) => args[0])).toContain(\"mobile: clearApp\");\n });\n\n it(\"terminate stops the app\", async () => {\n const { run, driver } = await setup();\n await run(\"mobile.terminate\");\n expect(executes(driver)).toEqual([[\"mobile: terminateApp\", { appId: \"com.acme.app\" }]]);\n });\n });\n\n describe(\"tap, type and clear\", () => {\n it(\"tap waits for the element and clicks it\", async () => {\n const { run, driver } = await setup();\n const [button] = driver.add(\"~Save\", new FakeElement());\n await run(\"mobile.tap\", { locator: save });\n expect(button.displayChecks).toBe(1);\n expect(button.calls).toContain(\"click\");\n });\n\n it(\"tap needs a locator\", async () => {\n const { run } = await setup();\n await expect(run(\"mobile.tap\", {})).rejects.toThrow('Missing \"locator\" in step.with for op \"mobile.tap\"');\n });\n\n it(\"tap fails on an ambiguous locator\", async () => {\n const { run, driver } = await setup();\n driver.add(\"~Save\", new FakeElement(), new FakeElement());\n await expect(run(\"mobile.tap\", { locator: save })).rejects.toThrow(\"matched 2 elements\");\n });\n\n it(\"tap taps the match at index\", async () => {\n const { run, driver } = await setup();\n const [, second] = driver.add(\"~Save\", new FakeElement(), new FakeElement());\n await run(\"mobile.tap\", { locator: { ...save, index: 1 } });\n expect(second.calls).toContain(\"click\");\n });\n\n it(\"uses the step's timeout, from with.timeoutMs or step.timeoutMs\", async () => {\n const { run } = await setup();\n await expect(run(\"mobile.tap\", { locator: save, timeoutMs: 3000 })).rejects.toThrow(\"after 3000 ms\");\n await expect(run(\"mobile.tap\", { locator: save }, { timeoutMs: 4000 })).rejects.toThrow(\"after 4000 ms\");\n });\n\n it(\"type replaces the text by default\", async () => {\n const { run, driver } = await setup();\n const [field] = driver.add(\"~Name\", new FakeElement({ text: \"old\" }));\n await run(\"mobile.type\", { locator: { by: \"accessibilityId\", value: \"Name\" }, text: \"bob\" });\n expect(field.calls).toContain(\"setValue:bob\");\n expect(field.text).toBe(\"bob\");\n });\n\n it(\"type appends with clear: false, and accepts a number\", async () => {\n const { run, driver } = await setup();\n const [field] = driver.add(\"~Pin\", new FakeElement({ text: \"12\" }));\n await run(\"mobile.type\", { locator: { by: \"accessibilityId\", value: \"Pin\" }, text: 34, clear: false });\n expect(field.text).toBe(\"1234\");\n });\n\n it(\"type needs text\", async () => {\n const { run } = await setup();\n await expect(run(\"mobile.type\", { locator: save })).rejects.toThrow('Missing \"text\" in step.with for op \"mobile.type\"');\n });\n\n it(\"type rejects a clear that is not a boolean\", async () => {\n const { run } = await setup();\n await expect(run(\"mobile.type\", { locator: save, text: \"x\", clear: \"no\" })).rejects.toThrow(\n '\"clear\" must be true or false for op \"mobile.type\"',\n );\n });\n\n it(\"clear empties the field\", async () => {\n const { run, driver } = await setup();\n const [field] = driver.add(\"~Name\", new FakeElement({ text: \"bob\" }));\n await run(\"mobile.clear\", { locator: { by: \"accessibilityId\", value: \"Name\" } });\n expect(field.text).toBe(\"\");\n });\n });\n\n describe(\"back and hideKeyboard\", () => {\n it(\"back presses back\", async () => {\n const { run, driver } = await setup();\n await run(\"mobile.back\");\n expect(driver.callsTo(\"back\")).toHaveLength(1);\n });\n\n it(\"hideKeyboard hides it only when it is shown\", async () => {\n const { run, driver } = await setup();\n await run(\"mobile.hideKeyboard\");\n expect(driver.callsTo(\"hideKeyboard\")).toHaveLength(0);\n driver.keyboardShown = true;\n await run(\"mobile.hideKeyboard\");\n expect(driver.callsTo(\"hideKeyboard\")).toHaveLength(1);\n });\n });\n\n describe(\"swipe\", () => {\n it(\"swipes across the screen, clear of the system bars, when there is no locator\", async () => {\n const { run, driver } = await setup();\n await run(\"mobile.swipe\", { direction: \"up\" });\n expect(executes(driver)[0]).toEqual([\n \"mobile: swipeGesture\",\n { left: 108, top: 240, width: 864, height: 1920, direction: \"up\", percent: 0.75 },\n ]);\n });\n\n it(\"swipes inside an element when it has a locator, with a custom percent\", async () => {\n const { run, driver } = await setup();\n driver.add(\"~List\", new FakeElement({ location: { x: 10, y: 20 }, size: { width: 500, height: 800 } }));\n await run(\"mobile.swipe\", { direction: \"left\", percent: 0.5, locator: { by: \"accessibilityId\", value: \"List\" } });\n expect(executes(driver)[0]).toEqual([\n \"mobile: swipeGesture\",\n { left: 10, top: 20, width: 500, height: 800, direction: \"left\", percent: 0.5 },\n ]);\n });\n\n it.each([[undefined], [\"sideways\"], [3]])(\"rejects direction %p\", async (direction) => {\n const { run } = await setup();\n await expect(run(\"mobile.swipe\", { direction })).rejects.toThrow(\n '\"direction\" must be one of up, down, left, right for op \"mobile.swipe\"',\n );\n });\n\n it.each([[0], [1.5], [\"half\"]])(\"rejects percent %p\", async (percent) => {\n const { run } = await setup();\n await expect(run(\"mobile.swipe\", { direction: \"up\", percent })).rejects.toThrow(\n '\"percent\" must be a number from 0.1 to 1 for op \"mobile.swipe\"',\n );\n });\n });\n\n describe(\"scrollTo\", () => {\n const target = { by: \"accessibilityId\", value: \"Target\" };\n\n it(\"does not swipe when the element is already on screen\", async () => {\n const { run, driver } = await setup();\n driver.add(\"~Target\", new FakeElement());\n await run(\"mobile.scrollTo\", { locator: target });\n expect(executes(driver)).toHaveLength(0);\n });\n\n it(\"swipes up to scroll down until the element appears\", async () => {\n const { run, driver } = await setup();\n const original = driver.execute.bind(driver);\n let swipes = 0;\n driver.execute = async (script: string, ...args: unknown[]) => {\n if (script === \"mobile: swipeGesture\") {\n swipes += 1;\n if (swipes === 2) driver.add(\"~Target\", new FakeElement());\n }\n return original(script, ...args);\n };\n await run(\"mobile.scrollTo\", { locator: target });\n expect(swipes).toBe(2);\n const swipeArgs = driver.callsTo(\"execute\").filter((c) => c.args[0] === \"mobile: swipeGesture\");\n expect((swipeArgs[0].args[1] as any).direction).toBe(\"up\");\n });\n\n it(\"scrolls up by swiping down\", async () => {\n const { run, driver } = await setup();\n await expect(run(\"mobile.scrollTo\", { locator: target, direction: \"up\", maxSwipes: 1 })).rejects.toThrow();\n const swipeArgs = driver.callsTo(\"execute\").filter((c) => c.args[0] === \"mobile: swipeGesture\");\n expect((swipeArgs[0].args[1] as any).direction).toBe(\"down\");\n });\n\n it(\"gives up after maxSwipes, naming the locator\", async () => {\n const { run, driver } = await setup();\n await expect(run(\"mobile.scrollTo\", { locator: target, maxSwipes: 3 })).rejects.toThrow(\n '{ by: \"accessibilityId\", value: \"Target\" } not found after 3 swipes',\n );\n expect(executes(driver).filter((args) => args[0] === \"mobile: swipeGesture\")).toHaveLength(3);\n });\n\n it(\"does not keep scrolling when the locator is ambiguous\", async () => {\n const { run, driver } = await setup();\n driver.add(\"~Target\", new FakeElement(), new FakeElement());\n await expect(run(\"mobile.scrollTo\", { locator: target })).rejects.toThrow(\"matched 2 elements\");\n expect(executes(driver)).toHaveLength(0);\n });\n\n it(\"validates its options\", async () => {\n const { run } = await setup();\n await expect(run(\"mobile.scrollTo\", { locator: target, direction: \"left\" })).rejects.toThrow(\n '\"direction\" must be down or up for op \"mobile.scrollTo\"',\n );\n await expect(run(\"mobile.scrollTo\", { locator: target, maxSwipes: 0 })).rejects.toThrow(\n '\"maxSwipes\" must be a whole number >= 1 for op \"mobile.scrollTo\"',\n );\n await expect(run(\"mobile.scrollTo\", {})).rejects.toThrow('Missing \"locator\" in step.with for op \"mobile.scrollTo\"');\n });\n });\n\n describe(\"assertions\", () => {\n const title = { by: \"accessibilityId\", value: \"Title\" };\n\n it(\"expectVisible passes for a displayed element and fails for a missing one\", async () => {\n const { run, driver } = await setup();\n driver.add(\"~Title\", new FakeElement());\n await run(\"mobile.expectVisible\", { locator: title });\n await expect(run(\"mobile.expectVisible\", { locator: { by: \"accessibilityId\", value: \"Nope\" }, timeoutMs: 2000 })).rejects.toThrow(\n 'No element matches { by: \"accessibilityId\", value: \"Nope\" } after 2000 ms',\n );\n });\n\n it(\"expectHidden passes when absent, and fails while visible\", async () => {\n const { run, driver } = await setup();\n driver.add(\"~Title\", new FakeElement());\n await run(\"mobile.expectHidden\", { locator: { by: \"accessibilityId\", value: \"Gone\" } });\n await expect(run(\"mobile.expectHidden\", { locator: title, timeoutMs: 1000 })).rejects.toThrow(\"is still visible after 1000 ms\");\n });\n\n it(\"getText returns the text\", async () => {\n const { run, driver } = await setup();\n driver.add(\"~Title\", new FakeElement({ text: \"Hello\" }));\n expect(await run(\"mobile.getText\", { locator: title })).toBe(\"Hello\");\n });\n\n describe(\"expectText\", () => {\n it(\"equals\", async () => {\n const { run, driver } = await setup();\n driver.add(\"~Title\", new FakeElement({ text: \"Hello\" }));\n expect(await run(\"mobile.expectText\", { locator: title, equals: \"Hello\" })).toBe(\"Hello\");\n await expect(run(\"mobile.expectText\", { locator: title, equals: \"Bye\" })).rejects.toThrow(\n 'Expected text of { by: \"accessibilityId\", value: \"Title\" } to equal \"Bye\", got \"Hello\"',\n );\n });\n\n it(\"contains\", async () => {\n const { run, driver } = await setup();\n driver.add(\"~Title\", new FakeElement({ text: \"Hello world\" }));\n await run(\"mobile.expectText\", { locator: title, contains: \"world\" });\n await expect(run(\"mobile.expectText\", { locator: title, contains: \"moon\" })).rejects.toThrow(\n 'to contain \"moon\", got \"Hello world\"',\n );\n });\n\n it(\"matches\", async () => {\n const { run, driver } = await setup();\n driver.add(\"~Title\", new FakeElement({ text: \"Order 123\" }));\n await run(\"mobile.expectText\", { locator: title, matches: \"^Order \\\\d+$\" });\n await expect(run(\"mobile.expectText\", { locator: title, matches: \"^Cart\" })).rejects.toThrow('to match \"^Cart\"');\n });\n\n it(\"needs exactly one comparison\", async () => {\n const { run } = await setup();\n const message = 'mobile.expectText needs exactly one of \"equals\", \"contains\", \"matches\"';\n await expect(run(\"mobile.expectText\", { locator: title })).rejects.toThrow(message);\n await expect(run(\"mobile.expectText\", { locator: title, equals: \"a\", contains: \"b\" })).rejects.toThrow(message);\n });\n\n it(\"rejects an invalid regular expression before touching the device\", async () => {\n const { run, driver } = await setup();\n await expect(run(\"mobile.expectText\", { locator: title, matches: \"(\" })).rejects.toThrow(\n '\"matches\" is not a valid regular expression',\n );\n expect(driver.callsTo(\"$$\")).toHaveLength(0);\n });\n });\n });\n});\n\ndescribe(\"optional steps on a slow device\", () => {\n // Real time: the point is a device that answers later than the step keeps looking for.\n const realClock: MobileClock = { now: () => Date.now(), sleep: (ms) => new Promise<void>((r) => setTimeout(r, ms)) };\n const maybe = { by: \"accessibilityId\", value: \"Maybe\" };\n\n it(\"skips an element that is not there even when the device is slower than the optional wait to say so\", async () => {\n const { run, driver } = await setup(true, realClock);\n driver.lookupDelayMs = 400;\n await expect(run(\"mobile.tap\", { locator: maybe, optional: true, timeoutMs: 100 })).resolves.toEqual({ skipped: \"optional-not-found\" });\n });\n\n it(\"taps an element a slow device reports late\", async () => {\n const { run, driver } = await setup(true, realClock);\n const [element] = driver.add(\"~Maybe\", new FakeElement());\n driver.lookupDelayMs = 400;\n await run(\"mobile.tap\", { locator: maybe, optional: true, timeoutMs: 100 });\n expect(element.calls).toContain(\"click\");\n });\n\n it(\"still fails when the device does not answer at all\", async () => {\n const { run, driver } = await setup(true, realClock, 300);\n driver.lookupDelayMs = 1500;\n await expect(run(\"mobile.tap\", { locator: maybe, optional: true, timeoutMs: 100 })).rejects.toThrow(\"The device did not answer\");\n });\n\n it(\"scrollTo takes a slow device's answer that the element is already on screen\", async () => {\n const { run, driver } = await setup(true, realClock);\n driver.add(\"~Target\", new FakeElement());\n driver.lookupDelayMs = 1500; // slower than scrollTo's 1 s look per attempt\n await run(\"mobile.scrollTo\", { locator: { by: \"accessibilityId\", value: \"Target\" } });\n expect(executes(driver)).toHaveLength(0);\n });\n});\n\ndescribe(\"mobile.submit on Android\", () => {\n it(\"performs the editor action the field asked for\", async () => {\n const { run, driver } = await setup();\n await run(\"mobile.submit\", { action: \"search\" });\n expect(executes(driver)).toEqual([[\"mobile: performEditorAction\", { action: \"search\" }]]);\n });\n\n it(\"performs 'done' when no action is named\", async () => {\n const { run, driver } = await setup();\n await run(\"mobile.submit\");\n expect(executes(driver)).toEqual([[\"mobile: performEditorAction\", { action: \"done\" }]]);\n });\n\n it(\"presses the Enter key for a native field that listens for the key itself\", async () => {\n const { run, driver } = await setup();\n await run(\"mobile.submit\", { action: \"enter\" });\n expect(executes(driver)).toEqual([[\"mobile: pressKey\", { keycode: 66 }]]);\n });\n\n it(\"refuses an action it does not know\", async () => {\n const { run, driver } = await setup();\n await expect(run(\"mobile.submit\", { action: \"bogus\" })).rejects.toThrow(\n '\"action\" must be one of search, go, send, done, next, enter for op \"mobile.submit\"',\n );\n expect(executes(driver)).toEqual([]);\n });\n});\n"]}
@@ -0,0 +1,13 @@
1
+ import type { MobileAdapter } from "../../adapters/mobile/mobile-adapter";
2
+ import type { TestContext } from "../../contracts/runtime-context.types";
3
+ import type { OpStep } from "../../contracts/testing-metadata.types";
4
+ export declare function requireMobile(ctx: TestContext, op: string): MobileAdapter;
5
+ export declare function requireLocator(step: OpStep, op: string): unknown;
6
+ export declare function stepTimeout(step: OpStep): number | undefined;
7
+ export declare function optionalBoolean(step: OpStep, key: string, op: string): boolean | undefined;
8
+ export declare const OPTIONAL_TIMEOUT_MS = 3000;
9
+ export declare function isNotFound(error: unknown): boolean;
10
+ export declare const OPTIONAL_SKIPPED: {
11
+ readonly skipped: "optional-not-found";
12
+ };
13
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../../src/testing/steps/mobile/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AAC1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wCAAwC,CAAC;AAErE,wBAAgB,aAAa,CAAC,GAAG,EAAE,WAAW,EAAE,EAAE,EAAE,MAAM,GAAG,aAAa,CAKzE;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAMhE;AAGD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAG5D;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAO1F;AAMD,eAAO,MAAM,mBAAmB,OAAO,CAAC;AAGxC,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAGlD;AAGD,eAAO,MAAM,gBAAgB;;CAA6C,CAAC"}
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OPTIONAL_SKIPPED = exports.OPTIONAL_TIMEOUT_MS = void 0;
4
+ exports.requireMobile = requireMobile;
5
+ exports.requireLocator = requireLocator;
6
+ exports.stepTimeout = stepTimeout;
7
+ exports.optionalBoolean = optionalBoolean;
8
+ exports.isNotFound = isNotFound;
9
+ function requireMobile(ctx, op) {
10
+ if (!ctx.mobile || !ctx.mobile.isStarted()) {
11
+ throw new Error(`Missing mobile session on context for op "${op}"`);
12
+ }
13
+ return ctx.mobile;
14
+ }
15
+ function requireLocator(step, op) {
16
+ const locator = step.with?.locator;
17
+ if (locator === undefined || locator === null) {
18
+ throw new Error(`Missing "locator" in step.with for op "${op}"`);
19
+ }
20
+ return locator;
21
+ }
22
+ function stepTimeout(step) {
23
+ const value = step.with?.timeoutMs ?? step.timeoutMs;
24
+ return typeof value === "number" ? value : undefined;
25
+ }
26
+ function optionalBoolean(step, key, op) {
27
+ const value = step.with?.[key];
28
+ if (value === undefined)
29
+ return undefined;
30
+ if (typeof value !== "boolean") {
31
+ throw new Error(`"${key}" must be true or false for op "${op}"`);
32
+ }
33
+ return value;
34
+ }
35
+ exports.OPTIONAL_TIMEOUT_MS = 3000;
36
+ function isNotFound(error) {
37
+ const message = String(error?.message ?? error);
38
+ return message.includes("No element matches") || message.includes("is not displayed after");
39
+ }
40
+ exports.OPTIONAL_SKIPPED = { skipped: "optional-not-found" };
41
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../../src/testing/steps/mobile/shared.ts"],"names":[],"mappings":";;;AAIA,sCAKC;AAED,wCAMC;AAGD,kCAGC;AAED,0CAOC;AASD,gCAGC;AAxCD,SAAgB,aAAa,CAAC,GAAgB,EAAE,EAAU;IACxD,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,CAAC;QAC3C,MAAM,IAAI,KAAK,CAAC,6CAA6C,EAAE,GAAG,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,GAAG,CAAC,MAAM,CAAC;AACpB,CAAC;AAED,SAAgB,cAAc,CAAC,IAAY,EAAE,EAAU;IACrD,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC;IACnC,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,0CAA0C,EAAE,GAAG,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC;AAGD,SAAgB,WAAW,CAAC,IAAY;IACtC,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,SAAS,IAAI,IAAI,CAAC,SAAS,CAAC;IACrD,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACvD,CAAC;AAED,SAAgB,eAAe,CAAC,IAAY,EAAE,GAAW,EAAE,EAAU;IACnE,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC;IAC/B,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAC1C,IAAI,OAAO,KAAK,KAAK,SAAS,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,IAAI,GAAG,mCAAmC,EAAE,GAAG,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAMY,QAAA,mBAAmB,GAAG,IAAI,CAAC;AAGxC,SAAgB,UAAU,CAAC,KAAc;IACvC,MAAM,OAAO,GAAG,MAAM,CAAE,KAAe,EAAE,OAAO,IAAI,KAAK,CAAC,CAAC;IAC3D,OAAO,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,wBAAwB,CAAC,CAAC;AAC9F,CAAC;AAGY,QAAA,gBAAgB,GAAG,EAAE,OAAO,EAAE,oBAAoB,EAAW,CAAC","sourcesContent":["import type { MobileAdapter } from \"../../adapters/mobile/mobile-adapter\";\nimport type { TestContext } from \"../../contracts/runtime-context.types\";\nimport type { OpStep } from \"../../contracts/testing-metadata.types\";\n\nexport function requireMobile(ctx: TestContext, op: string): MobileAdapter {\n if (!ctx.mobile || !ctx.mobile.isStarted()) {\n throw new Error(`Missing mobile session on context for op \"${op}\"`);\n }\n return ctx.mobile;\n}\n\nexport function requireLocator(step: OpStep, op: string): unknown {\n const locator = step.with?.locator;\n if (locator === undefined || locator === null) {\n throw new Error(`Missing \"locator\" in step.with for op \"${op}\"`);\n }\n return locator;\n}\n\n/** A step's own timeout: `with.timeoutMs` like the UI steps, else the step-level `timeoutMs`. */\nexport function stepTimeout(step: OpStep): number | undefined {\n const value = step.with?.timeoutMs ?? step.timeoutMs;\n return typeof value === \"number\" ? value : undefined;\n}\n\nexport function optionalBoolean(step: OpStep, key: string, op: string): boolean | undefined {\n const value = step.with?.[key];\n if (value === undefined) return undefined;\n if (typeof value !== \"boolean\") {\n throw new Error(`\"${key}\" must be true or false for op \"${op}\"`);\n }\n return value;\n}\n\n/**\n * How long an optional step keeps re-checking after its element is not there, so a screen that is still drawing can settle.\n * Each check may take as long as a step's timeout to answer.\n */\nexport const OPTIONAL_TIMEOUT_MS = 3000;\n\n/** The step's element is missing or never shown, as opposed to the device not answering or a bad locator. */\nexport function isNotFound(error: unknown): boolean {\n const message = String((error as Error)?.message ?? error);\n return message.includes(\"No element matches\") || message.includes(\"is not displayed after\");\n}\n\n/** What an optional step returns when its element was not there. */\nexport const OPTIONAL_SKIPPED = { skipped: \"optional-not-found\" } as const;\n"]}
@@ -0,0 +1,14 @@
1
+ export interface Area {
2
+ left: number;
3
+ top: number;
4
+ width: number;
5
+ height: number;
6
+ }
7
+ export type SwipeDirection = "up" | "down" | "left" | "right";
8
+ export declare function swipeLine(area: Area, direction: SwipeDirection, percent: number): {
9
+ fromX: number;
10
+ fromY: number;
11
+ toX: number;
12
+ toY: number;
13
+ };
14
+ //# sourceMappingURL=swipe-line.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swipe-line.d.ts","sourceRoot":"","sources":["../../../../src/testing/steps/mobile/swipe-line.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,cAAc,GAAG,IAAI,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAO9D,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM;;;;;EAe/E"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.swipeLine = swipeLine;
4
+ function swipeLine(area, direction, percent) {
5
+ const cx = area.left + area.width / 2;
6
+ const cy = area.top + area.height / 2;
7
+ const half = ((direction === "up" || direction === "down" ? area.height : area.width) * percent) / 2;
8
+ const round = (n) => Math.round(n);
9
+ switch (direction) {
10
+ case "up":
11
+ return { fromX: round(cx), fromY: round(cy + half), toX: round(cx), toY: round(cy - half) };
12
+ case "down":
13
+ return { fromX: round(cx), fromY: round(cy - half), toX: round(cx), toY: round(cy + half) };
14
+ case "left":
15
+ return { fromX: round(cx + half), fromY: round(cy), toX: round(cx - half), toY: round(cy) };
16
+ case "right":
17
+ return { fromX: round(cx - half), fromY: round(cy), toX: round(cx + half), toY: round(cy) };
18
+ }
19
+ }
20
+ //# sourceMappingURL=swipe-line.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swipe-line.js","sourceRoot":"","sources":["../../../../src/testing/steps/mobile/swipe-line.ts"],"names":[],"mappings":";;AAcA,8BAeC;AAfD,SAAgB,SAAS,CAAC,IAAU,EAAE,SAAyB,EAAE,OAAe;IAC9E,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC;IACtC,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IACtC,MAAM,IAAI,GAAG,CAAC,CAAC,SAAS,KAAK,IAAI,IAAI,SAAS,KAAK,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IACrG,MAAM,KAAK,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IAC3C,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,IAAI;YACP,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAC9F,KAAK,MAAM;YACT,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAC9F,KAAK,MAAM;YACT,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;QAC9F,KAAK,OAAO;YACV,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,EAAE,CAAC;IAChG,CAAC;AACH,CAAC","sourcesContent":["export interface Area {\n left: number;\n top: number;\n width: number;\n height: number;\n}\n\nexport type SwipeDirection = \"up\" | \"down\" | \"left\" | \"right\";\n\n/**\n * The finger's path for a swipe inside `area`: a line through its centre, `percent` of its height (up and down) or width\n * (left and right) long. The direction is where the finger moves, so \"up\" starts at the bottom, as on Android's\n * `mobile: swipeGesture`. iOS has no swipe-in-an-area command, so the path is dragged instead.\n */\nexport function swipeLine(area: Area, direction: SwipeDirection, percent: number) {\n const cx = area.left + area.width / 2;\n const cy = area.top + area.height / 2;\n const half = ((direction === \"up\" || direction === \"down\" ? area.height : area.width) * percent) / 2;\n const round = (n: number) => Math.round(n);\n switch (direction) {\n case \"up\":\n return { fromX: round(cx), fromY: round(cy + half), toX: round(cx), toY: round(cy - half) };\n case \"down\":\n return { fromX: round(cx), fromY: round(cy - half), toX: round(cx), toY: round(cy + half) };\n case \"left\":\n return { fromX: round(cx + half), fromY: round(cy), toX: round(cx - half), toY: round(cy) };\n case \"right\":\n return { fromX: round(cx - half), fromY: round(cy), toX: round(cx + half), toY: round(cy) };\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=swipe-line.spec.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swipe-line.spec.d.ts","sourceRoot":"","sources":["../../../../src/testing/steps/mobile/swipe-line.spec.ts"],"names":[],"mappings":""}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const swipe_line_1 = require("./swipe-line");
4
+ const area = { left: 100, top: 200, width: 400, height: 800 };
5
+ describe("swipeLine", () => {
6
+ it("up: the finger moves from the bottom to the top", () => {
7
+ expect((0, swipe_line_1.swipeLine)(area, "up", 0.5)).toEqual({ fromX: 300, fromY: 800, toX: 300, toY: 400 });
8
+ });
9
+ it("down: the finger moves from the top to the bottom", () => {
10
+ expect((0, swipe_line_1.swipeLine)(area, "down", 0.5)).toEqual({ fromX: 300, fromY: 400, toX: 300, toY: 800 });
11
+ });
12
+ it("left and right use the width", () => {
13
+ expect((0, swipe_line_1.swipeLine)(area, "left", 0.5)).toEqual({ fromX: 400, fromY: 600, toX: 200, toY: 600 });
14
+ expect((0, swipe_line_1.swipeLine)(area, "right", 0.5)).toEqual({ fromX: 200, fromY: 600, toX: 400, toY: 600 });
15
+ });
16
+ it("percent 1 covers the whole area", () => {
17
+ expect((0, swipe_line_1.swipeLine)(area, "up", 1)).toEqual({ fromX: 300, fromY: 1000, toX: 300, toY: 200 });
18
+ });
19
+ it("rounds to whole points", () => {
20
+ const line = (0, swipe_line_1.swipeLine)({ left: 0, top: 0, width: 101, height: 301 }, "up", 0.75);
21
+ for (const value of Object.values(line))
22
+ expect(Number.isInteger(value)).toBe(true);
23
+ });
24
+ });
25
+ //# sourceMappingURL=swipe-line.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swipe-line.spec.js","sourceRoot":"","sources":["../../../../src/testing/steps/mobile/swipe-line.spec.ts"],"names":[],"mappings":";;AAAA,6CAAyC;AAEzC,MAAM,IAAI,GAAG,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;AAE9D,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;QACzD,MAAM,CAAC,IAAA,sBAAS,EAAC,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IAC7F,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;QAC3D,MAAM,CAAC,IAAA,sBAAS,EAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;IAC/F,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8BAA8B,EAAE,GAAG,EAAE;QACtC,MAAM,CAAC,IAAA,sBAAS,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Line\", () => {\n it(\"up: the finger moves from the bottom to the top\", () => {\n expect(swipeLine(area, \"up\", 0.5)).toEqual({ fromX: 300, fromY: 800, toX: 300, toY: 400 });\n });\n\n it(\"down: the finger moves from the top to the bottom\", () => {\n expect(swipeLine(area, \"down\", 0.5)).toEqual({ fromX: 300, fromY: 400, toX: 300, toY: 800 });\n });\n\n it(\"left and right use the width\", () => {\n expect(swipeLine(area, \"left\", 0.5)).toEqual({ fromX: 400, fromY: 600, toX: 200, toY: 600 });\n expect(swipeLine(area, \"right\", 0.5)).toEqual({ fromX: 200, fromY: 600, toX: 400, toY: 600 });\n });\n\n it(\"percent 1 covers the whole area\", () => {\n expect(swipeLine(area, \"up\", 1)).toEqual({ fromX: 300, fromY: 1000, toX: 300, toY: 200 });\n });\n\n it(\"rounds to whole points\", () => {\n const line = swipeLine({ left: 0, top: 0, width: 101, height: 301 }, \"up\", 0.75);\n for (const value of Object.values(line)) expect(Number.isInteger(value)).toBe(true);\n });\n});\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"actions.step.d.ts","sourceRoot":"","sources":["../../../../src/testing/steps/ui/actions.step.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAaxD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI,CAwEhE"}
1
+ {"version":3,"file":"actions.step.d.ts","sourceRoot":"","sources":["../../../../src/testing/steps/ui/actions.step.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAcxD,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,YAAY,GAAG,IAAI,CA0EhE"}