@testspectra/cli 1.1.7 → 1.1.8-rc.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 (261) hide show
  1. package/bin/.testspectra-runner.hash +1 -1
  2. package/bin/spectra.js +0 -0
  3. package/bin/testspectra-runner.exe +0 -0
  4. package/demo-app/assets/index-BhlW-eXG.css +1 -0
  5. package/demo-app/assets/index-DOtRypCa.js +154 -0
  6. package/demo-app/index.html +2 -2
  7. package/dist/.tsbuildinfo +1 -1
  8. package/dist/commands/__tests__/run-e2e.test.js +270 -29
  9. package/dist/commands/__tests__/run.test.js +92 -16
  10. package/dist/commands/demo.js +17 -7
  11. package/dist/commands/init.d.ts +1 -1
  12. package/dist/commands/init.js +154 -149
  13. package/dist/commands/lint.d.ts +5 -0
  14. package/dist/commands/lint.js +55 -0
  15. package/dist/commands/refactor.d.ts +2 -1
  16. package/dist/commands/refactor.js +129 -35
  17. package/dist/commands/run.d.ts +2 -3
  18. package/dist/commands/run.js +93 -28
  19. package/dist/commands/skills.d.ts +9 -0
  20. package/dist/commands/skills.js +28 -0
  21. package/dist/commands/sync-types.js +1 -0
  22. package/dist/commands/test.d.ts +17 -0
  23. package/dist/commands/test.js +104 -0
  24. package/dist/commands/watch.js +9 -3
  25. package/dist/config/loader.js +1 -1
  26. package/dist/config/schema.d.ts +5 -114
  27. package/dist/config/schema.js +1 -17
  28. package/dist/generator/__tests__/tsconfig-isolation.test.js +6 -2
  29. package/dist/generator/__tests__/type-generator.test.js +1 -1
  30. package/dist/generator/tsconfig-generator.js +44 -16
  31. package/dist/generator/type-generator.d.ts +24 -1
  32. package/dist/generator/type-generator.js +104 -8
  33. package/dist/index.d.ts +1 -1
  34. package/dist/index.js +76 -40
  35. package/dist/linter/__tests__/anonymous-export.test.js +184 -0
  36. package/dist/linter/__tests__/component-test-imports.test.d.ts +1 -0
  37. package/dist/linter/__tests__/component-test-imports.test.js +115 -0
  38. package/dist/linter/__tests__/shared-lib-boundary.test.d.ts +1 -0
  39. package/dist/linter/__tests__/shared-lib-boundary.test.js +270 -0
  40. package/dist/linter/__tests__/spec-schema.test.d.ts +1 -0
  41. package/dist/linter/__tests__/spec-schema.test.js +369 -0
  42. package/dist/linter/__tests__/step-parity.test.d.ts +1 -0
  43. package/dist/linter/__tests__/step-parity.test.js +372 -0
  44. package/dist/linter/discovery.d.ts +30 -0
  45. package/dist/linter/discovery.js +249 -0
  46. package/dist/linter/extractor.d.ts +67 -0
  47. package/dist/linter/extractor.js +245 -0
  48. package/dist/linter/index.d.ts +7 -0
  49. package/dist/linter/index.js +7 -0
  50. package/dist/linter/parser.d.ts +24 -0
  51. package/dist/linter/parser.js +219 -0
  52. package/dist/linter/schemas/spec.schema.d.ts +83 -0
  53. package/dist/linter/schemas/spec.schema.js +150 -0
  54. package/dist/linter/schemas/suite.schema.d.ts +59 -0
  55. package/dist/linter/schemas/suite.schema.js +83 -0
  56. package/dist/linter/spec-linter.d.ts +23 -0
  57. package/dist/linter/spec-linter.js +630 -0
  58. package/dist/linter/types.d.ts +28 -0
  59. package/dist/linter/types.js +1 -0
  60. package/dist/refactor/__tests__/refactor-engine.test.js +698 -0
  61. package/dist/refactor/refactor-engine.d.ts +25 -0
  62. package/dist/refactor/refactor-engine.js +374 -42
  63. package/dist/reporter/semantic-formatter.js +22 -2
  64. package/dist/reporter/types.d.ts +1 -1
  65. package/dist/runner/bridge.d.ts +1 -1
  66. package/dist/runner/bridge.js +34 -21
  67. package/dist/runner/reporter.d.ts +2 -0
  68. package/dist/runner/reporter.js +11 -3
  69. package/dist/utils/__tests__/api-server.test.d.ts +1 -0
  70. package/dist/utils/__tests__/api-server.test.js +62 -0
  71. package/dist/utils/__tests__/demo-server.test.d.ts +1 -0
  72. package/dist/utils/__tests__/demo-server.test.js +35 -0
  73. package/dist/utils/api-server.d.ts +19 -0
  74. package/dist/utils/api-server.js +179 -0
  75. package/dist/utils/demo-server.d.ts +5 -0
  76. package/dist/utils/demo-server.js +8 -1
  77. package/package.json +29 -25
  78. package/templates/default/CLAUDE.md +16 -11
  79. package/templates/default/global-hooks/after/mobile.hook.ts +3 -3
  80. package/templates/default/global-hooks/after/web.hook.ts +3 -3
  81. package/templates/default/global-hooks/before/mobile.hook.ts +3 -3
  82. package/templates/default/global-hooks/before/web.hook.ts +3 -3
  83. package/templates/default/package.json +3 -3
  84. package/templates/default/page-objects/AuthPage/mobile.ts +5 -0
  85. package/templates/default/page-objects/AuthPage/web.ts +10 -0
  86. package/templates/default/page-objects/MatchersPage/mobile.ts +70 -46
  87. package/templates/default/page-objects/MatchersPage/web.ts +43 -37
  88. package/templates/default/page-objects/NavigationPage/mobile.ts +14 -14
  89. package/templates/default/page-objects/NavigationPage/web.ts +8 -8
  90. package/templates/default/page-objects/PlaygroundPage/mobile.ts +42 -36
  91. package/templates/default/page-objects/PlaygroundPage/web.ts +31 -31
  92. package/templates/default/specs/ApiInterception/TC-0008-fetch-mocking/mobile.test.ts +53 -11
  93. package/templates/default/specs/ApiInterception/TC-0008-fetch-mocking/spec.md +19 -12
  94. package/templates/default/specs/ApiInterception/TC-0008-fetch-mocking/web.test.ts +31 -27
  95. package/templates/default/specs/ApiInterception/TC-0009-post-mocking/android.test.ts +3 -0
  96. package/templates/default/specs/ApiInterception/TC-0009-post-mocking/common.test.ts +3 -0
  97. package/templates/default/specs/ApiInterception/TC-0009-post-mocking/mobile.test.ts +27 -16
  98. package/templates/default/specs/ApiInterception/TC-0009-post-mocking/spec.md +19 -12
  99. package/templates/default/specs/ApiInterception/TC-0009-post-mocking/web.test.ts +26 -24
  100. package/templates/default/specs/ApiInterception/TC-0012-direct-and-late-response/common.test.ts +30 -0
  101. package/templates/default/specs/ApiInterception/TC-0012-direct-and-late-response/spec.md +22 -0
  102. package/templates/default/specs/ApiInterception/TC-0013-real-network-call-recorded/common.test.ts +27 -0
  103. package/templates/default/specs/ApiInterception/TC-0013-real-network-call-recorded/spec.md +20 -0
  104. package/templates/default/specs/ApiInterception/TC-0015-mock-server-sent-events/spec.md +24 -0
  105. package/templates/default/specs/ApiInterception/TC-0015-mock-server-sent-events/web.test.ts +26 -0
  106. package/templates/default/specs/ApiInterception/TC-0016-bypass-websocket-with-app-level-mock/spec.md +37 -0
  107. package/templates/default/specs/ApiInterception/TC-0016-bypass-websocket-with-app-level-mock/web.test.ts +21 -0
  108. package/templates/default/specs/ApiInterception/TC-0017-bypass-captcha-with-test-mode-flag/spec.md +29 -0
  109. package/templates/default/specs/ApiInterception/TC-0017-bypass-captcha-with-test-mode-flag/web.test.ts +16 -0
  110. package/templates/default/specs/ApiInterception/suite.md +10 -9
  111. package/templates/default/specs/ApiSeeding/TC-0014-seed-and-cleanup-via-hooks/common.test.ts +30 -0
  112. package/templates/default/specs/ApiSeeding/TC-0014-seed-and-cleanup-via-hooks/spec.md +23 -0
  113. package/templates/default/specs/ApiSeeding/hooks/after/common.hook.ts +16 -0
  114. package/templates/default/specs/ApiSeeding/hooks/before/common.hook.ts +28 -0
  115. package/templates/default/specs/ApiSeeding/suite.md +9 -0
  116. package/templates/default/specs/Authentication/TC-0021-seed-authenticated-session/mobile.test.ts +7 -0
  117. package/templates/default/specs/Authentication/TC-0021-seed-authenticated-session/spec.md +19 -0
  118. package/templates/default/specs/Authentication/TC-0021-seed-authenticated-session/web.test.ts +9 -0
  119. package/templates/default/specs/Authentication/suite.md +9 -0
  120. package/templates/default/specs/BrowserContext/TC-0007-title-and-navigation/mobile.test.ts +9 -9
  121. package/templates/default/specs/BrowserContext/TC-0007-title-and-navigation/spec.md +17 -12
  122. package/templates/default/specs/BrowserContext/TC-0007-title-and-navigation/web.test.ts +19 -19
  123. package/templates/default/specs/BrowserContext/TC-0022-history-navigation/mobile.test.ts +17 -0
  124. package/templates/default/specs/BrowserContext/TC-0022-history-navigation/spec.md +28 -0
  125. package/templates/default/specs/BrowserContext/TC-0022-history-navigation/web.test.ts +26 -0
  126. package/templates/default/specs/ContentMatchers/TC-0005-text-and-values/common.test.ts +26 -0
  127. package/templates/default/specs/ContentMatchers/TC-0005-text-and-values/spec.md +19 -12
  128. package/templates/default/specs/ContentMatchers/TC-0006-collections-and-empty/mobile.test.ts +11 -11
  129. package/templates/default/specs/ContentMatchers/TC-0006-collections-and-empty/spec.md +17 -12
  130. package/templates/default/specs/ContentMatchers/TC-0006-collections-and-empty/web.test.ts +11 -11
  131. package/templates/default/specs/ContentMatchers/TC-0020-scoped-element-access/common.test.ts +14 -0
  132. package/templates/default/specs/ContentMatchers/TC-0020-scoped-element-access/spec.md +21 -0
  133. package/templates/default/specs/DeepLink/TC-0018-navigate-via-deep-link/mobile.test.ts +28 -0
  134. package/templates/default/specs/DeepLink/TC-0018-navigate-via-deep-link/spec.md +29 -0
  135. package/templates/default/specs/DeepLink/suite.md +9 -0
  136. package/templates/default/specs/ElementMatchers/TC-0003-visibility-and-dom/mobile.test.ts +11 -11
  137. package/templates/default/specs/ElementMatchers/TC-0003-visibility-and-dom/spec.md +17 -12
  138. package/templates/default/specs/ElementMatchers/TC-0003-visibility-and-dom/web.test.ts +11 -11
  139. package/templates/default/specs/ElementMatchers/TC-0004-states-and-attributes/mobile.test.ts +29 -29
  140. package/templates/default/specs/ElementMatchers/TC-0004-states-and-attributes/spec.md +19 -12
  141. package/templates/default/specs/ElementMatchers/TC-0004-states-and-attributes/web.test.ts +29 -29
  142. package/templates/default/specs/ElementMatchers/suite.md +10 -9
  143. package/templates/default/specs/EnvironmentConfig/TC-0019-read-custom-environment-variable/common.test.ts +5 -0
  144. package/templates/default/specs/EnvironmentConfig/TC-0019-read-custom-environment-variable/spec.md +16 -0
  145. package/templates/default/specs/EnvironmentConfig/suite.md +9 -0
  146. package/templates/default/specs/PermissionRationale/TC-0010-camera-permission-allow/mobile.test.ts +26 -0
  147. package/templates/default/specs/PermissionRationale/TC-0010-camera-permission-allow/spec.md +22 -0
  148. package/templates/default/specs/PermissionRationale/TC-0011-camera-permission-deny/mobile.test.ts +13 -0
  149. package/templates/default/specs/PermissionRationale/TC-0011-camera-permission-deny/spec.md +20 -0
  150. package/templates/default/specs/PermissionRationale/suite.md +9 -0
  151. package/templates/default/specs/Playground/TC-0001-form-controls/mobile.test.ts +6 -6
  152. package/templates/default/specs/Playground/TC-0001-form-controls/spec.md +18 -12
  153. package/templates/default/specs/Playground/TC-0001-form-controls/web.test.ts +6 -6
  154. package/templates/default/specs/Playground/TC-0002-toggle-elements/mobile.test.ts +6 -6
  155. package/templates/default/specs/Playground/TC-0002-toggle-elements/spec.md +18 -12
  156. package/templates/default/specs/Playground/TC-0002-toggle-elements/web.test.ts +6 -6
  157. package/templates/default/spectra.config.ts +52 -68
  158. package/templates/default/support/actions/fillCredentials/mobile.action.ts +4 -4
  159. package/templates/default/support/actions/fillCredentials/web.action.ts +4 -4
  160. package/templates/default/support/actions/seedSession/mobile.action.ts +9 -0
  161. package/templates/default/support/actions/seedSession/web.action.ts +13 -0
  162. package/templates/default/support/steps/togglePlaygroundStates/mobile.step.ts +5 -5
  163. package/templates/default/support/steps/togglePlaygroundStates/web.step.ts +5 -5
  164. package/templates/default/support/steps/verifyPlaygroundState/mobile.step.ts +6 -6
  165. package/templates/default/support/steps/verifyPlaygroundState/web.step.ts +6 -6
  166. package/templates/nx/.nx/workspace-data/59842386-c7c4-44ca-b2c2-20e1700bd13d.db +0 -0
  167. package/templates/nx/.nx/workspace-data/59842386-c7c4-44ca-b2c2-20e1700bd13d.db-shm +0 -0
  168. package/templates/nx/.nx/workspace-data/59842386-c7c4-44ca-b2c2-20e1700bd13d.db-wal +0 -0
  169. package/templates/nx/.nx/workspace-data/d/daemon.log +1577 -168
  170. package/templates/nx/.nx/workspace-data/d/server-process.json +3 -0
  171. package/templates/nx/.nx/workspace-data/file-map.json +464 -0
  172. package/templates/nx/.nx/workspace-data/lockfile.hash +1 -0
  173. package/templates/nx/.nx/workspace-data/nx_files.nxt +0 -0
  174. package/templates/nx/.nx/workspace-data/parsed-lock-file.json +13485 -0
  175. package/templates/nx/.nx/workspace-data/project-graph.json +14389 -0
  176. package/templates/nx/CLAUDE.md +10 -10
  177. package/templates/nx/package.json +3 -3
  178. package/templates/nx/packages/matchers/e2e/specs/ApiInterception/TC-0008-fetch-mocking/mobile.test.ts +27 -3
  179. package/templates/nx/packages/matchers/e2e/specs/ApiInterception/TC-0008-fetch-mocking/web.test.ts +27 -27
  180. package/templates/nx/packages/matchers/e2e/specs/ApiInterception/TC-0009-post-mocking/mobile.test.ts +24 -3
  181. package/templates/nx/packages/matchers/e2e/specs/ApiInterception/TC-0009-post-mocking/web.test.ts +24 -24
  182. package/templates/nx/packages/matchers/e2e/specs/BrowserContext/TC-0007-title-and-navigation/mobile.test.ts +3 -3
  183. package/templates/nx/packages/matchers/e2e/specs/BrowserContext/TC-0007-title-and-navigation/web.test.ts +19 -19
  184. package/templates/nx/packages/matchers/e2e/specs/ContentMatchers/TC-0005-text-and-values/mobile.test.ts +3 -3
  185. package/templates/nx/packages/matchers/e2e/specs/ContentMatchers/TC-0005-text-and-values/web.test.ts +17 -17
  186. package/templates/nx/packages/matchers/e2e/specs/ContentMatchers/TC-0006-collections-and-empty/mobile.test.ts +3 -3
  187. package/templates/nx/packages/matchers/e2e/specs/ContentMatchers/TC-0006-collections-and-empty/web.test.ts +11 -11
  188. package/templates/nx/packages/matchers/e2e/specs/ElementMatchers/TC-0003-visibility-and-dom/mobile.test.ts +3 -3
  189. package/templates/nx/packages/matchers/e2e/specs/ElementMatchers/TC-0003-visibility-and-dom/web.test.ts +11 -11
  190. package/templates/nx/packages/matchers/e2e/specs/ElementMatchers/TC-0004-states-and-attributes/mobile.test.ts +3 -3
  191. package/templates/nx/packages/matchers/e2e/specs/ElementMatchers/TC-0004-states-and-attributes/web.test.ts +29 -29
  192. package/templates/nx/packages/matchers/e2e/specs/EnvironmentConfig/TC-0019-read-custom-environment-variable/common.test.ts +5 -0
  193. package/templates/nx/packages/matchers/e2e/specs/EnvironmentConfig/TC-0019-read-custom-environment-variable/spec.md +16 -0
  194. package/templates/nx/packages/matchers/e2e/specs/EnvironmentConfig/suite.md +9 -0
  195. package/templates/nx/packages/playground/e2e/specs/Playground/TC-0001-form-controls/mobile.test.ts +3 -3
  196. package/templates/nx/packages/playground/e2e/specs/Playground/TC-0001-form-controls/web.test.ts +6 -6
  197. package/templates/nx/packages/playground/e2e/specs/Playground/TC-0002-toggle-elements/mobile.test.ts +3 -3
  198. package/templates/nx/packages/playground/e2e/specs/Playground/TC-0002-toggle-elements/web.test.ts +6 -6
  199. package/templates/nx/pnpm-lock.yaml +6663 -6663
  200. package/templates/nx/pnpm-workspace.yaml +9 -9
  201. package/templates/nx/shared/testing/page-objects/MatchersPage/mobile.ts +33 -33
  202. package/templates/nx/shared/testing/page-objects/MatchersPage/web.ts +91 -37
  203. package/templates/nx/shared/testing/page-objects/NavigationPage/mobile.ts +5 -5
  204. package/templates/nx/shared/testing/page-objects/NavigationPage/web.ts +8 -8
  205. package/templates/nx/shared/testing/page-objects/PlaygroundPage/mobile.ts +26 -26
  206. package/templates/nx/shared/testing/page-objects/PlaygroundPage/web.ts +31 -31
  207. package/templates/nx/shared/testing/project.json +19 -19
  208. package/templates/nx/shared/testing/support/actions/fillCredentials/mobile.action.ts +4 -4
  209. package/templates/nx/shared/testing/support/actions/fillCredentials/web.action.ts +4 -4
  210. package/templates/nx/shared/testing/support/steps/togglePlaygroundStates/mobile.step.ts +3 -3
  211. package/templates/nx/shared/testing/support/steps/togglePlaygroundStates/web.step.ts +5 -5
  212. package/templates/nx/shared/testing/support/steps/verifyPlaygroundState/mobile.step.ts +4 -4
  213. package/templates/nx/shared/testing/support/steps/verifyPlaygroundState/web.step.ts +6 -6
  214. package/templates/nx/spectra.config.ts +52 -68
  215. package/templates/react-component/.cursorrules +17 -0
  216. package/templates/react-component/.vscode/extensions.json +5 -0
  217. package/templates/react-component/CLAUDE.md +14 -0
  218. package/templates/react-component/README.md +69 -0
  219. package/templates/react-component/fixtures/component-mock.json +12 -0
  220. package/templates/react-component/global-hooks/after/web.hook.ts +3 -0
  221. package/templates/react-component/global-hooks/before/web.hook.ts +3 -0
  222. package/templates/react-component/package.json +27 -0
  223. package/templates/react-component/page-objects/BadgeComponent/web.ts +23 -0
  224. package/templates/react-component/page-objects/ButtonComponent/web.ts +23 -0
  225. package/templates/react-component/page-objects/InputComponent/web.ts +13 -0
  226. package/templates/react-component/specs/BadgeComponent/TC-0002-badge-severities-and-dot/spec.md +18 -0
  227. package/templates/react-component/specs/BadgeComponent/TC-0002-badge-severities-and-dot/web.test.tsx +11 -0
  228. package/templates/react-component/specs/BadgeComponent/TC-0006-badge-success-with-dot/spec.md +18 -0
  229. package/templates/react-component/specs/BadgeComponent/TC-0006-badge-success-with-dot/web.test.tsx +10 -0
  230. package/templates/react-component/specs/BadgeComponent/TC-0007-badge-by-severity-lookup/spec.md +18 -0
  231. package/templates/react-component/specs/BadgeComponent/TC-0007-badge-by-severity-lookup/web.test.tsx +16 -0
  232. package/templates/react-component/specs/BadgeComponent/suite.md +12 -0
  233. package/templates/react-component/specs/ButtonComponent/TC-0001-button-rendering-and-click/spec.md +19 -0
  234. package/templates/react-component/specs/ButtonComponent/TC-0001-button-rendering-and-click/web.test.tsx +28 -0
  235. package/templates/react-component/specs/ButtonComponent/TC-0004-disabled-button-not-clickable/spec.md +19 -0
  236. package/templates/react-component/specs/ButtonComponent/TC-0004-disabled-button-not-clickable/web.test.tsx +22 -0
  237. package/templates/react-component/specs/ButtonComponent/TC-0005-button-renders-icon/spec.md +18 -0
  238. package/templates/react-component/specs/ButtonComponent/TC-0005-button-renders-icon/web.test.tsx +8 -0
  239. package/templates/react-component/specs/ButtonComponent/suite.md +12 -0
  240. package/templates/react-component/specs/InputComponent/TC-0003-input-typing-and-clear/spec.md +20 -0
  241. package/templates/react-component/specs/InputComponent/TC-0003-input-typing-and-clear/web.test.tsx +28 -0
  242. package/templates/react-component/specs/InputComponent/TC-0008-disabled-input-not-editable/spec.md +18 -0
  243. package/templates/react-component/specs/InputComponent/TC-0008-disabled-input-not-editable/web.test.tsx +9 -0
  244. package/templates/react-component/specs/InputComponent/suite.md +12 -0
  245. package/templates/react-component/spectra.config.ts +27 -0
  246. package/templates/react-component/src/components/Badge/Badge.tsx +60 -0
  247. package/templates/react-component/src/components/Button/Button.tsx +57 -0
  248. package/templates/react-component/src/components/Input/Input.tsx +41 -0
  249. package/templates/react-component/src/test-utils.tsx +23 -0
  250. package/templates/react-component/support/actions/fillInputField/web.action.ts +9 -0
  251. package/templates/react-component/support/steps/verifyButtonState/web.step.ts +12 -0
  252. package/templates/react-component/tsconfig.json +8 -0
  253. package/bin/testspectra-runner +0 -0
  254. package/demo-app/assets/index-DPfv5_EF.js +0 -116
  255. package/demo-app/assets/index-gIwu2EMV.css +0 -1
  256. package/dist/commands/__tests__/cloud-run.test.js +0 -93
  257. package/dist/commands/cloud-run.d.ts +0 -13
  258. package/dist/commands/cloud-run.js +0 -120
  259. package/templates/default/specs/ContentMatchers/TC-0005-text-and-values/mobile.test.ts +0 -17
  260. package/templates/default/specs/ContentMatchers/TC-0005-text-and-values/web.test.ts +0 -17
  261. /package/dist/{commands/__tests__/cloud-run.test.d.ts → linter/__tests__/anonymous-export.test.d.ts} +0 -0
