feat: Enhance end-to-end testing framework with improved server setup and UI validation

This commit is contained in:
2025-10-21 09:04:06 +02:00
parent f020d276bc
commit 9114b584c2
11 changed files with 138 additions and 71 deletions

View File

@@ -107,6 +107,12 @@ To execute the unit test suite:
pytest
```
### End-to-End Tests
- Playwright-based E2E tests rely on a session-scoped `live_server` fixture that auto-starts the FastAPI app on `http://localhost:8001`, so no per-test `@pytest.mark.usefixtures("live_server")` annotations are required.
- The fixture now polls `[http://localhost:8001](http://localhost:8001)` until it responds (up to ~30s), ensuring the uvicorn subprocess is ready before Playwright starts navigation, then preloads `/` and waits for a `networkidle` state so sidebar navigation and global assets are ready for each test.
- Latest run (`pytest tests/e2e/` on 2025-10-21) passes end-to-end smoke and form coverage after aligning form selectors, titles, and the live server startup behaviour.
### Coverage Snapshot (2025-10-20)
- `pytest --cov=. --cov-report=term-missing` reports **95%** overall coverage across the project.