qa360 2.3.0 → 2.3.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 (507) hide show
  1. package/README.md +155 -262
  2. package/{cli/dist → dist}/commands/ai.js +1 -1
  3. package/{cli/dist → dist}/commands/coverage.js +1 -1
  4. package/{cli/dist → dist}/commands/crawl.js +2 -2
  5. package/{cli/dist → dist}/commands/doctor.js +2 -2
  6. package/{cli/dist → dist}/commands/explain.js +2 -2
  7. package/{cli/dist → dist}/commands/flakiness.js +1 -1
  8. package/{cli/dist → dist}/commands/generate.js +1 -1
  9. package/{cli/dist → dist}/commands/history.js +1 -1
  10. package/{cli/dist → dist}/commands/monitor.js +3 -3
  11. package/{cli/dist → dist}/commands/ollama.js +1 -1
  12. package/{cli/dist → dist}/commands/pack.js +2 -2
  13. package/{cli/dist → dist}/commands/regression.js +1 -1
  14. package/{cli/dist → dist}/commands/repair.js +1 -1
  15. package/{cli/dist → dist}/commands/retry.js +1 -1
  16. package/{cli/dist → dist}/commands/run.d.ts +1 -1
  17. package/{cli/dist → dist}/commands/run.js +1 -1
  18. package/{cli/dist → dist}/commands/secrets.js +1 -1
  19. package/{cli/dist → dist}/commands/serve.js +1 -1
  20. package/{cli/dist → dist}/commands/slo.js +1 -1
  21. package/{cli/dist → dist}/commands/verify.js +1 -1
  22. package/{cli/dist → dist}/core/adapters/playwright-native-api.d.ts +2 -0
  23. package/{cli/dist → dist}/core/adapters/playwright-native-api.js +20 -1
  24. package/{cli/dist → dist}/core/adapters/playwright-ui.d.ts +21 -0
  25. package/dist/core/adapters/playwright-ui.js +2050 -0
  26. package/{cli/dist → dist}/core/ai/ollama-provider.js +15 -3
  27. package/{cli/dist → dist}/core/artifacts/ui-artifacts.js +24 -4
  28. package/dist/core/auth/backup-codes-provider.d.ts +91 -0
  29. package/dist/core/auth/backup-codes-provider.js +215 -0
  30. package/{cli/dist → dist}/core/auth/basic-auth-provider.d.ts +6 -0
  31. package/{cli/dist → dist}/core/auth/basic-auth-provider.js +24 -6
  32. package/dist/core/auth/digest-auth-provider.d.ts +116 -0
  33. package/dist/core/auth/digest-auth-provider.js +244 -0
  34. package/dist/core/auth/hcaptcha-handler.d.ts +103 -0
  35. package/dist/core/auth/hcaptcha-handler.js +288 -0
  36. package/{cli/dist → dist}/core/auth/index.d.ts +81 -4
  37. package/{cli/dist → dist}/core/auth/index.js +15 -1
  38. package/dist/core/auth/oauth-handler.d.ts +408 -0
  39. package/dist/core/auth/oauth-handler.js +636 -0
  40. package/{cli/dist → dist}/core/auth/oauth2-provider.d.ts +9 -0
  41. package/dist/core/auth/oauth2-provider.js +227 -0
  42. package/dist/core/auth/otp-provider.d.ts +93 -0
  43. package/dist/core/auth/otp-provider.js +288 -0
  44. package/dist/core/auth/recaptcha-handler.d.ts +119 -0
  45. package/dist/core/auth/recaptcha-handler.js +301 -0
  46. package/dist/core/auth/remember-me-handler.d.ts +142 -0
  47. package/dist/core/auth/remember-me-handler.js +255 -0
  48. package/dist/core/auth/saml-handler.d.ts +173 -0
  49. package/dist/core/auth/saml-handler.js +364 -0
  50. package/dist/core/auth/webauthn-handler.d.ts +182 -0
  51. package/dist/core/auth/webauthn-handler.js +310 -0
  52. package/dist/core/crawler/advanced-interactions.d.ts +342 -0
  53. package/dist/core/crawler/advanced-interactions.js +1069 -0
  54. package/dist/core/crawler/blob-url-download-handler.d.ts +145 -0
  55. package/dist/core/crawler/blob-url-download-handler.js +392 -0
  56. package/dist/core/crawler/consent-handler.d.ts +49 -0
  57. package/dist/core/crawler/consent-handler.js +258 -0
  58. package/dist/core/crawler/cookie-manager.d.ts +166 -0
  59. package/dist/core/crawler/cookie-manager.js +353 -0
  60. package/dist/core/crawler/coop-coep-handler.d.ts +136 -0
  61. package/dist/core/crawler/coop-coep-handler.js +338 -0
  62. package/dist/core/crawler/csp-handler.d.ts +151 -0
  63. package/dist/core/crawler/csp-handler.js +415 -0
  64. package/dist/core/crawler/download-handler.d.ts +155 -0
  65. package/dist/core/crawler/download-handler.js +370 -0
  66. package/dist/core/crawler/email-testing-handler.d.ts +214 -0
  67. package/dist/core/crawler/email-testing-handler.js +398 -0
  68. package/dist/core/crawler/error-tracking-handler.d.ts +177 -0
  69. package/dist/core/crawler/error-tracking-handler.js +378 -0
  70. package/dist/core/crawler/form-handler.d.ts +100 -0
  71. package/dist/core/crawler/form-handler.js +465 -0
  72. package/dist/core/crawler/framework-wait-handler.d.ts +96 -0
  73. package/dist/core/crawler/framework-wait-handler.js +464 -0
  74. package/dist/core/crawler/geolocation-handler.d.ts +112 -0
  75. package/dist/core/crawler/geolocation-handler.js +276 -0
  76. package/dist/core/crawler/index.d.ts +78 -0
  77. package/{cli/dist → dist}/core/crawler/index.js +74 -1
  78. package/dist/core/crawler/intelligent-selector-generator.d.ts +164 -0
  79. package/dist/core/crawler/intelligent-selector-generator.js +612 -0
  80. package/{cli/dist → dist}/core/crawler/journey-generator.js +44 -1
  81. package/{cli/dist → dist}/core/crawler/page-analyzer.d.ts +16 -1
  82. package/{cli/dist → dist}/core/crawler/page-analyzer.js +469 -17
  83. package/dist/core/crawler/permissions-handler.d.ts +112 -0
  84. package/dist/core/crawler/permissions-handler.js +236 -0
  85. package/dist/core/crawler/permissions-policy-handler.d.ts +113 -0
  86. package/dist/core/crawler/permissions-policy-handler.js +402 -0
  87. package/dist/core/crawler/presets.d.ts +100 -0
  88. package/dist/core/crawler/presets.js +887 -0
  89. package/dist/core/crawler/repl-debug-handler.d.ts +105 -0
  90. package/dist/core/crawler/repl-debug-handler.js +552 -0
  91. package/dist/core/crawler/reporting-api-handler.d.ts +212 -0
  92. package/dist/core/crawler/reporting-api-handler.js +344 -0
  93. package/{cli/dist → dist}/core/crawler/selector-generator.d.ts +9 -0
  94. package/{cli/dist → dist}/core/crawler/selector-generator.js +99 -23
  95. package/dist/core/crawler/site-profiler.d.ts +89 -0
  96. package/dist/core/crawler/site-profiler.js +290 -0
  97. package/dist/core/crawler/sourcemaps-handler.d.ts +144 -0
  98. package/dist/core/crawler/sourcemaps-handler.js +420 -0
  99. package/dist/core/crawler/stacked-modals-handler.d.ts +118 -0
  100. package/dist/core/crawler/stacked-modals-handler.js +429 -0
  101. package/dist/core/crawler/trusted-types-handler.d.ts +149 -0
  102. package/dist/core/crawler/trusted-types-handler.js +413 -0
  103. package/{cli/dist → dist}/core/crawler/types.d.ts +68 -2
  104. package/dist/core/crawler/wait-strategies.d.ts +108 -0
  105. package/dist/core/crawler/wait-strategies.js +399 -0
  106. package/dist/core/fixtures/factories.d.ts +180 -0
  107. package/dist/core/fixtures/factories.js +279 -0
  108. package/dist/core/fixtures/index.d.ts +6 -0
  109. package/dist/core/fixtures/index.js +6 -0
  110. package/{cli/dist → dist}/core/generation/crawler-pack-generator.d.ts +13 -3
  111. package/dist/core/generation/crawler-pack-generator.js +232 -0
  112. package/{cli/dist → dist}/core/generation/index.d.ts +2 -0
  113. package/{cli/dist → dist}/core/generation/index.js +2 -0
  114. package/{cli/dist → dist}/core/index.d.ts +2 -0
  115. package/{cli/dist → dist}/core/index.js +4 -0
  116. package/dist/core/network/index.d.ts +7 -0
  117. package/dist/core/network/index.js +7 -0
  118. package/dist/core/network/network-manager.d.ts +237 -0
  119. package/dist/core/network/network-manager.js +343 -0
  120. package/dist/core/network/network-simulator.d.ts +158 -0
  121. package/dist/core/network/network-simulator.js +261 -0
  122. package/{cli/dist → dist}/core/pack/validator.js +2 -2
  123. package/{cli/dist → dist}/core/pack-v2/migrator.d.ts +5 -0
  124. package/{cli/dist → dist}/core/pack-v2/migrator.js +81 -6
  125. package/{cli/dist → dist}/core/pack-v2/validator.js +4 -3
  126. package/{cli/dist → dist}/core/pom/base-page.js +1 -1
  127. package/{cli/dist → dist}/core/pom/loader.js +1 -1
  128. package/dist/core/reporting/index.d.ts +9 -0
  129. package/dist/core/reporting/index.js +10 -0
  130. package/dist/core/reporting/junit-reporter.d.ts +114 -0
  131. package/dist/core/reporting/junit-reporter.js +306 -0
  132. package/{cli/dist → dist}/core/runner/e2e-helpers.d.ts +1 -1
  133. package/{cli/dist → dist}/core/runner/e2e-helpers.js +2 -2
  134. package/{cli/dist → dist}/core/runner/phase3-runner.d.ts +3 -0
  135. package/{cli/dist → dist}/core/runner/phase3-runner.js +45 -14
  136. package/dist/core/sharding/test-sharding.d.ts +137 -0
  137. package/dist/core/sharding/test-sharding.js +233 -0
  138. package/dist/core/storage/cookie-manager.d.ts +160 -0
  139. package/dist/core/storage/cookie-manager.js +268 -0
  140. package/dist/core/storage/index.d.ts +7 -0
  141. package/dist/core/storage/index.js +7 -0
  142. package/dist/core/storage/storage-helpers.d.ts +138 -0
  143. package/dist/core/storage/storage-helpers.js +315 -0
  144. package/dist/core/test-helpers/index.d.ts +6 -0
  145. package/dist/core/test-helpers/index.js +6 -0
  146. package/dist/core/test-helpers/state-reset.d.ts +119 -0
  147. package/dist/core/test-helpers/state-reset.js +234 -0
  148. package/{cli/dist → dist}/core/types/pack-v1.d.ts +15 -2
  149. package/{cli/dist → dist}/core/types/pack-v2.d.ts +1 -1
  150. package/dist/core/upload/chunked-uploader.d.ts +150 -0
  151. package/dist/core/upload/chunked-uploader.js +289 -0
  152. package/dist/core/upload/index.d.ts +11 -0
  153. package/dist/core/upload/index.js +8 -0
  154. package/dist/core/upload/mime-validator.d.ts +119 -0
  155. package/dist/core/upload/mime-validator.js +373 -0
  156. package/dist/core/upload/presigned-uploader.d.ts +118 -0
  157. package/dist/core/upload/presigned-uploader.js +274 -0
  158. package/dist/core/utils/device-emulation.d.ts +194 -0
  159. package/dist/core/utils/device-emulation.js +380 -0
  160. package/dist/core/utils/index.d.ts +8 -0
  161. package/dist/core/utils/index.js +8 -0
  162. package/dist/core/utils/retry.d.ts +145 -0
  163. package/dist/core/utils/retry.js +242 -0
  164. package/dist/core/utils/smart-wait.d.ts +133 -0
  165. package/dist/core/utils/smart-wait.js +417 -0
  166. package/dist/core/visual/index.d.ts +7 -0
  167. package/dist/core/visual/index.js +7 -0
  168. package/dist/core/visual/pixel-diff.d.ts +87 -0
  169. package/dist/core/visual/pixel-diff.js +213 -0
  170. package/dist/core/visual/screenshot-helper.d.ts +130 -0
  171. package/dist/core/visual/screenshot-helper.js +223 -0
  172. package/{cli/dist → dist}/utils/config.d.ts +1 -1
  173. package/examples/README.md +160 -0
  174. package/examples/accessibility.yml +48 -0
  175. package/examples/api-basic.yml +27 -0
  176. package/examples/complete.yml +146 -0
  177. package/examples/crawler.yml +38 -0
  178. package/examples/fullstack.yml +78 -0
  179. package/examples/security.yml +58 -0
  180. package/examples/ui-advanced.yml +49 -0
  181. package/examples/ui-basic.yml +24 -0
  182. package/package.json +33 -67
  183. package/CHANGELOG.md +0 -330
  184. package/CONTRIBUTING.md +0 -273
  185. package/QUICK_START.md +0 -191
  186. package/cli/CHANGELOG.md +0 -84
  187. package/cli/LICENSE +0 -24
  188. package/cli/README.md +0 -222
  189. package/cli/dist/core/adapters/playwright-ui.js +0 -864
  190. package/cli/dist/core/auth/oauth2-provider.js +0 -114
  191. package/cli/dist/core/coverage/analyzer.d.ts +0 -101
  192. package/cli/dist/core/coverage/analyzer.js +0 -415
  193. package/cli/dist/core/coverage/collector.d.ts +0 -74
  194. package/cli/dist/core/coverage/collector.js +0 -459
  195. package/cli/dist/core/coverage/config.d.ts +0 -37
  196. package/cli/dist/core/coverage/config.js +0 -156
  197. package/cli/dist/core/coverage/index.d.ts +0 -11
  198. package/cli/dist/core/coverage/index.js +0 -15
  199. package/cli/dist/core/coverage/types.d.ts +0 -267
  200. package/cli/dist/core/coverage/types.js +0 -6
  201. package/cli/dist/core/coverage/vault.d.ts +0 -95
  202. package/cli/dist/core/coverage/vault.js +0 -405
  203. package/cli/dist/core/crawler/index.d.ts +0 -57
  204. package/cli/dist/core/fixtures/index.d.ts +0 -8
  205. package/cli/dist/core/fixtures/index.js +0 -8
  206. package/cli/dist/core/generation/crawler-pack-generator.js +0 -231
  207. package/cli/dist/core/reporting/index.d.ts +0 -6
  208. package/cli/dist/core/reporting/index.js +0 -6
  209. package/cli/dist/core/visual/index.d.ts +0 -6
  210. package/cli/dist/core/visual/index.js +0 -6
  211. package/cli/package.json +0 -76
  212. package/core/LICENSE +0 -24
  213. package/core/README.md +0 -105
  214. package/core/package.json +0 -90
  215. package/core/schemas/pack.schema.json +0 -236
  216. /package/{cli/bin → bin}/qa360.js +0 -0
  217. /package/{cli/dist → dist}/cli-minimal.d.ts +0 -0
  218. /package/{cli/dist → dist}/cli-minimal.js +0 -0
  219. /package/{cli/dist → dist}/commands/ai.d.ts +0 -0
  220. /package/{cli/dist → dist}/commands/ask.d.ts +0 -0
  221. /package/{cli/dist → dist}/commands/ask.js +0 -0
  222. /package/{cli/dist → dist}/commands/coverage.d.ts +0 -0
  223. /package/{cli/dist → dist}/commands/crawl.d.ts +0 -0
  224. /package/{cli/dist → dist}/commands/doctor.d.ts +0 -0
  225. /package/{cli/dist → dist}/commands/examples.d.ts +0 -0
  226. /package/{cli/dist → dist}/commands/examples.js +0 -0
  227. /package/{cli/dist → dist}/commands/explain.d.ts +0 -0
  228. /package/{cli/dist → dist}/commands/flakiness.d.ts +0 -0
  229. /package/{cli/dist → dist}/commands/generate.d.ts +0 -0
  230. /package/{cli/dist → dist}/commands/history.d.ts +0 -0
  231. /package/{cli/dist → dist}/commands/init.d.ts +0 -0
  232. /package/{cli/dist → dist}/commands/init.js +0 -0
  233. /package/{cli/dist → dist}/commands/monitor.d.ts +0 -0
  234. /package/{cli/dist → dist}/commands/ollama.d.ts +0 -0
  235. /package/{cli/dist → dist}/commands/pack.d.ts +0 -0
  236. /package/{cli/dist → dist}/commands/regression.d.ts +0 -0
  237. /package/{cli/dist → dist}/commands/repair.d.ts +0 -0
  238. /package/{cli/dist → dist}/commands/report.d.ts +0 -0
  239. /package/{cli/dist → dist}/commands/report.js +0 -0
  240. /package/{cli/dist → dist}/commands/retry.d.ts +0 -0
  241. /package/{cli/dist → dist}/commands/scan.d.ts +0 -0
  242. /package/{cli/dist → dist}/commands/scan.js +0 -0
  243. /package/{cli/dist → dist}/commands/secrets.d.ts +0 -0
  244. /package/{cli/dist → dist}/commands/serve.d.ts +0 -0
  245. /package/{cli/dist → dist}/commands/slo.d.ts +0 -0
  246. /package/{cli/dist → dist}/commands/verify.d.ts +0 -0
  247. /package/{cli/dist → dist}/core/adapters/gitleaks-secrets.d.ts +0 -0
  248. /package/{cli/dist → dist}/core/adapters/gitleaks-secrets.js +0 -0
  249. /package/{cli/dist → dist}/core/adapters/jest-adapter.d.ts +0 -0
  250. /package/{cli/dist → dist}/core/adapters/jest-adapter.js +0 -0
  251. /package/{cli/dist → dist}/core/adapters/k6-perf.d.ts +0 -0
  252. /package/{cli/dist → dist}/core/adapters/k6-perf.js +0 -0
  253. /package/{cli/dist → dist}/core/adapters/osv-deps.d.ts +0 -0
  254. /package/{cli/dist → dist}/core/adapters/osv-deps.js +0 -0
  255. /package/{cli/dist → dist}/core/adapters/playwright-native-adapter.d.ts +0 -0
  256. /package/{cli/dist → dist}/core/adapters/playwright-native-adapter.js +0 -0
  257. /package/{cli/dist → dist}/core/adapters/pytest-adapter.d.ts +0 -0
  258. /package/{cli/dist → dist}/core/adapters/pytest-adapter.js +0 -0
  259. /package/{cli/dist → dist}/core/adapters/semgrep-sast.d.ts +0 -0
  260. /package/{cli/dist → dist}/core/adapters/semgrep-sast.js +0 -0
  261. /package/{cli/dist → dist}/core/adapters/unit-test-types.d.ts +0 -0
  262. /package/{cli/dist → dist}/core/adapters/unit-test-types.js +0 -0
  263. /package/{cli/dist → dist}/core/adapters/vitest-adapter.d.ts +0 -0
  264. /package/{cli/dist → dist}/core/adapters/vitest-adapter.js +0 -0
  265. /package/{cli/dist → dist}/core/adapters/zap-dast.d.ts +0 -0
  266. /package/{cli/dist → dist}/core/adapters/zap-dast.js +0 -0
  267. /package/{cli/dist → dist}/core/ai/anthropic-provider.d.ts +0 -0
  268. /package/{cli/dist → dist}/core/ai/anthropic-provider.js +0 -0
  269. /package/{cli/dist → dist}/core/ai/deepseek-provider.d.ts +0 -0
  270. /package/{cli/dist → dist}/core/ai/deepseek-provider.js +0 -0
  271. /package/{cli/dist → dist}/core/ai/index.d.ts +0 -0
  272. /package/{cli/dist → dist}/core/ai/index.js +0 -0
  273. /package/{cli/dist → dist}/core/ai/llm-client.d.ts +0 -0
  274. /package/{cli/dist → dist}/core/ai/llm-client.js +0 -0
  275. /package/{cli/dist → dist}/core/ai/mock-provider.d.ts +0 -0
  276. /package/{cli/dist → dist}/core/ai/mock-provider.js +0 -0
  277. /package/{cli/dist → dist}/core/ai/ollama-provider.d.ts +0 -0
  278. /package/{cli/dist → dist}/core/ai/openai-provider.d.ts +0 -0
  279. /package/{cli/dist → dist}/core/ai/openai-provider.js +0 -0
  280. /package/{cli/dist → dist}/core/ai/provider-factory.d.ts +0 -0
  281. /package/{cli/dist → dist}/core/ai/provider-factory.js +0 -0
  282. /package/{cli/dist → dist}/core/artifacts/index.d.ts +0 -0
  283. /package/{cli/dist → dist}/core/artifacts/index.js +0 -0
  284. /package/{cli/dist → dist}/core/artifacts/ui-artifacts.d.ts +0 -0
  285. /package/{cli/dist → dist}/core/assertions/engine.d.ts +0 -0
  286. /package/{cli/dist → dist}/core/assertions/engine.js +0 -0
  287. /package/{cli/dist → dist}/core/assertions/index.d.ts +0 -0
  288. /package/{cli/dist → dist}/core/assertions/index.js +0 -0
  289. /package/{cli/dist → dist}/core/assertions/types.d.ts +0 -0
  290. /package/{cli/dist → dist}/core/assertions/types.js +0 -0
  291. /package/{cli/dist → dist}/core/auth/api-key-provider.d.ts +0 -0
  292. /package/{cli/dist → dist}/core/auth/api-key-provider.js +0 -0
  293. /package/{cli/dist → dist}/core/auth/aws-iam-provider.d.ts +0 -0
  294. /package/{cli/dist → dist}/core/auth/aws-iam-provider.js +0 -0
  295. /package/{cli/dist → dist}/core/auth/azure-ad-provider.d.ts +0 -0
  296. /package/{cli/dist → dist}/core/auth/azure-ad-provider.js +0 -0
  297. /package/{cli/dist → dist}/core/auth/gcp-adc-provider.d.ts +0 -0
  298. /package/{cli/dist → dist}/core/auth/gcp-adc-provider.js +0 -0
  299. /package/{cli/dist → dist}/core/auth/jwt-provider.d.ts +0 -0
  300. /package/{cli/dist → dist}/core/auth/jwt-provider.js +0 -0
  301. /package/{cli/dist → dist}/core/auth/manager.d.ts +0 -0
  302. /package/{cli/dist → dist}/core/auth/manager.js +0 -0
  303. /package/{cli/dist → dist}/core/auth/totp-provider.d.ts +0 -0
  304. /package/{cli/dist → dist}/core/auth/totp-provider.js +0 -0
  305. /package/{cli/dist → dist}/core/auth/ui-login-provider.d.ts +0 -0
  306. /package/{cli/dist → dist}/core/auth/ui-login-provider.js +0 -0
  307. /package/{cli/dist → dist}/core/cache/index.d.ts +0 -0
  308. /package/{cli/dist → dist}/core/cache/index.js +0 -0
  309. /package/{cli/dist → dist}/core/cache/lru-cache.d.ts +0 -0
  310. /package/{cli/dist → dist}/core/cache/lru-cache.js +0 -0
  311. /package/{cli/dist/core → dist}/core/coverage/analyzer.d.ts +0 -0
  312. /package/{cli/dist/core → dist}/core/coverage/analyzer.js +0 -0
  313. /package/{cli/dist/core → dist}/core/coverage/collector.d.ts +0 -0
  314. /package/{cli/dist/core → dist}/core/coverage/collector.js +0 -0
  315. /package/{cli/dist/core → dist}/core/coverage/config.d.ts +0 -0
  316. /package/{cli/dist/core → dist}/core/coverage/config.js +0 -0
  317. /package/{cli/dist/core → dist}/core/coverage/index.d.ts +0 -0
  318. /package/{cli/dist/core → dist}/core/coverage/index.js +0 -0
  319. /package/{cli/dist/core → dist}/core/coverage/types.d.ts +0 -0
  320. /package/{cli/dist/core → dist}/core/coverage/types.js +0 -0
  321. /package/{cli/dist/core → dist}/core/coverage/vault.d.ts +0 -0
  322. /package/{cli/dist/core → dist}/core/coverage/vault.js +0 -0
  323. /package/{cli/dist → dist}/core/crawler/journey-generator.d.ts +0 -0
  324. /package/{cli/dist → dist}/core/crawler/types.js +0 -0
  325. /package/{cli/dist → dist}/core/dashboard/assets.d.ts +0 -0
  326. /package/{cli/dist → dist}/core/dashboard/assets.js +0 -0
  327. /package/{cli/dist → dist}/core/dashboard/index.d.ts +0 -0
  328. /package/{cli/dist → dist}/core/dashboard/index.js +0 -0
  329. /package/{cli/dist → dist}/core/dashboard/server.d.ts +0 -0
  330. /package/{cli/dist → dist}/core/dashboard/server.js +0 -0
  331. /package/{cli/dist → dist}/core/dashboard/types.d.ts +0 -0
  332. /package/{cli/dist → dist}/core/dashboard/types.js +0 -0
  333. /package/{cli/dist → dist}/core/discoverer/index.d.ts +0 -0
  334. /package/{cli/dist → dist}/core/discoverer/index.js +0 -0
  335. /package/{cli/dist → dist}/core/fixtures/loader.d.ts +0 -0
  336. /package/{cli/dist → dist}/core/fixtures/loader.js +0 -0
  337. /package/{cli/dist → dist}/core/fixtures/resolver.d.ts +0 -0
  338. /package/{cli/dist → dist}/core/fixtures/resolver.js +0 -0
  339. /package/{cli/dist → dist}/core/fixtures/types.d.ts +0 -0
  340. /package/{cli/dist → dist}/core/fixtures/types.js +0 -0
  341. /package/{cli/dist → dist}/core/flakiness/index.d.ts +0 -0
  342. /package/{cli/dist → dist}/core/flakiness/index.js +0 -0
  343. /package/{cli/dist → dist}/core/generation/code-formatter.d.ts +0 -0
  344. /package/{cli/dist → dist}/core/generation/code-formatter.js +0 -0
  345. /package/{cli/dist → dist}/core/generation/code-generator.d.ts +0 -0
  346. /package/{cli/dist → dist}/core/generation/code-generator.js +0 -0
  347. /package/{cli/dist → dist}/core/generation/generator.d.ts +0 -0
  348. /package/{cli/dist → dist}/core/generation/generator.js +0 -0
  349. /package/{cli/dist → dist}/core/generation/pack-generator.d.ts +0 -0
  350. /package/{cli/dist → dist}/core/generation/pack-generator.js +0 -0
  351. /package/{cli/dist → dist}/core/generation/prompt-builder.d.ts +0 -0
  352. /package/{cli/dist → dist}/core/generation/prompt-builder.js +0 -0
  353. /package/{cli/dist → dist}/core/generation/source-analyzer.d.ts +0 -0
  354. /package/{cli/dist → dist}/core/generation/source-analyzer.js +0 -0
  355. /package/{cli/dist → dist}/core/generation/test-optimizer.d.ts +0 -0
  356. /package/{cli/dist → dist}/core/generation/test-optimizer.js +0 -0
  357. /package/{cli/dist → dist}/core/generation/types.d.ts +0 -0
  358. /package/{cli/dist → dist}/core/generation/types.js +0 -0
  359. /package/{cli/dist → dist}/core/hooks/compose.d.ts +0 -0
  360. /package/{cli/dist → dist}/core/hooks/compose.js +0 -0
  361. /package/{cli/dist → dist}/core/hooks/runner.d.ts +0 -0
  362. /package/{cli/dist → dist}/core/hooks/runner.js +0 -0
  363. /package/{cli/dist → dist}/core/pack/migrator.d.ts +0 -0
  364. /package/{cli/dist → dist}/core/pack/migrator.js +0 -0
  365. /package/{cli/dist → dist}/core/pack/validator.d.ts +0 -0
  366. /package/{cli/dist → dist}/core/pack-v2/index.d.ts +0 -0
  367. /package/{cli/dist → dist}/core/pack-v2/index.js +0 -0
  368. /package/{cli/dist → dist}/core/pack-v2/loader.d.ts +0 -0
  369. /package/{cli/dist → dist}/core/pack-v2/loader.js +0 -0
  370. /package/{cli/dist → dist}/core/pack-v2/validator.d.ts +0 -0
  371. /package/{cli/dist → dist}/core/parallel/index.d.ts +0 -0
  372. /package/{cli/dist → dist}/core/parallel/index.js +0 -0
  373. /package/{cli/dist → dist}/core/parallel/parallel-runner.d.ts +0 -0
  374. /package/{cli/dist → dist}/core/parallel/parallel-runner.js +0 -0
  375. /package/{cli/dist → dist}/core/pom/base-page.d.ts +0 -0
  376. /package/{cli/dist → dist}/core/pom/index.d.ts +0 -0
  377. /package/{cli/dist → dist}/core/pom/index.js +0 -0
  378. /package/{cli/dist → dist}/core/pom/loader.d.ts +0 -0
  379. /package/{cli/dist → dist}/core/pom/types.d.ts +0 -0
  380. /package/{cli/dist → dist}/core/pom/types.js +0 -0
  381. /package/{cli/dist → dist}/core/proof/bundle.d.ts +0 -0
  382. /package/{cli/dist → dist}/core/proof/bundle.js +0 -0
  383. /package/{cli/dist → dist}/core/proof/canonicalize.d.ts +0 -0
  384. /package/{cli/dist → dist}/core/proof/canonicalize.js +0 -0
  385. /package/{cli/dist → dist}/core/proof/index.d.ts +0 -0
  386. /package/{cli/dist → dist}/core/proof/index.js +0 -0
  387. /package/{cli/dist → dist}/core/proof/schema.d.ts +0 -0
  388. /package/{cli/dist → dist}/core/proof/schema.js +0 -0
  389. /package/{cli/dist → dist}/core/proof/signer.d.ts +0 -0
  390. /package/{cli/dist → dist}/core/proof/signer.js +0 -0
  391. /package/{cli/dist → dist}/core/proof/verifier.d.ts +0 -0
  392. /package/{cli/dist → dist}/core/proof/verifier.js +0 -0
  393. /package/{cli/dist → dist}/core/regression/detector.d.ts +0 -0
  394. /package/{cli/dist → dist}/core/regression/detector.js +0 -0
  395. /package/{cli/dist → dist}/core/regression/index.d.ts +0 -0
  396. /package/{cli/dist → dist}/core/regression/index.js +0 -0
  397. /package/{cli/dist → dist}/core/regression/trend-analyzer.d.ts +0 -0
  398. /package/{cli/dist → dist}/core/regression/trend-analyzer.js +0 -0
  399. /package/{cli/dist → dist}/core/regression/types.d.ts +0 -0
  400. /package/{cli/dist → dist}/core/regression/types.js +0 -0
  401. /package/{cli/dist → dist}/core/regression/vault.d.ts +0 -0
  402. /package/{cli/dist → dist}/core/regression/vault.js +0 -0
  403. /package/{cli/dist → dist}/core/repair/engine/fixer.d.ts +0 -0
  404. /package/{cli/dist → dist}/core/repair/engine/fixer.js +0 -0
  405. /package/{cli/dist → dist}/core/repair/engine/suggestion-engine.d.ts +0 -0
  406. /package/{cli/dist → dist}/core/repair/engine/suggestion-engine.js +0 -0
  407. /package/{cli/dist → dist}/core/repair/index.d.ts +0 -0
  408. /package/{cli/dist → dist}/core/repair/index.js +0 -0
  409. /package/{cli/dist → dist}/core/repair/repairer.d.ts +0 -0
  410. /package/{cli/dist → dist}/core/repair/repairer.js +0 -0
  411. /package/{cli/dist → dist}/core/repair/types.d.ts +0 -0
  412. /package/{cli/dist → dist}/core/repair/types.js +0 -0
  413. /package/{cli/dist → dist}/core/repair/utils/error-analyzer.d.ts +0 -0
  414. /package/{cli/dist → dist}/core/repair/utils/error-analyzer.js +0 -0
  415. /package/{cli/dist → dist}/core/reporting/html-reporter.d.ts +0 -0
  416. /package/{cli/dist → dist}/core/reporting/html-reporter.js +0 -0
  417. /package/{cli/dist → dist}/core/retry/flakiness-integration.d.ts +0 -0
  418. /package/{cli/dist → dist}/core/retry/flakiness-integration.js +0 -0
  419. /package/{cli/dist → dist}/core/retry/index.d.ts +0 -0
  420. /package/{cli/dist → dist}/core/retry/index.js +0 -0
  421. /package/{cli/dist → dist}/core/retry/retry-engine.d.ts +0 -0
  422. /package/{cli/dist → dist}/core/retry/retry-engine.js +0 -0
  423. /package/{cli/dist → dist}/core/retry/types.d.ts +0 -0
  424. /package/{cli/dist → dist}/core/retry/types.js +0 -0
  425. /package/{cli/dist → dist}/core/retry/vault.d.ts +0 -0
  426. /package/{cli/dist → dist}/core/retry/vault.js +0 -0
  427. /package/{cli/dist → dist}/core/schemas/pack.schema.json +0 -0
  428. /package/{cli/dist → dist}/core/secrets/crypto.d.ts +0 -0
  429. /package/{cli/dist → dist}/core/secrets/crypto.js +0 -0
  430. /package/{cli/dist → dist}/core/secrets/manager.d.ts +0 -0
  431. /package/{cli/dist → dist}/core/secrets/manager.js +0 -0
  432. /package/{cli/dist → dist}/core/security/redaction-patterns-extended.d.ts +0 -0
  433. /package/{cli/dist → dist}/core/security/redaction-patterns-extended.js +0 -0
  434. /package/{cli/dist → dist}/core/security/redactor.d.ts +0 -0
  435. /package/{cli/dist → dist}/core/security/redactor.js +0 -0
  436. /package/{cli/dist → dist}/core/self-healing/assertion-healer.d.ts +0 -0
  437. /package/{cli/dist → dist}/core/self-healing/assertion-healer.js +0 -0
  438. /package/{cli/dist → dist}/core/self-healing/engine.d.ts +0 -0
  439. /package/{cli/dist → dist}/core/self-healing/engine.js +0 -0
  440. /package/{cli/dist → dist}/core/self-healing/index.d.ts +0 -0
  441. /package/{cli/dist → dist}/core/self-healing/index.js +0 -0
  442. /package/{cli/dist → dist}/core/self-healing/selector-healer.d.ts +0 -0
  443. /package/{cli/dist → dist}/core/self-healing/selector-healer.js +0 -0
  444. /package/{cli/dist → dist}/core/self-healing/types.d.ts +0 -0
  445. /package/{cli/dist → dist}/core/self-healing/types.js +0 -0
  446. /package/{cli/dist → dist}/core/serve/diagnostics-collector.d.ts +0 -0
  447. /package/{cli/dist → dist}/core/serve/diagnostics-collector.js +0 -0
  448. /package/{cli/dist → dist}/core/serve/health-checker.d.ts +0 -0
  449. /package/{cli/dist → dist}/core/serve/health-checker.js +0 -0
  450. /package/{cli/dist → dist}/core/serve/index.d.ts +0 -0
  451. /package/{cli/dist → dist}/core/serve/index.js +0 -0
  452. /package/{cli/dist → dist}/core/serve/metrics-collector.d.ts +0 -0
  453. /package/{cli/dist → dist}/core/serve/metrics-collector.js +0 -0
  454. /package/{cli/dist → dist}/core/serve/process-manager.d.ts +0 -0
  455. /package/{cli/dist → dist}/core/serve/process-manager.js +0 -0
  456. /package/{cli/dist → dist}/core/serve/server.d.ts +0 -0
  457. /package/{cli/dist → dist}/core/serve/server.js +0 -0
  458. /package/{cli/dist → dist}/core/slo/config.d.ts +0 -0
  459. /package/{cli/dist → dist}/core/slo/config.js +0 -0
  460. /package/{cli/dist → dist}/core/slo/index.d.ts +0 -0
  461. /package/{cli/dist → dist}/core/slo/index.js +0 -0
  462. /package/{cli/dist → dist}/core/slo/sli-calculator.d.ts +0 -0
  463. /package/{cli/dist → dist}/core/slo/sli-calculator.js +0 -0
  464. /package/{cli/dist → dist}/core/slo/slo-tracker.d.ts +0 -0
  465. /package/{cli/dist → dist}/core/slo/slo-tracker.js +0 -0
  466. /package/{cli/dist → dist}/core/slo/types.d.ts +0 -0
  467. /package/{cli/dist → dist}/core/slo/types.js +0 -0
  468. /package/{cli/dist → dist}/core/slo/vault.d.ts +0 -0
  469. /package/{cli/dist → dist}/core/slo/vault.js +0 -0
  470. /package/{cli/dist → dist}/core/tui/index.d.ts +0 -0
  471. /package/{cli/dist → dist}/core/tui/index.js +0 -0
  472. /package/{cli/dist → dist}/core/tui/monitor.d.ts +0 -0
  473. /package/{cli/dist → dist}/core/tui/monitor.js +0 -0
  474. /package/{cli/dist → dist}/core/tui/renderer.d.ts +0 -0
  475. /package/{cli/dist → dist}/core/tui/renderer.js +0 -0
  476. /package/{cli/dist → dist}/core/tui/types.d.ts +0 -0
  477. /package/{cli/dist → dist}/core/tui/types.js +0 -0
  478. /package/{cli/dist → dist}/core/types/pack-v1.js +0 -0
  479. /package/{cli/dist → dist}/core/types/pack-v2.js +0 -0
  480. /package/{cli/dist → dist}/core/types/trust-score.d.ts +0 -0
  481. /package/{cli/dist → dist}/core/types/trust-score.js +0 -0
  482. /package/{cli/dist → dist}/core/vault/cas.d.ts +0 -0
  483. /package/{cli/dist → dist}/core/vault/cas.js +0 -0
  484. /package/{cli/dist → dist}/core/vault/index.d.ts +0 -0
  485. /package/{cli/dist → dist}/core/vault/index.js +0 -0
  486. /package/{cli/dist → dist}/core/visual/visual-regression.d.ts +0 -0
  487. /package/{cli/dist → dist}/core/visual/visual-regression.js +0 -0
  488. /package/{cli/dist → dist}/core/watch/index.d.ts +0 -0
  489. /package/{cli/dist → dist}/core/watch/index.js +0 -0
  490. /package/{cli/dist → dist}/core/watch/watch-mode.d.ts +0 -0
  491. /package/{cli/dist → dist}/core/watch/watch-mode.js +0 -0
  492. /package/{cli/dist → dist}/generators/index.d.ts +0 -0
  493. /package/{cli/dist → dist}/generators/index.js +0 -0
  494. /package/{cli/dist → dist}/generators/json-reporter.d.ts +0 -0
  495. /package/{cli/dist → dist}/generators/json-reporter.js +0 -0
  496. /package/{cli/dist → dist}/generators/test-generator.d.ts +0 -0
  497. /package/{cli/dist → dist}/generators/test-generator.js +0 -0
  498. /package/{cli/dist → dist}/index.d.ts +0 -0
  499. /package/{cli/dist → dist}/index.js +0 -0
  500. /package/{cli/dist → dist}/scanners/dom-scanner.d.ts +0 -0
  501. /package/{cli/dist → dist}/scanners/dom-scanner.js +0 -0
  502. /package/{cli/dist → dist}/scanners/index.d.ts +0 -0
  503. /package/{cli/dist → dist}/scanners/index.js +0 -0
  504. /package/{cli/dist → dist}/schemas/pack.schema.json +0 -0
  505. /package/{cli/dist → dist}/types/scan.d.ts +0 -0
  506. /package/{cli/dist → dist}/types/scan.js +0 -0
  507. /package/{cli/dist → dist}/utils/config.js +0 -0