@@ -1,10 +1,10 @@
1
- # CLAUDE.md - TestSpectra Framework Conventions
2
-
3
- ## Commands
4
- - Run all Web tests: `pnpm spectra run -t web`
5
- - Run specific spec: `pnpm spectra run "packages/playground/e2e/specs/Playground/TC-0001-form-controls/web.test.ts" -t web`
6
- - Run Nx monorepo E2E targets: `pnpm nx run-many -t e2e`
7
- - Run Mobile tests: `pnpm spectra run --target android` or `pnpm spectra run --target ios`
8
- - Type checking: `pnpm type-check` (or `tsc -b`)
9
- - Preflight doctor: `pnpm spectra doctor`
10
- - List devices: `pnpm spectra devices`
1
+ # CLAUDE.md - TestSpectra Framework Conventions
2
+
3
+ ## Commands
4
+ - Run all Web tests: `pnpm spectra run -t web`
5
+ - Run specific spec: `pnpm spectra run "packages/playground/e2e/specs/Playground/TC-0001-form-controls/web.test.ts" -t web`
6
+ - Run Nx monorepo E2E targets: `pnpm nx run-many -t e2e`
7
+ - Run Mobile tests: `pnpm spectra run --target android` or `pnpm spectra run --target ios`
8
+ - Type checking: `pnpm type-check` (or `tsc -b`)
9
+ - Preflight doctor: `pnpm spectra doctor`
10
+ - List devices: `pnpm spectra devices`
@@ -12,8 +12,8 @@
12
12
  "postinstall": "spectra sync-types"
