Dedicated test automation repository for LumaireJ - a journaling and mood tracking application.
/\
/ \ E2E Tests (Playwright)
/----\ UI validation, user journeys
/ \
/--------\ API Tests (Requests + Pydantic)
/ \ Contract testing, business logic
/------------\
/ \ Unit Tests (pytest)
/________________\ Isolated component testing
| Layer | Framework | Purpose | Current Coverage |
|---|---|---|---|
| E2E | Playwright | User journey validation | 3 tests |
| API | Requests + Pydantic | Contract & integration testing | 3 tests |
| Unit | pytest | Isolated component testing | TBD |
| Marker | Description | Usage |
|---|---|---|
@pytest.mark.smoke |
Critical path tests | Fast feedback, PR gates |
@pytest.mark.regression |
Full regression suite | Nightly/release validation |
@pytest.mark.api |
API integration tests | Backend contract testing |
@pytest.mark.e2e |
End-to-end UI tests | User journey validation |
@pytest.mark.journal |
Journal feature tests | Feature-specific grouping |
- Page Object Model (POM): E2E tests use encapsulated page objects (
tests/e2e/pages/) - Schema Validation: API responses validated via Pydantic models (
tests/api/schemas/) - Fixture-Based DI: Test data and clients injected via pytest fixtures
- Factory Pattern: Test data generated using Faker with dataclass factories
lumairej-tests/
βββ .github/
β βββ workflows/
β βββ ci.yml # CI/CD pipeline
βββ tests/
β βββ api/
β β βββ clients/
β β β βββ api_client.py # HTTP client wrapper
β β βββ schemas/
β β β βββ journal_schema.py # Pydantic response models
β β βββ tests/
β β βββ test_journal_api.py
β βββ e2e/
β β βββ conftest.py # Playwright fixtures
β β βββ pages/
β β β βββ journal_page.py # Page Object Model
β β βββ tests/
β β βββ test_journaling_ui.py
β βββ shared/
β βββ constants.py # Timeout configuration
β βββ fixtures.py # Shared pytest fixtures
β βββ test_data.py # Faker-based data factories
βββ conftest.py # Root fixture configuration
βββ pyproject.toml # Project config & pytest settings
βββ .env.template # Environment variable template
- Install Python 3.14+
- Install PDM
- Install Allure CLI (for reports)
# Install dependencies
pdm install -G dev
# Install Playwright browsers
pdm run playwright install chromium
# Install pre-commit hooks
pdm run pre-commit install
# Configure environment
cp .env.template .env
# Edit .env with your BASE_URL# Run all API tests
pdm run pytest -m api
# Run smoke tests only
pdm run pytest -m "api and smoke"
# Run with verbose output
pdm run pytest -m api -v# Run all E2E tests
pdm run pytest -m e2e
# Run specific feature tests
pdm run pytest -m "e2e and journal"
# Run headed (visible browser)
CI=false pdm run pytest -m e2e# Run everything
pdm run test
# Run with Allure results collection
pdm run test-allureThe GitHub Actions workflow enforces the following quality gates:
| Gate | Trigger | Action |
|---|---|---|
| API Tests | PR to main, dispatch | Must pass for E2E to run |
| E2E Tests | After API tests pass | Browser automation validation |
| Status Report | On dispatch events | Reports back to main repo |
βββββββββββββββββββ
β Setup Job β Checkout, install deps, cache Playwright
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ
β API Tests β Start SUT β Run API tests β Upload results
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ
β E2E Tests β Start SUT β Run E2E tests β Upload results
ββββββββββ¬βββββββββ
β
βΌ
βββββββββββββββββββ
β Report Status β Post commit status back to LumaireJ repo
βββββββββββββββββββ
# Lint code
pdm run lint
# Auto-fix lint issues
pdm run fix
# Format code
pdm run format# Generate report from results
pdm run report
# Open report in browser
pdm run open_reportEach CI run uploads:
allure-report-api/- API test resultsallure-report-e2e/- E2E test resultsapp-logs-*- SUT (System Under Test) logs
| Variable | Description | Required | Default |
|---|---|---|---|
BASE_URL |
Application base URL | Yes | - |
CI |
CI environment flag | No | false |
DATABASE_URL |
Database connection (CI only) | CI only | - |
# .env file
BASE_URL=http://localhost:8000
CI=falseConfigure as repository secrets:
BASE_URL- SUT endpoint URLDATABASE_URL- Test database connectionPAT_FOR_MAIN_REPO- Token for cross-repo status reporting
- API Tests: Add to
tests/api/tests/, use@pytest.mark.api - E2E Tests: Add to
tests/e2e/tests/, create Page Objects inpages/ - Shared Data: Add fixtures to
tests/shared/test_data.py
def test_<action>_<expected_outcome>():
"""Test that <action> results in <expected_outcome>."""Follow Conventional Commits:
test:New test cases or test coveragefix(tests):Bug fixes in test coderefactor(tests):Test code restructuringci:CI/CD pipeline changeschore:Dependency updates, config changes
Darie Ro - glicerinn@gmail.com