test: add functional portal suite

This commit is contained in:
bisco
2026-06-24 09:25:28 +02:00
parent 4886516aa3
commit 1e3685bab8
12 changed files with 358 additions and 4 deletions
+13 -4
View File
@@ -9,6 +9,8 @@ docker compose run --rm backend python manage.py test
docker compose run --rm frontend npm run check
docker compose run --rm frontend npm run build
docker compose run --rm proxy nginx -t
docker compose -f docker-compose.yml -f docker-compose.test.yml --profile test run --rm backend python manage.py seed_demo
docker compose -f docker-compose.yml -f docker-compose.test.yml --profile test run --build --rm functional-tests
docker compose config --quiet
```
@@ -20,12 +22,19 @@ The test suite covers:
- Astro static type and template validation;
- production frontend build;
- NGINX syntax and upstream configuration validation;
- Playwright functional browser tests through the NGINX virtual host;
- Docker Compose configuration validation.
All commands run in containers. The backend test container starts PostgreSQL through
Compose; the frontend checks use the checked-in lockfile for reproducible installs.
After seeding, smoke-test `/health/`, `/api/site/home/`, and the public page through
NGINX using the `azionelab.org` host. Also verify that an unknown host returns 404.
Basic keyboard navigation, responsive layout, and accessible names require a manual
browser pass until browser automation is added.
`docker-compose.test.yml` is an override used only for functional verification. It
adds an internal `azionelab.org` alias to the proxy and starts a pinned Playwright
container. Run the idempotent demo seed through the merged backend service immediately
before the browser suite. The override uses `test_postgres_data` instead of the normal
database volume and does not publish additional host ports.
The browser suite verifies the public content and section order, CTA/contact links,
mobile navigation, horizontal overflow, semantic landmarks, image alternatives, API
contract, uploaded media, Wagtail admin routing, and rejection of unknown hosts. A
manual visual review is still recommended for subjective layout and design quality.