13
13
  },
14
14
  "devDependencies": {
15
- "@testspectra/cli": "link:../..",
16
- "@testspectra/matchers": "link:../../../tools/matchers",
15
+ "@testspectra/cli": "^1.1.8-rc.2",
16
+ "@testspectra/matchers": "^1.1.8-rc.2",
17
17
  "@types/node": "^20.14.0",
18
18
  "@wdio/cli": "^9.2.8",
19
19
  "@wdio/local-runner": "^9.2.8",
@@ -25,4 +25,4 @@
25
25
  "typescript": "^5.4.5",
26
26
  "webdriverio": "^9.2.8"
27
27
  }
28
- }
28
+ }
@@ -1,3 +1,27 @@
1
- it("should handle GET API state on Mobile", async () => {
2
- await MatchersPage.open("api-fetch");
3
- });
1
+ it("Mock and assert GET API requests using browser.intercept", async () => {
2
+ // Navigate to API Fetch section
3
+ await MatchersPage.open("api-fetch");
4
+
5
+ // Setup API interception with Fixture data
6
+ const mock = await Spectra.intercept(
7
+ "/api/posts",
8
+ "GET",
9
+ Fixture.apiData.mockPosts
10
+ );
11
+
12
+ // Trigger fetch button in mobile demo app
13
+ await MatchersPage.fetchApiButton.click();
14
+
15
+ // Assert status and mocked elements
16
+ await MatchersPage.fetchStatusBadge.shouldHaveText("200 OK");
17
+ await MatchersPage.fetchedItems.shouldHaveLength(Fixture.apiData.mockPosts.length);
18
+ await MatchersPage.fetchedItems.first().shouldContainText(Fixture.apiData.mockPosts[0].title);
19
+
20
+ // Dynamically update fixture response
21
+ await mock.respondWith([
22
+ { id: 99, title: "Dynamic Updated Mock Title", body: "Updated on the fly" }
23
+ ]);
24
+ await MatchersPage.fetchApiButton.click();
25
+ await MatchersPage.fetchedItems.shouldHaveLength(1);
26
+ await MatchersPage.fetchedItems.first().shouldContainText("Dynamic Updated Mock Title");
27
+ });
@@ -1,27 +1,27 @@
1
- it("should mock GET API response using browser.intercept and verify rendered items", async () => {
2
- // Navigate to API Fetch section
3
- await MatchersPage.open("api-fetch");
4
-
5
- // Setup API interception with Fixture data
6
- const mock = await browser.intercept(
7
- "/api/posts",
8
- "GET",
9
- Fixture.apiData.mockPosts
10
- );
11
-
12
- // Trigger fetch button
13
- await MatchersPage.fetchApiButton.click();
14
-
15
- // Assert status and mocked elements
16
- await MatchersPage.fetchStatusBadge.shouldHaveText("200 OK");
17
- await MatchersPage.fetchedItems.shouldHaveLength(Fixture.apiData.mockPosts.length);
18
- await MatchersPage.fetchedItems.first().shouldContainText(Fixture.apiData.mockPosts[0].title);
19
-
20
- // Dynamically update fixture response
21
- await mock.respondWith([
22
- { id: 99, title: "Dynamic Updated Mock Title", body: "Updated on the fly" }
23
- ]);
24
- await MatchersPage.fetchApiButton.click();
25
- await MatchersPage.fetchedItems.shouldHaveLength(1);
26
- await MatchersPage.fetchedItems.first().shouldContainText("Dynamic Updated Mock Title");
27
- });
1
+ it("Mock and assert GET API requests using browser.intercept", async () => {
2
+ // Navigate to API Fetch section
3
+ await MatchersPage.open("api-fetch");
4
+
5
+ // Setup API interception with Fixture data
6
+ const mock = await Spectra.intercept(
7
+ "/api/posts",
8
+ "GET",
9
+ Fixture.apiData.mockPosts
10
+ );
11
+
12
+ // Trigger fetch button
13
+ await MatchersPage.fetchApiButton.click();
14
+
15
+ // Assert status and mocked elements
16
+ await MatchersPage.fetchStatusBadge.shouldHaveText("200 OK");
17
+ await MatchersPage.fetchedItems.shouldHaveLength(Fixture.apiData.mockPosts.length);
18
+ await MatchersPage.fetchedItems.first().shouldContainText(Fixture.apiData.mockPosts[0].title);
19
+
20
+ // Dynamically update fixture response
21
+ await mock.respondWith([
22
+ { id: 99, title: "Dynamic Updated Mock Title", body: "Updated on the fly" }
23
+ ]);
24
+ await MatchersPage.fetchApiButton.click();
25
+ await MatchersPage.fetchedItems.shouldHaveLength(1);
26
+ await MatchersPage.fetchedItems.first().shouldContainText("Dynamic Updated Mock Title");
27
+ });
@@ -1,3 +1,24 @@
1
- it("should handle POST API state on Mobile", async () => {
2
- await MatchersPage.open("api-post");
3
- });
1
+ it("Mock and assert POST API requests using browser.intercept", async () => {
2
+ // Navigate to API POST section
3
+ await MatchersPage.open("api-post");
4
+
5
+ // Setup POST API interception with status 201
6
+ await Spectra.intercept(
7
+ "/api/posts",
8
+ "POST",
9
+ Fixture.apiData.mockPostResponse,
10
+ { statusCode: 201 }
11
+ );
12
+
13
+ // Fill in form fields from Fixture
14
+ await MatchersPage.postTitleInput.type(Fixture.apiData.mockNewPost.title);
15
+ await MatchersPage.postBodyInput.type(Fixture.apiData.mockNewPost.body);
16
+
17
+ // Submit POST form
18
+ await MatchersPage.submitPostButton.click();
19
+
20
+ // Assert response elements and status
21
+ await MatchersPage.postStatusBadge.shouldHaveText("201 Created");
22
+ await MatchersPage.postSuccessBanner.shouldBeVisible();
23
+ await MatchersPage.postResponseJson.shouldContainText(Fixture.apiData.mockNewPost.title);
24
+ });
@@ -1,24 +1,24 @@
1
- it("should mock POST API submission using browser.intercept and verify created response", async () => {
2
- // Navigate to API POST section
3
- await MatchersPage.open("api-post");
4
-
5
- // Setup POST API interception with status 201
6
- await browser.intercept(
7
- "/api/posts",
8
- "POST",
9
- Fixture.apiData.mockPostResponse,
10
- { statusCode: 201 }
11
- );
12
-
13
- // Fill in form fields from Fixture
14
- await MatchersPage.postTitleInput.type(Fixture.apiData.mockNewPost.title);
15
- await MatchersPage.postBodyInput.type(Fixture.apiData.mockNewPost.body);
16
-
17
- // Submit POST form
18
- await MatchersPage.submitPostButton.click();
19
-
20
- // Assert response elements and status
21
- await MatchersPage.postStatusBadge.shouldHaveText("201 Created");
22
- await MatchersPage.postSuccessBanner.shouldBeVisible();
23
- await MatchersPage.postResponseJson.shouldContainText(Fixture.apiData.mockNewPost.title);
24
- });
1
+ it("Mock and assert POST API requests using browser.intercept", async () => {
2
+ // Navigate to API POST section
3
+ await MatchersPage.open("api-post");
4
+
5
+ // Setup POST API interception with status 201
6
+ await Spectra.intercept(
7
+ "/api/posts",
8
+ "POST",
9
+ Fixture.apiData.mockPostResponse,
10
+ { statusCode: 201 }
11
+ );
12
+
13
+ // Fill in form fields from Fixture
14
+ await MatchersPage.postTitleInput.type(Fixture.apiData.mockNewPost.title);
15
+ await MatchersPage.postBodyInput.type(Fixture.apiData.mockNewPost.body);
16
+
17
+ // Submit POST form
18
+ await MatchersPage.submitPostButton.click();
19
+
20
+ // Assert response elements and status
21
+ await MatchersPage.postStatusBadge.shouldHaveText("201 Created");
22
+ await MatchersPage.postSuccessBanner.shouldBeVisible();
23
+ await MatchersPage.postResponseJson.shouldContainText(Fixture.apiData.mockNewPost.title);
24
+ });
@@ -1,3 +1,3 @@
1
- it("should verify title on Mobile", async () => {
2
- await MatchersPage.open();
3
- });
1
+ it("Verify page title and sidebar navigation links", async () => {
2
+ await MatchersPage.open();
3
+ });
@@ -1,19 +1,19 @@
1
- it("should verify browser page title, URL, diagnostics, and navigation on Web", async () => {
2
- await MatchersPage.open();
3
-
4
- // Browser title assertions
5
- await Spectra.browser.shouldHaveTitle("TestSpectra — Matchers API Reference");
6
- await Spectra.browser.shouldContainTitle("TestSpectra");
7
-
8
- // Browser URL assertions
9
- const currentUrl = await browser.getUrl();
10
- await Spectra.browser.shouldHaveUrl(currentUrl);
11
- await Spectra.browser.shouldContainUrl("localhost:5173");
12
-
13
- // Page lifecycle and console error diagnostics
14
- await Spectra.browser.shouldBeLoaded();
15
- await Spectra.browser.shouldHaveNoConsoleErrors();
16
-
17
- // Navigation sidebar collection verification
18
- await NavigationPage.sidebarLinks.shouldHaveLengthGreaterThan(0);
19
- });
1
+ it("Verify page title and sidebar navigation links", async () => {
2
+ await MatchersPage.open();
3
+
4
+ // Browser title assertions
5
+ await Spectra.browser.shouldHaveTitle("TestSpectra — Matchers API Reference");
6
+ await Spectra.browser.shouldContainTitle("TestSpectra");
7
+
8
+ // Browser URL assertions
9
+ const currentUrl = await browser.getUrl();
10
+ await Spectra.browser.shouldHaveUrl(currentUrl);
11
+ await Spectra.browser.shouldContainUrl("localhost:5173");
12
+
13
+ // Page lifecycle and console error diagnostics
14
+ await Spectra.browser.shouldBeLoaded();
15
+ await Spectra.browser.shouldHaveNoConsoleErrors();
16
+
17
+ // Navigation sidebar collection verification
18
+ await NavigationPage.sidebarLinks.shouldHaveLengthGreaterThan(0);
19
+ });
@@ -1,3 +1,3 @@
1
- it("should verify text on Mobile", async () => {
2
- await MatchersPage.open("text");
3
- });
1
+ it("Verify exact text, substring text, and input values", async () => {
2
+ await MatchersPage.open("text");
3
+ });
@@ -1,17 +1,17 @@
1
- it("should verify text and value matchers on Web", async () => {
2
- await MatchersPage.open("text");
3
-
4
- // Text assertions (positive and negative)
5
- await MatchersPage.exactText.shouldHaveText(Fixture.playgroundData.welcomeText);
6
- await MatchersPage.exactText.shouldNotHaveText("Unexpected Text");
7
-
8
- await MatchersPage.partialText.shouldContainText("Welcome");
9
- await MatchersPage.partialText.shouldNotContainText("Goodbye");
10
-
11
- // Value assertions (positive and negative)
12
- await MatchersPage.emailInput.shouldHaveValue(Fixture.playgroundData.defaultEmail);
13
- await MatchersPage.emailInput.shouldNotHaveValue("wrong.user@testspectra.dev");
14
-
15
- await MatchersPage.tokenInput.shouldContainValue("JWT_");
16
- await MatchersPage.tokenInput.shouldNotContainValue("EXPIRED_SESSION");
17
- });
1
+ it("Verify exact text, substring text, and input values", async () => {
2
+ await MatchersPage.open("text");
3
+
4
+ // Text assertions (positive and negative)
5
+ await MatchersPage.exactText.shouldHaveText(Fixture.playgroundData.welcomeText);
6
+ await MatchersPage.exactText.shouldNotHaveText("Unexpected Text");
7
+
8
+ await MatchersPage.partialText.shouldContainText("Welcome");
9
+ await MatchersPage.partialText.shouldNotContainText("Goodbye");
10
+
11
+ // Value assertions (positive and negative)
12
+ await MatchersPage.emailInput.shouldHaveValue(Fixture.playgroundData.defaultEmail);
13
+ await MatchersPage.emailInput.shouldNotHaveValue("wrong.user@testspectra.dev");
14
+
15
+ await MatchersPage.tokenInput.shouldContainValue("JWT_");
16
+ await MatchersPage.tokenInput.shouldNotContainValue("EXPIRED_SESSION");
17
+ });
@@ -1,3 +1,3 @@
1
- it("should verify collection length on Mobile", async () => {
2
- await MatchersPage.open("length");
3
- });
1
+ it("Verify collection lengths, counts, and empty lists", async () => {
2
+ await MatchersPage.open("length");
3
+ });
@@ -1,11 +1,11 @@
1
- it("should verify collection lengths and empty lists on Web", async () => {
2
- await MatchersPage.open("length");
3
-
4
- // Receiver assertion methods
5
- await MatchersPage.productCards.shouldHaveLength(4);
6
- await MatchersPage.productCards.shouldNotHaveLength(0);
7
- await MatchersPage.productCards.shouldHaveLengthGreaterThan(0);
8
- await MatchersPage.productCards.shouldHaveLengthLessThan(10);
9
- await MatchersPage.emptyList.shouldBeEmpty();
10
- await MatchersPage.productCards.shouldNotBeEmpty();
11
- });
1
+ it("Verify collection lengths, counts, and empty lists", async () => {
2
+ await MatchersPage.open("length");
3
+
4
+ // Receiver assertion methods
5
+ await MatchersPage.productCards.shouldHaveLength(4);
6
+ await MatchersPage.productCards.shouldNotHaveLength(0);
7
+ await MatchersPage.productCards.shouldHaveLengthGreaterThan(0);
8
+ await MatchersPage.productCards.shouldHaveLengthLessThan(10);
9
+ await MatchersPage.emptyList.shouldBeEmpty();
10
+ await MatchersPage.productCards.shouldNotBeEmpty();
11
+ });
@@ -1,3 +1,3 @@
1
- it("should verify visibility on Mobile", async () => {
2
- await MatchersPage.open("visibility");
3
- });
1
+ it("Verify element visibility and existence matchers", async () => {
2
+ await MatchersPage.open("visibility");
3
+ });
@@ -1,11 +1,11 @@
1
- it("should verify visibility and DOM existence matchers on Web", async () => {
2
- await MatchersPage.open("visibility");
3
-
4
- // Element visibility (positive and negative)
5
- await MatchersPage.visibleElement.shouldBeVisible();
6
- await MatchersPage.hiddenElement.shouldNotBeVisible();
7
-
8
- // DOM existence (positive and negative)
9
- await MatchersPage.existingElement.shouldExist();
10
- await Spectra.get("#demo-non-existent-el").shouldNotExist();
11
- });
1
+ it("Verify element visibility and existence matchers", async () => {
2
+ await MatchersPage.open("visibility");
3
+
4
+ // Element visibility (positive and negative)
5
+ await MatchersPage.visibleElement.shouldBeVisible();
6
+ await MatchersPage.hiddenElement.shouldNotBeVisible();
7
+
8
+ // DOM existence (positive and negative)
9
+ await MatchersPage.existingElement.shouldExist();
10
+ await Spectra.get("#demo-non-existent-el").shouldNotExist();
11
+ });
@@ -1,3 +1,3 @@
1
- it("should verify button state on Mobile", async () => {
2
- await MatchersPage.open("state");
3
- });
1
+ it("Verify button state, checkbox, radio and attributes", async () => {
2
+ await MatchersPage.open("state");
3
+ });
@@ -1,29 +1,29 @@
1
- it("should verify interactivity states, classes, attributes, and CSS styling on Web", async () => {
2
- await MatchersPage.open("state");
3
-
4
- // Interactivity & state assertions
5
- await MatchersPage.submitButton.shouldBeEnabled();
6
- await MatchersPage.submitButton.shouldBeClickable();
7
-
8
- await MatchersPage.disabledButton.shouldBeDisabled();
9
- await MatchersPage.disabledButton.shouldNotBeClickable();
10
-
11
- // Checked states
12
- await MatchersPage.checkbox.shouldNotBeChecked();
13
- await MatchersPage.radio.shouldBeChecked();
14
-
15
- // Focus states
16
- await MatchersPage.focusInput.shouldNotBeFocused();
17
- await MatchersPage.focusInput.click();
18
- await MatchersPage.focusInput.shouldBeFocused();
19
-
20
- // Class, Attribute, and CSS assertions
21
- await MatchersPage.activeTab.shouldHaveClass("is-active");
22
- await MatchersPage.activeTab.shouldNotHaveClass("is-hidden");
23
-
24
- await MatchersPage.navLink.shouldHaveAttribute("href", Fixture.playgroundData.dashboardHref);
25
- await MatchersPage.navLink.shouldNotHaveAttribute("disabled");
26
-
27
- await MatchersPage.styledElement.shouldHaveCss("color", "rgba(239,68,68,1)");
28
- await MatchersPage.styledElement.shouldNotHaveCss("color", "rgba(0,0,255,1)");
29
- });
1
+ it("Verify button state, checkbox, radio and attributes", async () => {
2
+ await MatchersPage.open("state");
3
+
4
+ // Interactivity & state assertions
5
+ await MatchersPage.submitButton.shouldBeEnabled();
6
+ await MatchersPage.submitButton.shouldBeClickable();
7
+
8
+ await MatchersPage.disabledButton.shouldBeDisabled();
9
+ await MatchersPage.disabledButton.shouldNotBeClickable();
10
+
11
+ // Checked states
12
+ await MatchersPage.checkbox.shouldNotBeChecked();
13
+ await MatchersPage.radio.shouldBeChecked();
14
+
15
+ // Focus states
16
+ await MatchersPage.focusInput.shouldNotBeFocused();
17
+ await MatchersPage.focusInput.click();
18
+ await MatchersPage.focusInput.shouldBeFocused();
19
+
20
+ // Class, Attribute, and CSS assertions
21
+ await MatchersPage.activeTab.shouldHaveClass("is-active");
22
+ await MatchersPage.activeTab.shouldNotHaveClass("is-hidden");
23
+
24
+ await MatchersPage.navLink.shouldHaveAttribute("href", Fixture.playgroundData.dashboardHref);
25
+ await MatchersPage.navLink.shouldNotHaveAttribute("disabled");
26
+
27
+ await MatchersPage.styledElement.shouldHaveCss("color", "rgba(239,68,68,1)");
28
+ await MatchersPage.styledElement.shouldNotHaveCss("color", "rgba(0,0,255,1)");
29
+ });
@@ -0,0 +1,5 @@
1
+ it("Verify a custom environmentVariables entry is readable via Spectra.env", async () => {
2
+ if (Spectra.env.DEMO_API_MODE !== "sandbox") {
3
+ throw new Error(`Expected Spectra.env.DEMO_API_MODE to be "sandbox", got "${Spectra.env.DEMO_API_MODE}"`);
4
+ }
5
+ });
@@ -0,0 +1,16 @@
1
+ ---
2
+ id: TC-0019-read-custom-environment-variable
3
+ title: Verify a custom environmentVariables entry is readable via Spectra.env
4
+ priority: Medium
5
+ caseType: Positive
6
+ status: ready-for-automation
7
+ coverage:
8
+ web: automated
9
+ mobile: automated
10
+ ---
11
+
12
+ # Verify a custom environmentVariables entry is readable via Spectra.env
13
+
14
+ ## Test Steps
15
+ 1. Read the DEMO_API_MODE variable via the typed Spectra.env
16
+ 2. Assert it matches the value configured in spectra.config.ts's executionConfig.environmentVariables
@@ -0,0 +1,9 @@
1
+ ---
2
+ id: suite-environment-config
3
+ name: EnvironmentConfig
4
+ description: Reading custom executionConfig.environmentVariables values via Spectra.env
5
+ executionOrder: 2.3
6
+ parallel: true
7
+ ---
8
+
9
+ # Suite: EnvironmentConfig
@@ -1,3 +1,3 @@
1
- it("should verify playground states (Mobile)", async () => {
2
- await Step.verifyPlaygroundState();
3
- });
1
+ it("Verify playground form inputs and default states", async () => {
2
+ await Step.verifyPlaygroundState();
3
+ });
@@ -1,6 +1,6 @@
1
- it("should verify live playground form inputs and default states (Web)", async () => {
2
- await Step.verifyPlaygroundState();
3
- await PlaygroundPage.emailInput.shouldHaveValue(Fixture.playgroundData.defaultEmail);
4
- await PlaygroundPage.tokenInput.shouldContainValue("JWT_");
5
- await PlaygroundPage.exactText.shouldHaveText(Fixture.playgroundData.welcomeText);
6
- });
1
+ it("Verify playground form inputs and default states", async () => {
2
+ await Step.verifyPlaygroundState();
3
+ await PlaygroundPage.emailInput.shouldHaveValue(Fixture.playgroundData.defaultEmail);
4
+ await PlaygroundPage.tokenInput.shouldContainValue("JWT_");
5
+ await PlaygroundPage.exactText.shouldHaveText(Fixture.playgroundData.welcomeText);
6
+ });
@@ -1,3 +1,3 @@
1
- it("should fill credentials (Mobile)", async () => {
2
- await PlaygroundPage.open();
3
- });
1
+ it("Verify typing credentials and updating playground inputs", async () => {
2
+ await PlaygroundPage.open();
3
+ });
@@ -1,6 +1,6 @@
1
- it("should update input values and verify updated state (Web)", async () => {
2
- await PlaygroundPage.open();
3
- await PlaygroundPage.fillCredentials("qa.expert@testspectra.dev", "JWT_custom_session_token");
4
- await PlaygroundPage.emailInput.shouldHaveValue("qa.expert@testspectra.dev");
5
- await PlaygroundPage.tokenInput.shouldContainValue("JWT_custom_session_token");
6
- });
1
+ it("Verify typing credentials and updating playground inputs", async () => {
2
+ await PlaygroundPage.open();
3
+ await PlaygroundPage.fillCredentials("qa.expert@testspectra.dev", "JWT_custom_session_token");
4
+ await PlaygroundPage.emailInput.shouldHaveValue("qa.expert@testspectra.dev");
5
+ await PlaygroundPage.tokenInput.shouldContainValue("JWT_custom_session_token");
6
+ });