Add E2E tests to stop hook and README
Some checks failed
CI / backend-test (push) Successful in 55s
CI / frontend-test (push) Failing after 17s
CI / frontend-e2e (push) Successful in 52s
CI / build-and-publish (push) Has been skipped

- Stop hook now triggers on frontend/e2e/ changes
- Stop hook runs Playwright E2E tests alongside unit tests
- README documents test:e2e command and Playwright in code quality section
This commit is contained in:
2026-03-06 18:19:39 +01:00
parent 562631f151
commit 0b2b84dafc
2 changed files with 15 additions and 5 deletions

View File

@@ -14,7 +14,7 @@ fi
# Check for uncommitted changes in backend/frontend source # Check for uncommitted changes in backend/frontend source
HAS_BACKEND=$(git status --porcelain backend/src/ 2>/dev/null | head -1) HAS_BACKEND=$(git status --porcelain backend/src/ 2>/dev/null | head -1)
HAS_FRONTEND=$(git status --porcelain frontend/src/ 2>/dev/null | head -1) HAS_FRONTEND=$(git status --porcelain frontend/src/ frontend/e2e/ 2>/dev/null | head -1)
# Nothing changed -- skip # Nothing changed -- skip
if [[ -z "$HAS_BACKEND" && -z "$HAS_FRONTEND" ]]; then if [[ -z "$HAS_BACKEND" && -z "$HAS_FRONTEND" ]]; then
@@ -38,9 +38,15 @@ fi
# Run frontend tests if TS/Vue sources changed # Run frontend tests if TS/Vue sources changed
if [[ -n "$HAS_FRONTEND" ]]; then if [[ -n "$HAS_FRONTEND" ]]; then
if OUTPUT=$(cd frontend && npm run test:unit -- --run 2>&1); then if OUTPUT=$(cd frontend && npm run test:unit -- --run 2>&1); then
PASSED+="✓ Frontend tests passed. " PASSED+="✓ Frontend unit tests passed. "
else else
ERRORS+="Frontend tests failed:\n$OUTPUT\n\n" ERRORS+="Frontend unit tests failed:\n$OUTPUT\n\n"
fi
if OUTPUT=$(cd frontend && npm run test:e2e 2>&1); then
PASSED+="✓ Frontend E2E tests passed. "
else
ERRORS+="Frontend E2E tests failed:\n$OUTPUT\n\n"
fi fi
fi fi

View File

@@ -65,8 +65,11 @@ fete/
# Backend # Backend
cd backend && ./mvnw test cd backend && ./mvnw test
# Frontend # Frontend unit tests
cd frontend && npm run test:unit cd frontend && npm run test:unit
# Frontend E2E tests (requires Chromium: npx playwright install chromium)
cd frontend && npm run test:e2e
``` ```
### Running the backend locally ### Running the backend locally
@@ -138,11 +141,12 @@ ArchUnit enforces hexagonal boundaries: domain must not depend on adapters, appl
| TypeScript (strict) | `vue-tsc --noEmit` | Type errors | | TypeScript (strict) | `vue-tsc --noEmit` | Type errors |
| oxlint + ESLint | `oxlint`, `eslint` | Lint violations | | oxlint + ESLint | `oxlint`, `eslint` | Lint violations |
**When the agent finishes** (Stop hook — only if `frontend/src/` has uncommitted changes): **When the agent finishes** (Stop hook — only if `frontend/src/` or `frontend/e2e/` has uncommitted changes):
| What | Command | Fails on | | What | Command | Fails on |
|---------------------|------------------------------|---------------------------------------| |---------------------|------------------------------|---------------------------------------|
| Vitest | `npm run test:unit -- --run` | Test failures (fail-fast, stops at 1) | | Vitest | `npm run test:unit -- --run` | Test failures (fail-fast, stops at 1) |
| Playwright | `npm run test:e2e` | E2E test failures |
**Not hooked** (run manually or via editor): **Not hooked** (run manually or via editor):