|
1 | 1 | Project-specific development guidelines for vue-json-form (monorepo) |
2 | 2 |
|
3 | | -Audience: Advanced contributors familiar with Yarn workspaces, Vite, Vue 3, TypeScript, Vitest, and Cypress. |
| 3 | +Audience: Advanced contributors familiar with Yarn workspaces, Vite, Vue 3, TypeScript, Vitest, and Playwright. |
4 | 4 |
|
5 | 5 | 1) Monorepo overview and prerequisites |
6 | 6 | - Package manager: Yarn 4 (Berry). Confirm with node -v (CI uses Node 20/22/24). Use the same major Node versions for reproducibility. |
@@ -45,22 +45,22 @@ Audience: Advanced contributors familiar with Yarn workspaces, Vite, Vue 3, Type |
45 | 45 | - Run: yarn workspace @educorvi/vue-json-form vitest run src/MapperFunctions/yourFunction.test.ts |
46 | 46 | - Remove temporary files when done if they are only for demonstration. |
47 | 47 |
|
48 | | -4) Testing: end-to-end (Cypress) |
49 | | -- Location: vue-json-form/cypress/e2e/*.cy.ts |
50 | | -- Dev server + Cypress (CI parity): |
51 | | - - CI does: build deps, then in ./vue-json-form runs build, starts dev, wait-on http://localhost:5173, then runs Cypress. |
| 48 | +4) Testing: end-to-end (Playwright) |
| 49 | +- Location: vue-json-form/tests/e2e/*.spec.ts |
| 50 | +- Dev server + Playwright (CI parity): |
| 51 | + - CI does: build deps, then in ./vue-json-form installs Playwright browsers, runs Playwright tests. |
52 | 52 | - Local equivalent from repo root: |
53 | 53 | - yarn install --immutable |
54 | 54 | - yarn build:vue-json-form |
55 | 55 | - cd vue-json-form |
56 | | - - yarn build |
57 | | - - In one terminal: yarn dev # Vite at http://localhost:5173 |
58 | | - - In another terminal: yarn cypress # Opens Cypress runner |
59 | | - - Headless run: |
60 | | - - From vue-json-form: npx cypress run |
| 56 | + - npx playwright install --with-deps chromium # First time only |
| 57 | + - yarn test:e2e # Runs tests headless |
| 58 | + - Interactive mode: |
| 59 | + - From vue-json-form: yarn playwright # Opens Playwright UI |
61 | 60 | - Tips |
62 | | - - Keep e2e fixtures and example schemas under vue-json-form/src/exampleSchemas for reproducible scenarios; CI records and uploads screenshots on failures. |
63 | | - - When adjusting ports/hosts, update wait-on in .github/workflows/buildAndTest.yaml and local commands accordingly. |
| 61 | + - Playwright automatically starts the dev server before running tests (configured in playwright.config.ts). |
| 62 | + - Keep e2e fixtures and example schemas under vue-json-form/src/exampleSchemas for reproducible scenarios; CI uploads test reports on failures. |
| 63 | + - When adjusting ports/hosts, update baseURL in playwright.config.ts and webServer settings accordingly. |
64 | 64 |
|
65 | 65 | 5) Coding standards and project conventions |
66 | 66 | - Languages/stack: TypeScript, Vue 3, Vite, Pinia, Sass. Typings for schemas are provided by @educorvi/vue-json-form-schemas. |
@@ -93,5 +93,5 @@ Audience: Advanced contributors familiar with Yarn workspaces, Vite, Vue 3, Type |
93 | 93 | - yarn install --immutable && yarn build |
94 | 94 | - Iterate on vue-json-form only: |
95 | 95 | - yarn build:vue-json-form && yarn workspace @educorvi/vue-json-form dev |
96 | | -- Run Cypress like CI does: |
97 | | - - yarn build:vue-json-form && (cd vue-json-form && yarn build && yarn dev) in one terminal, and in another terminal run yarn cypress from vue-json-form |
| 96 | +- Run Playwright like CI does: |
| 97 | + - yarn build:vue-json-form && (cd vue-json-form && yarn test:e2e) |
0 commit comments