From 11e4be01ec4af5f0d8f24e14f7d3f689381cadca Mon Sep 17 00:00:00 2001 From: Kari Lintulaakso Date: Thu, 27 Nov 2025 16:49:35 +0200 Subject: [PATCH] Document Cypress delete spec inclusion and reset steps --- cypress.config.js | 4 ++++ documentation/testing.md | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/cypress.config.js b/cypress.config.js index a9fd5973..082535a4 100644 --- a/cypress.config.js +++ b/cypress.config.js @@ -86,6 +86,10 @@ module.exports = defineConfig({ return config }, baseUrl: 'http://localhost:5173/', + specPattern: [ + 'cypress/e2e/**/*.cy.{js,jsx,ts,tsx}', + 'cypress/e2e/**/*.spec.{js,jsx,ts,tsx}', + ], }, env: { databaseResetUrl: "http://localhost:4000/test/reset-test-database", diff --git a/documentation/testing.md b/documentation/testing.md index 5eb35675..35c1ce9c 100644 --- a/documentation/testing.md +++ b/documentation/testing.md @@ -60,3 +60,17 @@ Your feedback is essential to improving the user experience—thank you for part --- +## Cypress E2E Tests + +### Running the suite + +- **Local browsers:** `npm run test:e2e:local` (requires frontend at `http://localhost:5173` and API at `http://localhost:4000`). +- **Headless via Docker (CI parity):** `npm run test:e2e` or `npm run test:ci:e2e` to execute inside the Cypress container image. +- The default spec pattern now includes both `*.cy.*` and `*.spec.*` files under `cypress/e2e`, so the delete flow coverage in `cypress/e2e/delete.spec.ts` runs with the rest of the suite without extra flags. + +### Test data and reset steps + +- Ensure test configuration is present (`npm run config:test`) and start the test stack (e.g., `docker compose -f docker-compose.dev.yml up`). +- The Cypress env variable `databaseResetUrl` points to `http://localhost:4000/test/reset-test-database` by default. Hitting this endpoint (for example with `curl http://localhost:4000/test/reset-test-database`) resets seeded data before running the suite. +- When running inside Docker, the provided scripts already pass through the defaults; override with `CYPRESS_databaseResetUrl` if the API host/port differs. +