The problem it addresses
Many teams accumulate test scripts that validate one layer in isolation: UI checks that fail noisily on data problems, API scripts disconnected from real user flows, and no verification of what actually landed in the database. Without shared architecture or pipeline integration, regression testing stays manual, slow, and easy to skip.
The approach
Nexus treats test code as production code. One Python framework owns all three validation layers behind clean abstractions, marker-based suites map directly to pipeline stages, and Docker Compose orchestrates the database, the application under test, and the runner with healthcheck gating. Every failure ships with its evidence attached.
UI layer
Playwright drives cross-browser journeys through Page Object Model structure. Contexts record video; failures capture screenshots and traces. A visual validator compares screenshots against pixel baselines, and a scanner performs baseline accessibility checks such as missing alt text.
- Page Object Model
- Video & trace capture
- Visual baselines
- Alt-text scanning
API layer
A reusable REST client returns typed response models. Responses are validated against JSON Schema contracts before assertions run, so contract drift is caught at the API level — before any browser is involved.
- Typed API client
- JSON Schema contracts
- Auth flows
- Negative paths
Database layer
SQL assertions verify what the application actually persisted. A single SQLAlchemy abstraction serves SQLite for zero-dependency local runs and a PostgreSQL 16 service container for Dockerized and CI runs, with connection polling so suites never race the database.
- SQLite ↔ PostgreSQL
- SQLAlchemy abstraction
- Connection polling
- Idempotent schema & seed
Marker-based suites
smoke, regression, e2e, api, database, visual, and accessibility markers let pipelines run exactly the right depth of testing at the right time.
Dockerized orchestration
docker-compose brings up PostgreSQL (healthcheck-gated), a FastAPI mock application under test, and the automation runner — tests start only when every dependency is genuinely ready.
CI/CD quality gates
GitHub Actions runs the smoke suite on every push and pull request, full regression nightly, and enforces ruff lint plus mypy type checks as a pull-request quality gate. Allure results upload even on failure.
Observability & artifacts
Allure reports collect screenshots, logs, video, traces, and environment metadata — including which database backend served each run. Failures arrive with complete context for debugging.
Framework engineering
Pydantic-typed configuration per environment, a secrets manager, retry engine, structured logging, execution timing metrics, and Faker-backed test data factories keep the framework maintainable as it grows.
Parallel & resilient runs
pytest-xdist parallelizes suites; pytest-rerunfailures retries flaky steps before they page anyone — with reruns visible in reports rather than hidden.
GitHub Actions · smoke.ymlruns on push & pull_request
- name: Build Docker Images
run: docker compose build
- name: Execute Smoke Suite
run: docker compose run --rm -e TEST_ENV=docker automation pytest -m smoke
- name: Upload Allure Results
if: always()
uses: actions/upload-artifact@v4