@testspectra/cli 1.1.0-rc.0 → 1.1.0-rc.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 (105) hide show
  1. package/bin/.testspectra-runner.hash +1 -0
  2. package/bin/testspectra-runner +0 -0
  3. package/demo-app/assets/index-DOtRypCa.js +154 -0
  4. package/demo-app/index.html +1 -1
  5. package/dist/.tsbuildinfo +1 -1
  6. package/dist/commands/__tests__/run.test.js +9 -13
  7. package/dist/commands/init.d.ts +1 -1
  8. package/dist/commands/init.js +6 -1
  9. package/dist/commands/run.js +1 -0
  10. package/dist/commands/sync-types.js +1 -0
  11. package/dist/commands/test.d.ts +17 -0
  12. package/dist/commands/test.js +76 -0
  13. package/dist/commands/watch.js +9 -2
  14. package/dist/config/loader.js +1 -1
  15. package/dist/config/schema.d.ts +5 -109
  16. package/dist/config/schema.js +1 -16
  17. package/dist/generator/__tests__/tsconfig-isolation.test.js +6 -2
  18. package/dist/generator/tsconfig-generator.js +42 -7
  19. package/dist/generator/type-generator.d.ts +24 -1
  20. package/dist/generator/type-generator.js +104 -8
  21. package/dist/index.js +15 -1
  22. package/dist/linter/__tests__/component-test-imports.test.d.ts +1 -0
  23. package/dist/linter/__tests__/component-test-imports.test.js +115 -0
  24. package/dist/linter/extractor.d.ts +1 -0
  25. package/dist/linter/extractor.js +11 -1
  26. package/dist/linter/schemas/spec.schema.d.ts +12 -12
  27. package/dist/linter/schemas/suite.schema.d.ts +8 -8
  28. package/dist/linter/spec-linter.js +38 -3
  29. package/dist/reporter/semantic-formatter.js +17 -2
  30. package/dist/reporter/types.d.ts +1 -1
  31. package/dist/runner/reporter.js +7 -3
  32. package/dist/utils/api-server.js +46 -1
  33. package/package.json +4 -3
  34. package/templates/default/package.json +2 -2
  35. package/templates/default/page-objects/AuthPage/mobile.ts +5 -0
  36. package/templates/default/page-objects/AuthPage/web.ts +10 -0
  37. package/templates/default/page-objects/MatchersPage/mobile.ts +13 -0
  38. package/templates/default/page-objects/MatchersPage/web.ts +5 -0
  39. package/templates/default/page-objects/PlaygroundPage/mobile.ts +6 -0
  40. package/templates/default/specs/ApiInterception/TC-0012-direct-and-late-response/common.test.ts +6 -9
  41. package/templates/default/specs/Authentication/TC-0021-seed-authenticated-session/mobile.test.ts +7 -0
  42. package/templates/default/specs/Authentication/TC-0021-seed-authenticated-session/spec.md +19 -0
  43. package/templates/default/specs/Authentication/TC-0021-seed-authenticated-session/web.test.ts +9 -0
  44. package/templates/default/specs/Authentication/suite.md +9 -0
  45. package/templates/default/specs/BrowserContext/TC-0022-history-navigation/mobile.test.ts +17 -0
  46. package/templates/default/specs/BrowserContext/TC-0022-history-navigation/spec.md +28 -0
  47. package/templates/default/specs/BrowserContext/TC-0022-history-navigation/web.test.ts +26 -0
  48. package/templates/default/specs/ContentMatchers/TC-0020-scoped-element-access/common.test.ts +14 -0
  49. package/templates/default/specs/ContentMatchers/TC-0020-scoped-element-access/spec.md +21 -0
  50. package/templates/default/specs/EnvironmentConfig/TC-0019-read-custom-environment-variable/common.test.ts +5 -0
  51. package/templates/default/specs/EnvironmentConfig/TC-0019-read-custom-environment-variable/spec.md +16 -0
  52. package/templates/default/specs/EnvironmentConfig/suite.md +9 -0
  53. package/templates/default/spectra.config.ts +1 -16
  54. package/templates/default/support/actions/seedSession/mobile.action.ts +9 -0
  55. package/templates/default/support/actions/seedSession/web.action.ts +13 -0
  56. package/templates/nx/.nx/workspace-data/70094CFD-E89B-57A1-9619-2FC5F4963C54.db-shm +0 -0
  57. package/templates/nx/.nx/workspace-data/70094CFD-E89B-57A1-9619-2FC5F4963C54.db-wal +0 -0
  58. package/templates/nx/.nx/workspace-data/d/daemon.log +1060 -0
  59. package/templates/nx/.nx/workspace-data/d/server-process.json +1 -1
  60. package/templates/nx/.nx/workspace-data/file-map.json +116 -104
  61. package/templates/nx/.nx/workspace-data/nx_files.nxt +0 -0
  62. package/templates/nx/package.json +2 -2
  63. package/templates/nx/packages/matchers/e2e/specs/EnvironmentConfig/TC-0019-read-custom-environment-variable/common.test.ts +5 -0
  64. package/templates/nx/packages/matchers/e2e/specs/EnvironmentConfig/TC-0019-read-custom-environment-variable/spec.md +16 -0
  65. package/templates/nx/packages/matchers/e2e/specs/EnvironmentConfig/suite.md +9 -0
  66. package/templates/nx/spectra.config.ts +1 -16
  67. package/templates/react-component/.cursorrules +17 -0
  68. package/templates/react-component/.vscode/extensions.json +5 -0
  69. package/templates/react-component/CLAUDE.md +14 -0
  70. package/templates/react-component/README.md +69 -0
  71. package/templates/react-component/fixtures/component-mock.json +12 -0
  72. package/templates/react-component/global-hooks/after/web.hook.ts +3 -0
  73. package/templates/react-component/global-hooks/before/web.hook.ts +3 -0
  74. package/templates/react-component/package.json +27 -0
  75. package/templates/react-component/page-objects/BadgeComponent/web.ts +23 -0
  76. package/templates/react-component/page-objects/ButtonComponent/web.ts +23 -0
  77. package/templates/react-component/page-objects/InputComponent/web.ts +13 -0
  78. package/templates/react-component/specs/BadgeComponent/TC-0002-badge-severities-and-dot/spec.md +18 -0
  79. package/templates/react-component/specs/BadgeComponent/TC-0002-badge-severities-and-dot/web.test.tsx +11 -0
  80. package/templates/react-component/specs/BadgeComponent/TC-0006-badge-success-with-dot/spec.md +18 -0
  81. package/templates/react-component/specs/BadgeComponent/TC-0006-badge-success-with-dot/web.test.tsx +10 -0
  82. package/templates/react-component/specs/BadgeComponent/TC-0007-badge-by-severity-lookup/spec.md +18 -0
  83. package/templates/react-component/specs/BadgeComponent/TC-0007-badge-by-severity-lookup/web.test.tsx +16 -0
  84. package/templates/react-component/specs/BadgeComponent/suite.md +12 -0
  85. package/templates/react-component/specs/ButtonComponent/TC-0001-button-rendering-and-click/spec.md +19 -0
  86. package/templates/react-component/specs/ButtonComponent/TC-0001-button-rendering-and-click/web.test.tsx +28 -0
  87. package/templates/react-component/specs/ButtonComponent/TC-0004-disabled-button-not-clickable/spec.md +19 -0
  88. package/templates/react-component/specs/ButtonComponent/TC-0004-disabled-button-not-clickable/web.test.tsx +22 -0
  89. package/templates/react-component/specs/ButtonComponent/TC-0005-button-renders-icon/spec.md +18 -0
  90. package/templates/react-component/specs/ButtonComponent/TC-0005-button-renders-icon/web.test.tsx +8 -0
  91. package/templates/react-component/specs/ButtonComponent/suite.md +12 -0
  92. package/templates/react-component/specs/InputComponent/TC-0003-input-typing-and-clear/spec.md +20 -0
  93. package/templates/react-component/specs/InputComponent/TC-0003-input-typing-and-clear/web.test.tsx +28 -0
  94. package/templates/react-component/specs/InputComponent/TC-0008-disabled-input-not-editable/spec.md +18 -0
  95. package/templates/react-component/specs/InputComponent/TC-0008-disabled-input-not-editable/web.test.tsx +9 -0
  96. package/templates/react-component/specs/InputComponent/suite.md +12 -0
  97. package/templates/react-component/spectra.config.ts +27 -0
  98. package/templates/react-component/src/components/Badge/Badge.tsx +60 -0
  99. package/templates/react-component/src/components/Button/Button.tsx +57 -0
  100. package/templates/react-component/src/components/Input/Input.tsx +41 -0
  101. package/templates/react-component/src/test-utils.tsx +23 -0
  102. package/templates/react-component/support/actions/fillInputField/web.action.ts +9 -0
  103. package/templates/react-component/support/steps/verifyButtonState/web.step.ts +12 -0
  104. package/templates/react-component/tsconfig.json +8 -0
  105. package/demo-app/assets/index-BGllUp7o.js +0 -140