@@ -0,0 +1,399 @@
1
+ /**
2
+ * Wait Strategies
3
+ *
4
+ * P1 - Advanced wait conditions for E2E tests
5
+ *
6
+ * Supports:
7
+ * - Network idle (no active network requests)
8
+ * - Element stable (position/size not changing)
9
+ * - DOM content loaded
10
+ * - Custom condition polling
11
+ * - Multiple wait strategies with timeout
12
+ *
13
+ * @see https://playwright.dev/docs/actionability
14
+ */
15
+ /**
16
+ * Wait Strategies class
17
+ */
18
+ export class WaitStrategies {
19
+ defaultTimeout;
20
+ defaultInterval;
21
+ constructor(config = {}) {
22
+ this.defaultTimeout = config.timeout || 30000;
23
+ this.defaultInterval = config.interval || 100;
24
+ }
25
+ /**
26
+ * Wait for network to be idle
27
+ */
28
+ async waitForNetworkIdle(page, config = {}) {
29
+ const timeout = config.timeout || this.defaultTimeout;
30
+ const idleTime = config.idleTime || 500;
31
+ const ignoreUrls = config.ignoreUrls || [];
32
+ const startTime = Date.now();
33
+ let lastActivityTime = Date.now();
34
+ let activeRequests = 0;
35
+ const shouldIgnore = (url) => {
36
+ for (const pattern of ignoreUrls) {
37
+ if (typeof pattern === 'string' && url.includes(pattern)) {
38
+ return true;
39
+ }
40
+ if (pattern instanceof RegExp && pattern.test(url)) {
41
+ return true;
42
+ }
43
+ }
44
+ return false;
45
+ };
46
+ const onRequest = (request) => {
47
+ if (!shouldIgnore(request.url())) {
48
+ activeRequests++;
49
+ lastActivityTime = Date.now();
50
+ }
51
+ };
52
+ const onResponse = (response) => {
53
+ if (!shouldIgnore(response.url())) {
54
+ activeRequests--;
55
+ lastActivityTime = Date.now();
56
+ }
57
+ };
58
+ page.on('request', onRequest);
59
+ page.on('response', onResponse);
60
+ try {
61
+ while (Date.now() - startTime < timeout) {
62
+ const currentTime = Date.now();
63
+ const timeSinceLastActivity = currentTime - lastActivityTime;
64
+ if (activeRequests === 0 && timeSinceLastActivity >= idleTime) {
65
+ return {
66
+ success: true,
67
+ duration: currentTime - startTime,
68
+ };
69
+ }
70
+ await new Promise(resolve => setTimeout(resolve, this.defaultInterval));
71
+ }
72
+ return {
73
+ success: false,
74
+ duration: Date.now() - startTime,
75
+ error: `Timeout waiting for network idle (${activeRequests} requests still active)`,
76
+ };
77
+ }
78
+ finally {
79
+ page.off('request', onRequest);
80
+ page.off('response', onResponse);
81
+ }
82
+ }
83
+ /**
84
+ * Wait for element to be stable (position/size not changing)
85
+ */
86
+ async waitForStable(page, selector, config = {}) {
87
+ const timeout = config.timeout || this.defaultTimeout;
88
+ const stableTime = config.stableTime || 500;
89
+ const tolerance = config.tolerance || 2;
90
+ const startTime = Date.now();
91
+ let lastBox = null;
92
+ let stableSince = null;
93
+ while (Date.now() - startTime < timeout) {
94
+ const box = await page.locator(selector).first().boundingBox();
95
+ if (!box) {
96
+ return {
97
+ success: false,
98
+ error: `Element not found: ${selector}`,
99
+ };
100
+ }
101
+ if (lastBox) {
102
+ const positionChanged = Math.abs(box.x - lastBox.x) > tolerance ||
103
+ Math.abs(box.y - lastBox.y) > tolerance;
104
+ const sizeChanged = Math.abs(box.width - lastBox.width) > tolerance ||
105
+ Math.abs(box.height - lastBox.height) > tolerance;
106
+ if (positionChanged || sizeChanged) {
107
+ stableSince = null;
108
+ }
109
+ else if (stableSince === null) {
110
+ stableSince = Date.now();
111
+ }
112
+ else if (Date.now() - stableSince >= stableTime) {
113
+ return {
114
+ success: true,
115
+ duration: Date.now() - startTime,
116
+ };
117
+ }
118
+ }
119
+ lastBox = box;
120
+ await new Promise(resolve => setTimeout(resolve, this.defaultInterval));
121
+ }
122
+ return {
123
+ success: false,
124
+ duration: Date.now() - startTime,
125
+ error: `Element did not become stable within ${timeout}ms`,
126
+ };
127
+ }
128
+ /**
129
+ * Wait for DOM content to be loaded
130
+ */
131
+ async waitForDOMContent(page, config = {}) {
132
+ const timeout = config.timeout || this.defaultTimeout;
133
+ const startTime = Date.now();
134
+ try {
135
+ await page.waitForLoadState('domcontentloaded', { timeout });
136
+ return {
137
+ success: true,
138
+ duration: Date.now() - startTime,
139
+ };
140
+ }
141
+ catch (e) {
142
+ return {
143
+ success: false,
144
+ duration: Date.now() - startTime,
145
+ error: e instanceof Error ? e.message : String(e),
146
+ };
147
+ }
148
+ }
149
+ /**
150
+ * Wait for network to be mostly idle (allows some background requests)
151
+ */
152
+ async waitForNetworkMostlyIdle(page, config = {}) {
153
+ const modifiedConfig = { ...config, idleTime: (config.idleTime || 500) / 2 };
154
+ return this.waitForNetworkIdle(page, modifiedConfig);
155
+ }
156
+ /**
157
+ * Wait for element to be visible and stable
158
+ */
159
+ async waitForVisibleAndStable(page, selector, config = {}) {
160
+ const timeout = config.timeout || this.defaultTimeout;
161
+ const startTime = Date.now();
162
+ try {
163
+ // Wait for visible first
164
+ await page.locator(selector).first().waitFor({ state: 'visible', timeout });
165
+ // Then wait for stable
166
+ return await this.waitForStable(page, selector, {
167
+ ...config,
168
+ timeout: timeout - (Date.now() - startTime),
169
+ });
170
+ }
171
+ catch (e) {
172
+ return {
173
+ success: false,
174
+ duration: Date.now() - startTime,
175
+ error: e instanceof Error ? e.message : String(e),
176
+ };
177
+ }
178
+ }
179
+ /**
180
+ * Wait for custom condition
181
+ */
182
+ async waitForCondition(page, condition, config = {}) {
183
+ const timeout = config.timeout || this.defaultTimeout;
184
+ const interval = config.interval || this.defaultInterval;
185
+ const startTime = Date.now();
186
+ while (Date.now() - startTime < timeout) {
187
+ if (await condition()) {
188
+ return {
189
+ success: true,
190
+ duration: Date.now() - startTime,
191
+ };
192
+ }
193
+ await new Promise(resolve => setTimeout(resolve, interval));
194
+ }
195
+ return {
196
+ success: false,
197
+ duration: Date.now() - startTime,
198
+ error: 'Condition not met within timeout',
199
+ };
200
+ }
201
+ /**
202
+ * Wait for any element in a list to be visible
203
+ */
204
+ async waitForAnyElement(page, selectors, config = {}) {
205
+ const timeout = config.timeout || this.defaultTimeout;
206
+ const startTime = Date.now();
207
+ try {
208
+ await page.waitForFunction((selectors) => {
209
+ return selectors.some((sel) => {
210
+ const el = document.querySelector(sel);
211
+ if (!el)
212
+ return false;
213
+ const style = window.getComputedStyle(el);
214
+ return style.visibility !== 'hidden' && style.display !== 'none';
215
+ });
216
+ }, selectors, { timeout });
217
+ return {
218
+ success: true,
219
+ duration: Date.now() - startTime,
220
+ };
221
+ }
222
+ catch (e) {
223
+ return {
224
+ success: false,
225
+ duration: Date.now() - startTime,
226
+ error: `No element found from selectors: ${selectors.join(', ')}`,
227
+ };
228
+ }
229
+ }
230
+ /**
231
+ * Wait for text to appear in element
232
+ */
233
+ async waitForText(page, selector, text, config = {}) {
234
+ const timeout = config.timeout || this.defaultTimeout;
235
+ const startTime = Date.now();
236
+ try {
237
+ await page.locator(selector).first().waitFor({ state: 'visible', timeout });
238
+ await page.waitForFunction(({ sel, text }) => {
239
+ const el = document.querySelector(sel);
240
+ if (!el)
241
+ return false;
242
+ const content = el.textContent || '';
243
+ if (typeof text === 'string') {
244
+ return content.includes(text);
245
+ }
246
+ return text.test(content);
247
+ }, { sel: selector, text }, { timeout: timeout - (Date.now() - startTime) });
248
+ return {
249
+ success: true,
250
+ duration: Date.now() - startTime,
251
+ };
252
+ }
253
+ catch (e) {
254
+ return {
255
+ success: false,
256
+ duration: Date.now() - startTime,
257
+ error: `Text "${text}" not found in ${selector}`,
258
+ };
259
+ }
260
+ }
261
+ /**
262
+ * Wait for element count to match expected
263
+ */
264
+ async waitForElementCount(page, selector, count, config = {}) {
265
+ const timeout = config.timeout || this.defaultTimeout;
266
+ const startTime = Date.now();
267
+ try {
268
+ await page.waitForFunction(({ sel, expected }) => {
269
+ return document.querySelectorAll(sel).length === expected;
270
+ }, { sel: selector, expected: count }, { timeout });
271
+ return {
272
+ success: true,
273
+ duration: Date.now() - startTime,
274
+ };
275
+ }
276
+ catch (e) {
277
+ return {
278
+ success: false,
279
+ duration: Date.now() - startTime,
280
+ error: `Element count did not reach ${count} for ${selector}`,
281
+ };
282
+ }
283
+ }
284
+ /**
285
+ * Wait for URL to match pattern
286
+ */
287
+ async waitForURL(page, pattern, config = {}) {
288
+ const timeout = config.timeout || this.defaultTimeout;
289
+ const startTime = Date.now();
290
+ try {
291
+ await page.waitForURL(pattern, { timeout });
292
+ return {
293
+ success: true,
294
+ duration: Date.now() - startTime,
295
+ };
296
+ }
297
+ catch (e) {
298
+ return {
299
+ success: false,
300
+ duration: Date.now() - startTime,
301
+ error: `URL did not match pattern: ${pattern}`,
302
+ };
303
+ }
304
+ }
305
+ /**
306
+ * Wait for console message matching pattern
307
+ */
308
+ async waitForConsoleMessage(page, pattern, config = {}) {
309
+ const timeout = config.timeout || this.defaultTimeout;
310
+ const startTime = Date.now();
311
+ const messageType = config.type || 'log';
312
+ try {
313
+ await page.waitForConsoleMessage((msg) => {
314
+ if (msg.type() !== messageType)
315
+ return false;
316
+ const text = msg.text();
317
+ if (typeof pattern === 'string') {
318
+ return text.includes(pattern);
319
+ }
320
+ return pattern.test(text);
321
+ }, { timeout });
322
+ return {
323
+ success: true,
324
+ duration: Date.now() - startTime,
325
+ };
326
+ }
327
+ catch (e) {
328
+ return {
329
+ success: false,
330
+ duration: Date.now() - startTime,
331
+ error: `Console message not found matching: ${pattern}`,
332
+ };
333
+ }
334
+ }
335
+ /**
336
+ * Wait for page title
337
+ */
338
+ async waitForTitle(page, title, config = {}) {
339
+ const timeout = config.timeout || this.defaultTimeout;
340
+ const startTime = Date.now();
341
+ try {
342
+ await page.waitForTitle(title, { timeout });
343
+ return {
344
+ success: true,
345
+ duration: Date.now() - startTime,
346
+ };
347
+ }
348
+ catch (e) {
349
+ return {
350
+ success: false,
351
+ duration: Date.now() - startTime,
352
+ error: `Title did not match: ${title}`,
353
+ };
354
+ }
355
+ }
356
+ /**
357
+ * Wait for multiple conditions (all must be true)
358
+ */
359
+ async waitForAll(page, conditions, config = {}) {
360
+ const results = await Promise.all(conditions.map(condition => this.waitForCondition(page, condition, config)));
361
+ const allSuccess = results.every(r => r.success);
362
+ const maxDuration = Math.max(...results.map(r => r.duration || 0));
363
+ return {
364
+ success: allSuccess,
365
+ duration: maxDuration,
366
+ error: allSuccess ? undefined : 'Not all conditions were met',
367
+ };
368
+ }
369
+ /**
370
+ * Wait for multiple conditions (any can be true)
371
+ */
372
+ async waitForAny(page, conditions, config = {}) {
373
+ const timeout = config.timeout || this.defaultTimeout;
374
+ const startTime = Date.now();
375
+ const interval = config.interval || this.defaultInterval;
376
+ while (Date.now() - startTime < timeout) {
377
+ const results = await Promise.all(conditions.map(condition => condition()));
378
+ if (results.some(r => r === true)) {
379
+ return {
380
+ success: true,
381
+ duration: Date.now() - startTime,
382
+ };
383
+ }
384
+ await new Promise(resolve => setTimeout(resolve, interval));
385
+ }
386
+ return {
387
+ success: false,
388
+ duration: Date.now() - startTime,
389
+ error: 'No condition was met within timeout',
390
+ };
391
+ }
392
+ }
393
+ /**
394
+ * Factory function to create Wait Strategies
395
+ */
396
+ export function createWaitStrategies(config) {
397
+ return new WaitStrategies(config);
398
+ }
399
+ export default WaitStrategies;
@@ -0,0 +1,180 @@
1
+ /**
2
+ * QA360 Fixtures Module
3
+ *
4
+ * P0: Reusable test data and factory functions
5
+ * - Factories for creating test entities
6
+ * - Fake data generation
7
+ * - Seeded random for deterministic tests
8
+ */
9
+ /**
10
+ * Factory options
11
+ */
12
+ export interface FactoryOptions {
13
+ /** Optional overrides for default values */
14
+ overrides?: Record<string, unknown>;
15
+ /** Optional relationships to other entities */
16
+ relations?: Record<string, unknown>;
17
+ }
18
+ /**
19
+ * Base factory interface
20
+ */
21
+ export interface Factory<T> {
22
+ build(options?: FactoryOptions): T;
23
+ buildMany(count: number, options?: FactoryOptions): T[];
24
+ }
25
+ /**
26
+ * User entity factory
27
+ */
28
+ export interface User {
29
+ id?: string;
30
+ username: string;
31
+ email: string;
32
+ password: string;
33
+ firstName?: string;
34
+ lastName?: string;
35
+ role?: 'user' | 'admin' | 'moderator';
36
+ active?: boolean;
37
+ createdAt?: Date;
38
+ }
39
+ /**
40
+ * Test result factory
41
+ */
42
+ export interface TestResult {
43
+ id?: string;
44
+ name: string;
45
+ status: 'passed' | 'failed' | 'skipped';
46
+ duration: number;
47
+ error?: string;
48
+ }
49
+ /**
50
+ * API response factory
51
+ */
52
+ export interface ApiResponse {
53
+ status: number;
54
+ data?: unknown;
55
+ error?: string;
56
+ headers?: Record<string, string>;
57
+ }
58
+ /**
59
+ * User Factory
60
+ */
61
+ export declare class UserFactory implements Factory<User> {
62
+ private static counter;
63
+ build(options?: FactoryOptions): User;
64
+ buildMany(count: number, options?: FactoryOptions): User[];
65
+ /**
66
+ * Create an admin user
67
+ */
68
+ admin(options?: FactoryOptions): User;
69
+ /**
70
+ * Create an inactive user
71
+ */
72
+ inactive(options?: FactoryOptions): User;
73
+ }
74
+ /**
75
+ * Test Result Factory
76
+ */
77
+ export declare class TestResultFactory implements Factory<TestResult> {
78
+ private static counter;
79
+ build(options?: FactoryOptions): TestResult;
80
+ buildMany(count: number, options?: FactoryOptions): TestResult[];
81
+ /**
82
+ * Create a passed test
83
+ */
84
+ passed(options?: FactoryOptions): TestResult;
85
+ /**
86
+ * Create a failed test
87
+ */
88
+ failed(options?: FactoryOptions): TestResult;
89
+ /**
90
+ * Create a skipped test
91
+ */
92
+ skipped(options?: FactoryOptions): TestResult;
93
+ }
94
+ /**
95
+ * API Response Factory
96
+ */
97
+ export declare class ApiResponseFactory implements Factory<ApiResponse> {
98
+ build(options?: FactoryOptions): ApiResponse;
99
+ buildMany(count: number, options?: FactoryOptions): ApiResponse[];
100
+ /**
101
+ * Create a success response
102
+ */
103
+ success(data?: unknown, options?: FactoryOptions): ApiResponse;
104
+ /**
105
+ * Create an error response
106
+ */
107
+ error(status?: number, message?: string, options?: FactoryOptions): ApiResponse;
108
+ /**
109
+ * Create a not found response
110
+ */
111
+ notFound(options?: FactoryOptions): ApiResponse;
112
+ /**
113
+ * Create an unauthorized response
114
+ */
115
+ unauthorized(options?: FactoryOptions): ApiResponse;
116
+ }
117
+ /**
118
+ * Fake data generator with seeded random
119
+ */
120
+ export declare class FakeData {
121
+ private static seed;
122
+ /**
123
+ * Set the seed for deterministic random generation
124
+ */
125
+ static setSeed(seed: number): void;
126
+ /**
127
+ * Seeded random number generator (Mulberry32)
128
+ */
129
+ private static random;
130
+ /**
131
+ * Generate a random integer between min and max (inclusive)
132
+ */
133
+ static integer(min: number, max: number): number;
134
+ /**
135
+ * Generate a random float between min and max
136
+ */
137
+ static float(min: number, max: number): number;
138
+ /**
139
+ * Generate a random string
140
+ */
141
+ static string(length?: number, charset?: string): string;
142
+ /**
143
+ * Generate a random email
144
+ */
145
+ static email(): string;
146
+ /**
147
+ * Generate a random URL
148
+ */
149
+ static url(): string;
150
+ /**
151
+ * Generate a random UUID v4
152
+ */
153
+ static uuid(): string;
154
+ /**
155
+ * Generate a random date
156
+ */
157
+ static date(minYear?: number, maxYear?: number): Date;
158
+ /**
159
+ * Generate a random boolean
160
+ */
161
+ static boolean(): boolean;
162
+ /**
163
+ * Pick a random element from an array
164
+ */
165
+ static pick<T>(array: T[]): T;
166
+ /**
167
+ * Generate a random name
168
+ */
169
+ static name(): string;
170
+ /**
171
+ * Generate a random paragraph
172
+ */
173
+ static paragraph(sentences?: number): string;
174
+ }
175
+ /**
176
+ * Convenience functions
177
+ */
178
+ export declare const userFactory: UserFactory;
179
+ export declare const testResultFactory: TestResultFactory;
180
+ export declare const apiResponseFactory: ApiResponseFactory;