@testspectra/cli 1.1.8-rc.3 → 1.1.8-rc.31
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.
- package/README.md +50 -0
- package/bin/spectra.js +0 -0
- package/dist/.tsbuildinfo +1 -1
- package/dist/commands/__tests__/doctor-filter.test.d.ts +1 -0
- package/dist/commands/__tests__/doctor-filter.test.js +37 -0
- package/dist/commands/__tests__/run-e2e.test.js +49 -49
- package/dist/commands/__tests__/test-error-streaming.test.d.ts +1 -0
- package/dist/commands/__tests__/test-error-streaming.test.js +85 -0
- package/dist/commands/__tests__/test-scaffolding.test.d.ts +1 -0
- package/dist/commands/__tests__/test-scaffolding.test.js +32 -0
- package/dist/commands/__tests__/upgrade.test.d.ts +1 -0
- package/dist/commands/__tests__/upgrade.test.js +95 -0
- package/dist/commands/add.js +5 -4
- package/dist/commands/devices.js +1 -0
- package/dist/commands/docs.d.ts +4 -0
- package/dist/commands/docs.js +17 -0
- package/dist/commands/doctor.d.ts +9 -1
- package/dist/commands/doctor.js +17 -3
- package/dist/commands/init.js +7 -160
- package/dist/commands/install.js +5 -0
- package/dist/commands/license.js +1 -0
- package/dist/commands/run.d.ts +2 -0
- package/dist/commands/run.js +22 -0
- package/dist/commands/test.d.ts +13 -0
- package/dist/commands/test.js +115 -21
- package/dist/commands/upgrade.d.ts +12 -0
- package/dist/commands/upgrade.js +197 -0
- package/dist/config/schema.d.ts +53 -0
- package/dist/config/schema.js +2 -0
- package/dist/generator/__tests__/tsconfig-isolation.test.js +2 -1
- package/dist/generator/__tests__/type-generator.test.js +38 -0
- package/dist/generator/architecture-doc-generator.d.ts +14 -0
- package/dist/generator/architecture-doc-generator.js +80 -0
- package/dist/generator/index.d.ts +1 -0
- package/dist/generator/index.js +1 -0
- package/dist/generator/tsconfig-generator.js +1 -1
- package/dist/generator/type-generator.d.ts +5 -2
- package/dist/generator/type-generator.js +14 -17
- package/dist/index.js +56 -26
- package/dist/linter/__tests__/component-test-imports.test.js +51 -51
- package/dist/linter/__tests__/shared-lib-boundary.test.js +15 -15
- package/dist/linter/__tests__/spec-schema.test.js +167 -167
- package/dist/linter/discovery.d.ts +3 -3
- package/dist/linter/discovery.js +7 -7
- package/dist/linter/schemas/spec.schema.d.ts +8 -8
- package/dist/linter/schemas/suite.schema.d.ts +4 -4
- package/dist/runner/bridge.d.ts +1 -1
- package/dist/runner/bridge.js +101 -11
- package/dist/runner/reporter.d.ts +1 -0
- package/dist/runner/reporter.js +12 -6
- package/dist/utils/__tests__/dev-server-manager.test.d.ts +1 -0
- package/dist/utils/__tests__/dev-server-manager.test.js +72 -0
- package/dist/utils/background-update-check.d.ts +1 -0
- package/dist/utils/background-update-check.js +43 -0
- package/dist/utils/dependency-updates.d.ts +15 -0
- package/dist/utils/dependency-updates.js +107 -0
- package/dist/utils/dev-server-manager.d.ts +40 -0
- package/dist/utils/dev-server-manager.js +257 -0
- package/dist/utils/update-notifier.d.ts +2 -0
- package/dist/utils/update-notifier.js +67 -0
- package/package.json +36 -30
- package/templates/default/CLAUDE.md +16 -16
- package/templates/default/global-hooks/after/mobile.hook.ts +3 -3
- package/templates/default/global-hooks/after/web.hook.ts +3 -3
- package/templates/default/global-hooks/before/mobile.hook.ts +3 -3
- package/templates/default/global-hooks/before/web.hook.ts +3 -3
- package/templates/default/package.json +2 -2
- package/templates/default/page-objects/AuthPage/mobile.ts +5 -5
- package/templates/default/page-objects/AuthPage/web.ts +10 -10
- package/templates/default/page-objects/MatchersPage/mobile.ts +70 -70
- package/templates/default/page-objects/MatchersPage/web.ts +43 -43
- package/templates/default/page-objects/NavigationPage/mobile.ts +14 -14
- package/templates/default/page-objects/NavigationPage/web.ts +8 -8
- package/templates/default/page-objects/PlaygroundPage/mobile.ts +42 -42
- package/templates/default/page-objects/PlaygroundPage/web.ts +31 -31
- package/templates/default/specs/ApiInterception/TC-0008-fetch-mocking/mobile.test.ts +53 -53
- package/templates/default/specs/ApiInterception/TC-0008-fetch-mocking/spec.md +19 -19
- package/templates/default/specs/ApiInterception/TC-0008-fetch-mocking/web.test.ts +31 -31
- package/templates/default/specs/ApiInterception/TC-0009-post-mocking/android.test.ts +3 -3
- package/templates/default/specs/ApiInterception/TC-0009-post-mocking/common.test.ts +3 -3
- package/templates/default/specs/ApiInterception/TC-0009-post-mocking/mobile.test.ts +27 -27
- package/templates/default/specs/ApiInterception/TC-0009-post-mocking/spec.md +19 -19
- package/templates/default/specs/ApiInterception/TC-0009-post-mocking/web.test.ts +26 -26
- package/templates/default/specs/ApiInterception/TC-0012-direct-and-late-response/common.test.ts +30 -30
- package/templates/default/specs/ApiInterception/TC-0012-direct-and-late-response/spec.md +22 -22
- package/templates/default/specs/ApiInterception/TC-0013-real-network-call-recorded/common.test.ts +27 -27
- package/templates/default/specs/ApiInterception/TC-0013-real-network-call-recorded/spec.md +20 -20
- package/templates/default/specs/ApiInterception/TC-0015-mock-server-sent-events/spec.md +24 -24
- package/templates/default/specs/ApiInterception/TC-0015-mock-server-sent-events/web.test.ts +26 -26
- package/templates/default/specs/ApiInterception/TC-0016-bypass-websocket-with-app-level-mock/spec.md +37 -37
- package/templates/default/specs/ApiInterception/TC-0016-bypass-websocket-with-app-level-mock/web.test.ts +21 -21
- package/templates/default/specs/ApiInterception/TC-0017-bypass-captcha-with-test-mode-flag/spec.md +29 -29
- package/templates/default/specs/ApiInterception/TC-0017-bypass-captcha-with-test-mode-flag/web.test.ts +16 -16
- package/templates/default/specs/ApiInterception/suite.md +10 -10
- package/templates/default/specs/ApiSeeding/TC-0014-seed-and-cleanup-via-hooks/common.test.ts +30 -30
- package/templates/default/specs/ApiSeeding/TC-0014-seed-and-cleanup-via-hooks/spec.md +23 -23
- package/templates/default/specs/ApiSeeding/hooks/after/common.hook.ts +16 -16
- package/templates/default/specs/ApiSeeding/hooks/before/common.hook.ts +28 -28
- package/templates/default/specs/ApiSeeding/suite.md +9 -9
- package/templates/default/specs/Authentication/TC-0021-seed-authenticated-session/mobile.test.ts +7 -7
- package/templates/default/specs/Authentication/TC-0021-seed-authenticated-session/spec.md +19 -19
- package/templates/default/specs/Authentication/TC-0021-seed-authenticated-session/web.test.ts +9 -9
- package/templates/default/specs/Authentication/suite.md +9 -9
- package/templates/default/specs/BrowserContext/TC-0007-title-and-navigation/mobile.test.ts +9 -9
- package/templates/default/specs/BrowserContext/TC-0007-title-and-navigation/spec.md +17 -17
- package/templates/default/specs/BrowserContext/TC-0007-title-and-navigation/web.test.ts +19 -19
- package/templates/default/specs/BrowserContext/TC-0022-history-navigation/mobile.test.ts +17 -17
- package/templates/default/specs/BrowserContext/TC-0022-history-navigation/spec.md +28 -28
- package/templates/default/specs/BrowserContext/TC-0022-history-navigation/web.test.ts +26 -26
- package/templates/default/specs/ContentMatchers/TC-0005-text-and-values/common.test.ts +26 -26
- package/templates/default/specs/ContentMatchers/TC-0005-text-and-values/spec.md +19 -19
- package/templates/default/specs/ContentMatchers/TC-0006-collections-and-empty/mobile.test.ts +11 -11
- package/templates/default/specs/ContentMatchers/TC-0006-collections-and-empty/spec.md +17 -17
- package/templates/default/specs/ContentMatchers/TC-0006-collections-and-empty/web.test.ts +11 -11
- package/templates/default/specs/ContentMatchers/TC-0020-scoped-element-access/common.test.ts +14 -14
- package/templates/default/specs/ContentMatchers/TC-0020-scoped-element-access/spec.md +21 -21
- package/templates/default/specs/DeepLink/TC-0018-navigate-via-deep-link/mobile.test.ts +28 -28
- package/templates/default/specs/DeepLink/TC-0018-navigate-via-deep-link/spec.md +29 -29
- package/templates/default/specs/DeepLink/suite.md +9 -9
- package/templates/default/specs/ElementMatchers/TC-0003-visibility-and-dom/mobile.test.ts +11 -11
- package/templates/default/specs/ElementMatchers/TC-0003-visibility-and-dom/spec.md +17 -17
- package/templates/default/specs/ElementMatchers/TC-0003-visibility-and-dom/web.test.ts +11 -11
- package/templates/default/specs/ElementMatchers/TC-0004-states-and-attributes/mobile.test.ts +29 -29
- package/templates/default/specs/ElementMatchers/TC-0004-states-and-attributes/spec.md +19 -19
- package/templates/default/specs/ElementMatchers/TC-0004-states-and-attributes/web.test.ts +29 -29
- package/templates/default/specs/ElementMatchers/suite.md +10 -10
- package/templates/default/specs/EnvironmentConfig/TC-0019-read-custom-environment-variable/common.test.ts +5 -5
- package/templates/default/specs/EnvironmentConfig/TC-0019-read-custom-environment-variable/spec.md +16 -16
- package/templates/default/specs/EnvironmentConfig/suite.md +9 -9
- package/templates/default/specs/PermissionRationale/TC-0010-camera-permission-allow/mobile.test.ts +26 -26
- package/templates/default/specs/PermissionRationale/TC-0010-camera-permission-allow/spec.md +22 -22
- package/templates/default/specs/PermissionRationale/TC-0011-camera-permission-deny/mobile.test.ts +13 -13
- package/templates/default/specs/PermissionRationale/TC-0011-camera-permission-deny/spec.md +20 -20
- package/templates/default/specs/PermissionRationale/suite.md +9 -9
- package/templates/default/specs/Playground/TC-0001-form-controls/mobile.test.ts +6 -6
- package/templates/default/specs/Playground/TC-0001-form-controls/spec.md +18 -18
- package/templates/default/specs/Playground/TC-0001-form-controls/web.test.ts +6 -6
- package/templates/default/specs/Playground/TC-0002-toggle-elements/mobile.test.ts +6 -6
- package/templates/default/specs/Playground/TC-0002-toggle-elements/spec.md +18 -18
- package/templates/default/specs/Playground/TC-0002-toggle-elements/web.test.ts +6 -6
- package/templates/default/spectra.config.ts +52 -52
- package/templates/default/support/actions/fillCredentials/mobile.action.ts +4 -4
- package/templates/default/support/actions/fillCredentials/web.action.ts +4 -4
- package/templates/default/support/actions/seedSession/mobile.action.ts +9 -9
- package/templates/default/support/actions/seedSession/web.action.ts +13 -13
- package/templates/default/support/steps/togglePlaygroundStates/mobile.step.ts +5 -5
- package/templates/default/support/steps/togglePlaygroundStates/web.step.ts +5 -5
- package/templates/default/support/steps/verifyPlaygroundState/mobile.step.ts +6 -6
- package/templates/default/support/steps/verifyPlaygroundState/web.step.ts +6 -6
- package/templates/docs/ARCHITECTURE.default.md +26 -0
- package/templates/docs/ARCHITECTURE.nx.md +119 -0
- package/templates/nx/.nx/workspace-data/{59842386-c7c4-44ca-b2c2-20e1700bd13d.db-shm → 70094CFD-E89B-57A1-9619-2FC5F4963C54.db-shm} +0 -0
- package/templates/nx/.nx/workspace-data/70094CFD-E89B-57A1-9619-2FC5F4963C54.db-wal +0 -0
- package/templates/nx/.nx/workspace-data/d/daemon.log +6343 -1612
- package/templates/nx/.nx/workspace-data/d/server-process.json +1 -1
- package/templates/nx/.nx/workspace-data/file-map.json +116 -130
- package/templates/nx/.nx/workspace-data/lockfile.hash +1 -1
- package/templates/nx/.nx/workspace-data/nx_files.nxt +0 -0
- package/templates/nx/.nx/workspace-data/parsed-lock-file.json +504 -504
- package/templates/nx/.nx/workspace-data/project-graph.json +560 -559
- package/templates/nx/.nx/workspace-data/source-maps.json +336 -0
- package/templates/nx/CLAUDE.md +10 -10
- package/templates/nx/package.json +3 -3
- package/templates/nx/packages/matchers/e2e/project.json +2 -2
- package/templates/nx/packages/matchers/e2e/specs/ApiInterception/TC-0008-fetch-mocking/mobile.test.ts +27 -27
- package/templates/nx/packages/matchers/e2e/specs/ApiInterception/TC-0008-fetch-mocking/web.test.ts +27 -27
- package/templates/nx/packages/matchers/e2e/specs/ApiInterception/TC-0009-post-mocking/mobile.test.ts +24 -24
- package/templates/nx/packages/matchers/e2e/specs/ApiInterception/TC-0009-post-mocking/web.test.ts +24 -24
- package/templates/nx/packages/matchers/e2e/specs/BrowserContext/TC-0007-title-and-navigation/mobile.test.ts +3 -3
- package/templates/nx/packages/matchers/e2e/specs/BrowserContext/TC-0007-title-and-navigation/web.test.ts +19 -19
- package/templates/nx/packages/matchers/e2e/specs/ContentMatchers/TC-0005-text-and-values/mobile.test.ts +3 -3
- package/templates/nx/packages/matchers/e2e/specs/ContentMatchers/TC-0005-text-and-values/web.test.ts +17 -17
- package/templates/nx/packages/matchers/e2e/specs/ContentMatchers/TC-0006-collections-and-empty/mobile.test.ts +3 -3
- package/templates/nx/packages/matchers/e2e/specs/ContentMatchers/TC-0006-collections-and-empty/web.test.ts +11 -11
- package/templates/nx/packages/matchers/e2e/specs/ElementMatchers/TC-0003-visibility-and-dom/mobile.test.ts +3 -3
- package/templates/nx/packages/matchers/e2e/specs/ElementMatchers/TC-0003-visibility-and-dom/web.test.ts +11 -11
- package/templates/nx/packages/matchers/e2e/specs/ElementMatchers/TC-0004-states-and-attributes/mobile.test.ts +3 -3
- package/templates/nx/packages/matchers/e2e/specs/ElementMatchers/TC-0004-states-and-attributes/web.test.ts +29 -29
- package/templates/nx/packages/matchers/e2e/specs/EnvironmentConfig/TC-0019-read-custom-environment-variable/common.test.ts +5 -5
- package/templates/nx/packages/matchers/e2e/specs/EnvironmentConfig/TC-0019-read-custom-environment-variable/spec.md +16 -16
- package/templates/nx/packages/matchers/e2e/specs/EnvironmentConfig/suite.md +9 -9
- package/templates/nx/packages/playground/e2e/project.json +2 -2
- package/templates/nx/packages/playground/e2e/specs/Playground/TC-0001-form-controls/mobile.test.ts +3 -3
- package/templates/nx/packages/playground/e2e/specs/Playground/TC-0001-form-controls/web.test.ts +6 -6
- package/templates/nx/packages/playground/e2e/specs/Playground/TC-0002-toggle-elements/mobile.test.ts +3 -3
- package/templates/nx/packages/playground/e2e/specs/Playground/TC-0002-toggle-elements/web.test.ts +6 -6
- package/templates/nx/pnpm-lock.yaml +6663 -6663
- package/templates/nx/pnpm-workspace.yaml +9 -9
- package/templates/nx/shared/testing/page-objects/MatchersPage/mobile.ts +33 -33
- package/templates/nx/shared/testing/page-objects/MatchersPage/web.ts +91 -91
- package/templates/nx/shared/testing/page-objects/NavigationPage/mobile.ts +5 -5
- package/templates/nx/shared/testing/page-objects/NavigationPage/web.ts +8 -8
- package/templates/nx/shared/testing/page-objects/PlaygroundPage/mobile.ts +26 -26
- package/templates/nx/shared/testing/page-objects/PlaygroundPage/web.ts +31 -31
- package/templates/nx/shared/testing/project.json +18 -19
- package/templates/nx/shared/testing/support/actions/fillCredentials/mobile.action.ts +4 -4
- package/templates/nx/shared/testing/support/actions/fillCredentials/web.action.ts +4 -4
- package/templates/nx/shared/testing/support/steps/togglePlaygroundStates/mobile.step.ts +3 -3
- package/templates/nx/shared/testing/support/steps/togglePlaygroundStates/web.step.ts +5 -5
- package/templates/nx/shared/testing/support/steps/verifyPlaygroundState/mobile.step.ts +4 -4
- package/templates/nx/shared/testing/support/steps/verifyPlaygroundState/web.step.ts +6 -6
- package/templates/nx/spectra.config.ts +65 -52
- package/templates/react-component/.cursorrules +17 -17
- package/templates/react-component/.vscode/extensions.json +5 -5
- package/templates/react-component/CLAUDE.md +14 -14
- package/templates/react-component/README.md +69 -69
- package/templates/react-component/fixtures/component-mock.json +12 -12
- package/templates/react-component/global-hooks/after/web.hook.ts +3 -3
- package/templates/react-component/global-hooks/before/web.hook.ts +3 -3
- package/templates/react-component/package.json +27 -27
- package/templates/react-component/page-objects/BadgeComponent/web.ts +23 -23
- package/templates/react-component/page-objects/ButtonComponent/web.ts +23 -23
- package/templates/react-component/page-objects/InputComponent/web.ts +13 -13
- package/templates/react-component/specs/BadgeComponent/TC-0002-badge-severities-and-dot/spec.md +18 -18
- package/templates/react-component/specs/BadgeComponent/TC-0002-badge-severities-and-dot/web.test.tsx +11 -11
- package/templates/react-component/specs/BadgeComponent/TC-0006-badge-success-with-dot/spec.md +18 -18
- package/templates/react-component/specs/BadgeComponent/TC-0006-badge-success-with-dot/web.test.tsx +10 -10
- package/templates/react-component/specs/BadgeComponent/TC-0007-badge-by-severity-lookup/spec.md +18 -18
- package/templates/react-component/specs/BadgeComponent/TC-0007-badge-by-severity-lookup/web.test.tsx +16 -16
- package/templates/react-component/specs/BadgeComponent/suite.md +12 -12
- package/templates/react-component/specs/ButtonComponent/TC-0001-button-rendering-and-click/spec.md +19 -19
- package/templates/react-component/specs/ButtonComponent/TC-0001-button-rendering-and-click/web.test.tsx +25 -28
- package/templates/react-component/specs/ButtonComponent/TC-0004-disabled-button-not-clickable/spec.md +19 -19
- package/templates/react-component/specs/ButtonComponent/TC-0004-disabled-button-not-clickable/web.test.tsx +13 -22
- package/templates/react-component/specs/ButtonComponent/TC-0005-button-renders-icon/spec.md +18 -18
- package/templates/react-component/specs/ButtonComponent/TC-0005-button-renders-icon/web.test.tsx +8 -8
- package/templates/react-component/specs/ButtonComponent/suite.md +12 -12
- package/templates/react-component/specs/InputComponent/TC-0003-input-typing-and-clear/spec.md +20 -20
- package/templates/react-component/specs/InputComponent/TC-0003-input-typing-and-clear/web.test.tsx +24 -28
- package/templates/react-component/specs/InputComponent/TC-0008-disabled-input-not-editable/spec.md +18 -18
- package/templates/react-component/specs/InputComponent/TC-0008-disabled-input-not-editable/web.test.tsx +9 -9
- package/templates/react-component/specs/InputComponent/suite.md +12 -12
- package/templates/react-component/spectra.config.ts +17 -27
- package/templates/react-component/src/components/Badge/Badge.tsx +60 -60
- package/templates/react-component/src/components/Button/Button.tsx +59 -57
- package/templates/react-component/src/components/Input/Input.tsx +40 -41
- package/templates/react-component/src/test-utils.tsx +23 -23
- package/templates/react-component/support/actions/fillInputField/web.action.ts +9 -9
- package/templates/react-component/support/steps/verifyButtonState/web.step.ts +12 -12
- package/bin/.testspectra-runner.hash +0 -1
- package/bin/testspectra-runner.exe +0 -0
- package/templates/nx/.nx/workspace-data/59842386-c7c4-44ca-b2c2-20e1700bd13d.db-wal +0 -0
- /package/templates/nx/.nx/workspace-data/{59842386-c7c4-44ca-b2c2-20e1700bd13d.db → 70094CFD-E89B-57A1-9619-2FC5F4963C54.db} +0 -0
|
@@ -1,9 +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
|
-
}
|
|
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
|
+
}
|
|
@@ -1,13 +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
|
-
}
|
|
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
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export default async function () {
|
|
2
|
-
await PlaygroundPage.open();
|
|
3
|
-
await PlaygroundPage.hiddenElement.shouldBeVisible();
|
|
4
|
-
await PlaygroundPage.existingElement.shouldExist();
|
|
5
|
-
}
|
|
1
|
+
export default async function () {
|
|
2
|
+
await PlaygroundPage.open();
|
|
3
|
+
await PlaygroundPage.hiddenElement.shouldBeVisible();
|
|
4
|
+
await PlaygroundPage.existingElement.shouldExist();
|
|
5
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export default async function () {
|
|
2
|
-
await PlaygroundPage.open();
|
|
3
|
-
await PlaygroundPage.hiddenElement.shouldBeVisible();
|
|
4
|
-
await PlaygroundPage.existingElement.shouldExist();
|
|
5
|
-
}
|
|
1
|
+
export default async function () {
|
|
2
|
+
await PlaygroundPage.open();
|
|
3
|
+
await PlaygroundPage.hiddenElement.shouldBeVisible();
|
|
4
|
+
await PlaygroundPage.existingElement.shouldExist();
|
|
5
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export default async function () {
|
|
2
|
-
await PlaygroundPage.open();
|
|
3
|
-
await PlaygroundPage.visibleElement.shouldBeVisible();
|
|
4
|
-
await PlaygroundPage.enabledButton.shouldBeEnabled();
|
|
5
|
-
await PlaygroundPage.termsCheckbox.shouldBeChecked();
|
|
6
|
-
}
|
|
1
|
+
export default async function () {
|
|
2
|
+
await PlaygroundPage.open();
|
|
3
|
+
await PlaygroundPage.visibleElement.shouldBeVisible();
|
|
4
|
+
await PlaygroundPage.enabledButton.shouldBeEnabled();
|
|
5
|
+
await PlaygroundPage.termsCheckbox.shouldBeChecked();
|
|
6
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export default async function () {
|
|
2
|
-
await PlaygroundPage.open();
|
|
3
|
-
await PlaygroundPage.visibleElement.shouldBeVisible();
|
|
4
|
-
await PlaygroundPage.enabledButton.shouldBeEnabled();
|
|
5
|
-
await PlaygroundPage.termsCheckbox.shouldBeChecked();
|
|
6
|
-
}
|
|
1
|
+
export default async function () {
|
|
2
|
+
await PlaygroundPage.open();
|
|
3
|
+
await PlaygroundPage.visibleElement.shouldBeVisible();
|
|
4
|
+
await PlaygroundPage.enabledButton.shouldBeEnabled();
|
|
5
|
+
await PlaygroundPage.termsCheckbox.shouldBeChecked();
|
|
6
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# TestSpectra Project Architecture
|
|
2
|
+
|
|
3
|
+
This project is built with the TestSpectra testing framework.
|
|
4
|
+
|
|
5
|
+
## Structure & File Map
|
|
6
|
+
- `./spectra.config.ts`: Typed runner configuration.
|
|
7
|
+
- `./specs/`: Layered test cases (`specs/<Suite>/<CaseId>/` with `web.test.ts`, `android.test.ts`, `ios.test.ts`).
|
|
8
|
+
- `./page-objects/`: Page Object models per platform.
|
|
9
|
+
- `./support/steps/`: Business flows accessible globally via `Step.*`.
|
|
10
|
+
- `./support/actions/`: Atomic actions accessible globally via `Spectra.*`.
|
|
11
|
+
- `./fixtures/`: JSON fixtures accessible globally via `Fixture.*`.
|
|
12
|
+
- `./global-hooks/`: Global suite lifecycle hooks.
|
|
13
|
+
- `./.testspectra/`: Auto-generated ambient typings and local runtime cache.
|
|
14
|
+
|
|
15
|
+
## Execution
|
|
16
|
+
```bash
|
|
17
|
+
# Run web test suite
|
|
18
|
+
pnpm test
|
|
19
|
+
|
|
20
|
+
# Run Android / iOS
|
|
21
|
+
pnpm spectra run --target android
|
|
22
|
+
pnpm spectra run --target ios
|
|
23
|
+
|
|
24
|
+
# Type check
|
|
25
|
+
pnpm type-check
|
|
26
|
+
```
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# TestSpectra Enterprise Monorepo Architecture
|
|
2
|
+
|
|
3
|
+
This workspace uses TestSpectra's **"Centralized Configuration, Distributed Implementation"** model for automated cross-platform testing.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Directory & File Overview
|
|
8
|
+
|
|
9
|
+
### Centralized Root Elements
|
|
10
|
+
- `./spectra.config.ts`: Single source of truth for runtime configurations (Base URL, Appium devices, browser targets, timeouts).
|
|
11
|
+
- `./.testspectra/`: Local test project cache, runtime metadata, auto-generated master TSConfig (`.testspectra/tsconfig.json`), platform sub-configs (`.testspectra/tsconfig/`), and universal ambient types (`.testspectra/types/`). Global binaries and drivers are managed at `~/.testspectra/drivers/`.
|
|
12
|
+
- `./nx.json`: Nx target defaults with execution caching and inputs.
|
|
13
|
+
- `./pnpm-workspace.yaml`: Monorepo package glob definitions.
|
|
14
|
+
- `./tsconfig.json`: Solution-style TypeScript orchestrator referencing `./.testspectra/tsconfig.json`.
|
|
15
|
+
|
|
16
|
+
### Centralized Shared Testing Library (`./__SHARED_TESTING_REL_PATH__`)
|
|
17
|
+
Provides cross-feature reusable test entities with **100% zero-import global resolution**:
|
|
18
|
+
- `page-objects/`: Shared Page Object models (e.g. NavigationBar, AppHeader).
|
|
19
|
+
- `support/steps/`: Cross-feature business step flows (e.g. `Step.loginAsAdmin()`).
|
|
20
|
+
- `support/actions/`: Custom atomic actions (e.g. `Spectra.dismissBanner()`).
|
|
21
|
+
- `fixtures/`: Common test data and environment configurations (e.g. `Fixture.appConfig`).
|
|
22
|
+
|
|
23
|
+
### Distributed Feature E2E Modules (__FEATURE_COUNT__ Features)
|
|
24
|
+
__FEATURE_MODULES_SECTION__
|
|
25
|
+
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
## 2. Zero-Import Consumption Flow & Mechanics
|
|
29
|
+
|
|
30
|
+
TestSpectra completely eliminates boilerplate `import` statements across all test specs, steps, and page objects.
|
|
31
|
+
|
|
32
|
+
### How It Works:
|
|
33
|
+
1. **Centralized Ambient Aggregation**:
|
|
34
|
+
TestSpectra Language Service Plugin & CLI automatically scan:
|
|
35
|
+
- **Local Feature Entities**: `<feature>/__E2E_FOLDER_NAME__/page-objects/`, `<feature>/__E2E_FOLDER_NAME__/support/steps/`, `<feature>/__E2E_FOLDER_NAME__/support/actions/`
|
|
36
|
+
- **Shared Library Entities**: `./__SHARED_TESTING_REL_PATH__/page-objects/`, `./__SHARED_TESTING_REL_PATH__/support/steps/`, `./__SHARED_TESTING_REL_PATH__/support/actions/`, `./__SHARED_TESTING_REL_PATH__/fixtures/`
|
|
37
|
+
2. **Ambient Typing Generation**:
|
|
38
|
+
These are compiled into `.testspectra/types/web.d.ts`, `android.d.ts`, `ios.d.ts`, `fixtures.d.ts`.
|
|
39
|
+
3. **Instant IDE Autocomplete & Zero Clutter**:
|
|
40
|
+
Specs consume both local feature objects and shared library utilities globally.
|
|
41
|
+
|
|
42
|
+
### Code Example:
|
|
43
|
+
```typescript
|
|
44
|
+
// packages/features/auth/e2e/specs/Auth/TC-AUTH-01/web.test.ts
|
|
45
|
+
// 🌟 NOTICE: 100% Zero-Import & Flat Execution! (No import statement, no describe wrapper)
|
|
46
|
+
|
|
47
|
+
it("should navigate via shared header and login with local POM", async () => {
|
|
48
|
+
// 1. Consumed from Shared Testing Library (__SHARED_TESTING_REL_PATH__/page-objects/NavigationBar)
|
|
49
|
+
await NavigationBar.goToLogin();
|
|
50
|
+
|
|
51
|
+
// 2. Consumed from Shared Testing Library (__SHARED_TESTING_REL_PATH__/support/steps/loginAsAdmin)
|
|
52
|
+
await Step.loginAsAdmin();
|
|
53
|
+
|
|
54
|
+
// 3. Consumed from Local Feature POM (page-objects/LoginPage)
|
|
55
|
+
await LoginPage.flashAlert.shouldBeVisible();
|
|
56
|
+
await LoginPage.flashAlert.shouldContainText("Welcome");
|
|
57
|
+
|
|
58
|
+
// 4. Consumed from Shared Testing Library Custom Action (__SHARED_TESTING_REL_PATH__/support/actions/dismissBanner)
|
|
59
|
+
await Spectra.dismissBanner();
|
|
60
|
+
});
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## 3. How to Run Tests
|
|
66
|
+
|
|
67
|
+
You can execute tests either from the **Monorepo Root via Nx** or directly inside each **Feature Directory via CLI**:
|
|
68
|
+
|
|
69
|
+
### Option A: From Root Monorepo via Nx (Recommended for CI & Team Workflows)
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# 1. Run E2E for a SPECIFIC feature module (e.g. auth)
|
|
73
|
+
pnpm nx run auth-__E2E_FOLDER_NAME__:e2e
|
|
74
|
+
|
|
75
|
+
# 2. Run E2E for a specific feature on ANDROID or IOS
|
|
76
|
+
pnpm nx run auth-__E2E_FOLDER_NAME__:e2e --configuration=android
|
|
77
|
+
pnpm nx run auth-__E2E_FOLDER_NAME__:e2e --configuration=ios
|
|
78
|
+
|
|
79
|
+
# 3. Run E2E for a specific feature in HEADLESS browser mode
|
|
80
|
+
pnpm nx run auth-__E2E_FOLDER_NAME__:e2e --configuration=headless
|
|
81
|
+
|
|
82
|
+
# 4. Run ALL feature E2E suites across the entire monorepo in parallel
|
|
83
|
+
pnpm nx run-many -t e2e
|
|
84
|
+
|
|
85
|
+
# 5. Run only E2E tests for features modified in current Git branch / PR
|
|
86
|
+
pnpm nx affected -t e2e
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Option B: From Inside the Feature Directory (Direct CLI)
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# Navigate to the feature e2e folder
|
|
93
|
+
cd __SAMPLE_FEATURE_E2E_PATH__
|
|
94
|
+
|
|
95
|
+
# Run all specs in this feature
|
|
96
|
+
pnpm spectra run
|
|
97
|
+
|
|
98
|
+
# Run a specific test case by ID (platform is already picked via -t, no need for the file path)
|
|
99
|
+
pnpm spectra run TC-AUTH-01 -t web
|
|
100
|
+
|
|
101
|
+
# Target Android device or emulator
|
|
102
|
+
pnpm spectra run --target android
|
|
103
|
+
|
|
104
|
+
# Run in headed / interactive browser mode
|
|
105
|
+
pnpm spectra run --no-headless
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
---
|
|
109
|
+
|
|
110
|
+
## 4. Type Checking & Validation
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
# Type check all E2E projects via Nx
|
|
114
|
+
pnpm nx run-many -t type-check
|
|
115
|
+
|
|
116
|
+
# Or standard TypeScript project references build from root
|
|
117
|
+
pnpm type-check
|
|
118
|
+
# or: npx tsc -b
|
|
119
|
+
```
|
|
Binary file
|