@@ -0,0 +1,9 @@
1
+ export default async function (this: any) {
2
+ // Android has no cookie jar to write into — the deep link asks the app to log itself in
3
+ // (a known, sanctioned test account, server-side) and persist the result through its own
4
+ // secure storage (e.g. react-native-keychain), the same way a real login would. See
5
+ // docs/v2/features/authentication-and-session-seeding.md for why this doesn't accept an
6
+ // externally-supplied session value the way the web action does.
7
+ await this.navigate("testspectra-demo://seed-session");
8
+ await this.get("~auth-status-badge").waitForElement(10000);
9
+ }
@@ -0,0 +1,13 @@
1
+ export default async function (this: any) {
2
+ // Host-side (Bun) fetch — not the browser's — so there's no CORS/credentials restriction on
3
+ // reading the raw Set-Cookie header, HttpOnly included.
4
+ const res = await fetch("http://localhost:5200/api/login", {
5
+ method: "POST",
6
+ headers: { "content-type": "application/json" },
7
+ body: JSON.stringify({ email: "demo@testspectra.dev", password: "demo-password" }),
8
+ });
9
+ if (!res.ok) {
10
+ throw new Error(`seedSession: login failed (${res.status})`);
11
+ }
12
+ await this.browser.setCookies(res.headers.getSetCookie(), res.url);
13
+ }