@toolstackhq/create-qa-patterns 1.0.12 → 1.0.14
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 +32 -0
- package/index.js +502 -41
- package/package.json +1 -1
- package/templates/cypress-template/README.md +32 -0
- package/templates/cypress-template/allurerc.mjs +10 -0
- package/templates/cypress-template/config/README.md +5 -0
- package/templates/cypress-template/config/environments.ts +1 -0
- package/templates/cypress-template/config/runtime-config.ts +1 -0
- package/templates/cypress-template/config/secret-manager.ts +1 -0
- package/templates/cypress-template/cypress/e2e/README.md +6 -0
- package/templates/cypress-template/cypress/e2e/ui-journey.cy.ts +1 -0
- package/templates/cypress-template/cypress/support/README.md +5 -0
- package/templates/cypress-template/cypress/support/app-config.ts +1 -0
- package/templates/cypress-template/cypress/support/commands.ts +1 -0
- package/templates/cypress-template/cypress/support/data/README.md +5 -0
- package/templates/cypress-template/cypress/support/data/data-factory.ts +1 -0
- package/templates/cypress-template/cypress/support/data/id-generator.ts +1 -0
- package/templates/cypress-template/cypress/support/data/seeded-faker.ts +1 -0
- package/templates/cypress-template/cypress/support/e2e.ts +1 -0
- package/templates/cypress-template/cypress/support/pages/README.md +5 -0
- package/templates/cypress-template/cypress/support/pages/login-page.ts +1 -0
- package/templates/cypress-template/cypress/support/pages/people-page.ts +1 -0
- package/templates/cypress-template/cypress.config.ts +17 -1
- package/templates/cypress-template/eslint.config.mjs +1 -1
- package/templates/cypress-template/package-lock.json +2857 -109
- package/templates/cypress-template/package.json +4 -0
- package/templates/cypress-template/scripts/README.md +5 -0
- package/templates/cypress-template/scripts/generate-allure-report.mjs +66 -0
- package/templates/cypress-template/scripts/run-cypress.mjs +1 -0
- package/templates/cypress-template/tsconfig.json +1 -1
- package/templates/playwright-template/README.md +20 -0
- package/templates/playwright-template/components/README.md +5 -0
- package/templates/playwright-template/config/README.md +5 -0
- package/templates/playwright-template/config/environments.ts +1 -0
- package/templates/playwright-template/config/runtime-config.ts +1 -0
- package/templates/playwright-template/config/secret-manager.ts +1 -0
- package/templates/playwright-template/data/factories/README.md +6 -0
- package/templates/playwright-template/data/factories/data-factory.ts +1 -0
- package/templates/playwright-template/data/generators/README.md +5 -0
- package/templates/playwright-template/data/generators/id-generator.ts +1 -0
- package/templates/playwright-template/data/generators/seeded-faker.ts +1 -0
- package/templates/playwright-template/fixtures/README.md +5 -0
- package/templates/playwright-template/fixtures/test-fixtures.ts +1 -0
- package/templates/playwright-template/pages/README.md +6 -0
- package/templates/playwright-template/pages/base-page.ts +1 -0
- package/templates/playwright-template/pages/login-page.ts +1 -0
- package/templates/playwright-template/pages/people-page.ts +1 -0
- package/templates/playwright-template/playwright.config.ts +1 -0
- package/templates/playwright-template/reporters/README.md +5 -0
- package/templates/playwright-template/reporters/structured-reporter.ts +1 -0
- package/templates/playwright-template/scripts/README.md +5 -0
- package/templates/playwright-template/scripts/generate-allure-report.mjs +1 -0
- package/templates/playwright-template/tests/README.md +7 -0
- package/templates/playwright-template/tests/api-people.spec.ts +1 -0
- package/templates/playwright-template/tests/ui-journey.spec.ts +1 -0
- package/templates/playwright-template/utils/README.md +5 -0
- package/templates/playwright-template/utils/logger.ts +1 -0
- package/templates/playwright-template/utils/test-step.ts +1 -0
package/package.json
CHANGED
|
@@ -13,6 +13,7 @@ This is a Cypress + TypeScript automation framework template for a small determi
|
|
|
13
13
|
- [Reports and artifacts](#reports-and-artifacts)
|
|
14
14
|
- [Add a new test](#add-a-new-test)
|
|
15
15
|
- [Extend the framework](#extend-the-framework)
|
|
16
|
+
- [Template upgrades](#template-upgrades)
|
|
16
17
|
- [CI](#ci)
|
|
17
18
|
|
|
18
19
|
## Feature set
|
|
@@ -21,9 +22,11 @@ This is a Cypress + TypeScript automation framework template for a small determi
|
|
|
21
22
|
- Cypress-native custom commands for common user actions
|
|
22
23
|
- page modules that own selectors and keep spec files focused on behavior
|
|
23
24
|
- generic `DataFactory` helpers for repeatable UI data
|
|
25
|
+
- folder-level `README.md` guides and file-header comments for easier onboarding
|
|
24
26
|
- multi-environment runtime config with `dev`, `staging`, and `prod`
|
|
25
27
|
- env-based secret resolution with a replaceable `SecretProvider`
|
|
26
28
|
- built-in screenshots and videos on failure
|
|
29
|
+
- optional single-file Allure report
|
|
27
30
|
- ESLint rules that keep selectors out of spec files
|
|
28
31
|
- bundled deterministic UI demo app and GitHub Actions workflow
|
|
29
32
|
|
|
@@ -79,6 +82,12 @@ If you want to run the demo app manually for debugging:
|
|
|
79
82
|
npm run demo:ui
|
|
80
83
|
```
|
|
81
84
|
|
|
85
|
+
If you want an Allure report after a run:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
npm run report:allure
|
|
89
|
+
```
|
|
90
|
+
|
|
82
91
|
Default local values:
|
|
83
92
|
|
|
84
93
|
- UI base URL: `http://127.0.0.1:3000`
|
|
@@ -134,6 +143,7 @@ npm run demo:ui
|
|
|
134
143
|
npm run lint
|
|
135
144
|
npm run typecheck
|
|
136
145
|
npm run cy:run
|
|
146
|
+
npm run report:allure
|
|
137
147
|
```
|
|
138
148
|
|
|
139
149
|
## Reports and artifacts
|
|
@@ -142,9 +152,13 @@ Outputs:
|
|
|
142
152
|
|
|
143
153
|
- Cypress videos: `reports/videos`
|
|
144
154
|
- Cypress screenshots: `reports/screenshots`
|
|
155
|
+
- Allure single file: `reports/allure/index.html`
|
|
156
|
+
- raw Allure results: `allure-results`
|
|
145
157
|
|
|
146
158
|
The default Cypress terminal output is kept as the main reporting path.
|
|
147
159
|
|
|
160
|
+
If you only want Cypress's built-in output, remove the `allureCypress(...)` call in `cypress.config.ts`.
|
|
161
|
+
|
|
148
162
|
## Add a new test
|
|
149
163
|
|
|
150
164
|
Create tests under `cypress/e2e/`.
|
|
@@ -184,6 +198,24 @@ Recommended rules:
|
|
|
184
198
|
- use Cypress commands for workflows, not giant helper classes
|
|
185
199
|
- keep the data layer generic until the project really needs domain-specific factories
|
|
186
200
|
|
|
201
|
+
## Template upgrades
|
|
202
|
+
|
|
203
|
+
This project includes a `.qa-patterns.json` metadata file so future CLI versions can compare the current project against the managed template baseline.
|
|
204
|
+
|
|
205
|
+
Check for available safe updates:
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
npx -y @toolstackhq/create-qa-patterns upgrade check .
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
Apply only safe managed-file updates:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
npx -y @toolstackhq/create-qa-patterns upgrade apply --safe .
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
The upgrade flow is conservative. It updates framework infrastructure such as config, scripts, workflows, and package metadata when those files are still unchanged from the generated baseline. If you changed a managed file yourself, the CLI reports a conflict instead of overwriting it.
|
|
218
|
+
|
|
187
219
|
## CI
|
|
188
220
|
|
|
189
221
|
The included workflow lives at:
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
// Central Cypress configuration for specs, retries, artifacts, and runtime env values.
|
|
2
|
+
import * as os from "node:os";
|
|
3
|
+
|
|
4
|
+
import { allureCypress } from "allure-cypress/reporter";
|
|
1
5
|
import { defineConfig } from "cypress";
|
|
2
6
|
|
|
3
7
|
import { loadRuntimeConfig } from "./config/runtime-config";
|
|
@@ -9,7 +13,19 @@ export default defineConfig({
|
|
|
9
13
|
baseUrl: runtimeConfig.uiBaseUrl,
|
|
10
14
|
specPattern: "cypress/e2e/**/*.cy.ts",
|
|
11
15
|
supportFile: "cypress/support/e2e.ts",
|
|
12
|
-
setupNodeEvents(
|
|
16
|
+
setupNodeEvents(on, config) {
|
|
17
|
+
// Keep Cypress terminal output as the default path most users expect.
|
|
18
|
+
// Remove the Allure line below if you prefer to stay with Cypress output only.
|
|
19
|
+
allureCypress(on, config, {
|
|
20
|
+
resultsDir: "allure-results",
|
|
21
|
+
environmentInfo: {
|
|
22
|
+
os_platform: os.platform(),
|
|
23
|
+
os_release: os.release(),
|
|
24
|
+
os_version: os.version(),
|
|
25
|
+
node_version: process.version
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
|
|
13
29
|
config.env = {
|
|
14
30
|
...config.env,
|
|
15
31
|
testEnv: runtimeConfig.testEnv,
|