End-to-end test suite for spreadsheet-schema-manager-rio, written with
Playwright and pytest.
- Python 3.12+
- The app under test running with
AUTH_DISABLED=true(this suite drives the app as an anonymous, ephemeral test user — see below)
pip install -r requirements.txt
playwright install chromiumpytest # everything
pytest -m smoke # fast smoke subset
pytest -m regression # full regression suite
pytest tests/e2e/test_fields.py # a single fileSet BASE_URL (environment variable, or in a .env file) to the app under test; it defaults
to http://localhost:8000:
BASE_URL=https://ssm-uat.example.com pytest -m smoketests/pages/— Page Object Model wrappers around the app's pages (FieldsPage,WorkbookDetailPage, etc.)tests/e2e/— the actual test cases, grouped by feature areatests/conftest.py— shared fixtures (viewport sizes, browser context config)
The app under test runs with AUTH_DISABLED=true, which attaches a fresh, isolated synthetic
user to every new browser session — not just every test, but every full page navigation. This
is intentional and gives every test its own clean "personal space" with zero cross-test data
leakage, but it means:
- Only call
.goto()once per test (typically via a page object'sgoto()in a fixture). - Any further in-test navigation between pages must go through the app's own nav-bar links
(e.g.
page.get_by_role("link", name="Fields", exact=True).click()), not another.goto()— otherwise the test lands in a brand-new session that can't see data it just created.
Tests run in Jenkins (see Jenkinsfile) against the Microsoft Playwright Docker image. The job
takes a required BASE_URL parameter (plus PYTEST_MARKERS), and is typically triggered from the
app's UAT build pipeline, which passes the UAT URL.
Contributions are welcome. If you are planning a change, please open an issue or discussion first so the intended approach and scope are clear.
When updating tests, fixtures, or environment assumptions, also update the relevant README and test documentation so the suite remains reliable and easy to operate.
Licensed under the Apache License, Version 2.0 — see LICENSE and NOTICE for details.
Funded by the New Zealand Ministry of Business, Innovation and Employment Strategic Science Investment Fund (contract number C11X1702) as part of the Digital Horticulture Systems Ngā Pou Rangahau, a Growing Futures™ programme at The New Zealand Institute for Bioeconomy Science Limited (Bioeconomy Science Institute).