feat: add comprehensive E2E test suite (Playwright + WireGuard + API)
Adds tests/e2e/ with three layers of E2E coverage: - API layer (tests/e2e/api/): unauthenticated access, admin endpoints, peer endpoints, access control enforcement — 24 tests - Playwright UI (tests/e2e/ui/): login flows, admin navigation, peer dashboard/services, role-based ACL, password change — 60+ tests - WireGuard connectivity (tests/e2e/wg/): tunnel up/down, DNS resolution through VPN, service ACL enforcement via iptables, full-tunnel routing Shared helpers: PicAPIClient, WGInterface, playwright_login, cleanup. Makefile targets: test-e2e-api, test-e2e-ui, test-e2e-wg, test-e2e. Adds scripts/reset_admin_password.py for test bootstrap. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
test test-all test-unit test-coverage test-api test-cli \
|
||||
test-phase1 test-phase2 test-phase3 test-phase4 test-all-phases \
|
||||
test-integration test-integration-readonly \
|
||||
test-e2e-deps test-e2e-api test-e2e-ui test-e2e-wg test-e2e \
|
||||
reset-test-admin-pass \
|
||||
show-routes add-peer list-peers
|
||||
|
||||
# Detect docker compose command (v2 plugin preferred, fallback to v1 standalone)
|
||||
@@ -244,6 +246,26 @@ test-api:
|
||||
test-cli:
|
||||
cd api && python3 -m pytest tests/test_cli_tool.py -v
|
||||
|
||||
# ── E2E tests ─────────────────────────────────────────────────────────────────
|
||||
|
||||
test-e2e-deps:
|
||||
pip install -r tests/e2e/requirements.txt
|
||||
playwright install --with-deps chromium
|
||||
|
||||
test-e2e-api:
|
||||
@PIC_HOST=$${PIC_HOST:-localhost} pytest tests/e2e/api -v -m "not wg and not cell_link"
|
||||
|
||||
test-e2e-ui:
|
||||
@PIC_HOST=$${PIC_HOST:-localhost} pytest tests/e2e/ui -v -m ui
|
||||
|
||||
test-e2e-wg:
|
||||
@PIC_HOST=$${PIC_HOST:-localhost} sudo -E env PATH=$$PATH pytest tests/e2e/wg -v -m wg -p no:xdist
|
||||
|
||||
test-e2e: test-e2e-api test-e2e-ui test-e2e-wg
|
||||
|
||||
reset-test-admin-pass:
|
||||
@python3 scripts/reset_admin_password.py "$${PIC_TEST_ADMIN_PASS:?Set PIC_TEST_ADMIN_PASS=<new-password>}"
|
||||
|
||||
test-phase1:
|
||||
cd api && python3 -m pytest tests/test_network_manager.py tests/test_phase1_endpoints.py -v
|
||||
|
||||
|
||||
Reference in New Issue
Block a user