Add Playwright e2e test infrastructure

Set up browser-based end-to-end testing using pytest-playwright:
- Add playwright-driver and pytest-playwright to nix flake
- Configure PLAYWRIGHT_BROWSERS_PATH for NixOS compatibility
- Create ServerHarness to manage live server for tests
- Add smoke tests for health endpoint and page loading
- Exclude e2e tests from pre-commit hook (require special setup)

Run e2e tests with: pytest tests/e2e/ -v -n 0

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-18 08:11:15 +00:00
parent c477d801d1
commit feca97a796
6 changed files with 166 additions and 1 deletions

View File

@@ -28,6 +28,8 @@ dependencies = [
dev = [
"pytest>=7.4.0",
"pytest-xdist>=3.5.0",
"pytest-playwright>=0.4.0",
"requests>=2.31.0",
"ruff>=0.1.0",
"filelock>=3.13.0",
]
@@ -56,3 +58,6 @@ python_files = "test_*.py"
python_classes = "Test*"
python_functions = "test_*"
addopts = "--durations=20 -n auto"
markers = [
"e2e: end-to-end browser tests (run with -n 0 to disable parallel execution)",
]