- Create tests/e2e/test_port_autofill.py - headless chromium test for PRNT-03 - Verifies IP->port_name auto-derivation via Alpine @input handler at /printers - Update 09-VALIDATION.md: mark UX-02 tasks green, cite test file as evidence
92 lines
6.0 KiB
Markdown
92 lines
6.0 KiB
Markdown
---
|
|
phase: 9
|
|
slug: ux-tech-debt-closure
|
|
status: draft
|
|
nyquist_compliant: true
|
|
wave_0_complete: false
|
|
created: 2026-04-13
|
|
updated: 2026-04-13
|
|
---
|
|
|
|
# Phase 9 — Validation Strategy
|
|
|
|
> Per-phase validation contract for feedback sampling during execution.
|
|
|
|
---
|
|
|
|
## Test Infrastructure
|
|
|
|
| Property | Value |
|
|
|----------|-------|
|
|
| **Framework** | pytest >= 8.0 (+ pytest-playwright for e2e) |
|
|
| **Config file** | none — pytest discovers `tests/` by default |
|
|
| **Quick run command** | `pytest tests/ -x -q --ignore=tests/e2e` |
|
|
| **Full suite command** | `pytest tests/ -v` |
|
|
| **E2E command** | `pytest tests/e2e/ -v` (requires `playwright install chromium`) |
|
|
| **Estimated runtime** | ~20s unit/integration, ~15s e2e |
|
|
|
|
---
|
|
|
|
## Sampling Rate
|
|
|
|
- **After every task commit:** Run `pytest tests/ -x -q --ignore=tests/e2e`
|
|
- **After every plan wave:** Run `pytest tests/ -v`
|
|
- **Before `/gsd:verify-work`:** Full suite (including `tests/e2e/`) must be green
|
|
- **Max feedback latency:** 30 seconds
|
|
|
|
---
|
|
|
|
## Per-Task Verification Map
|
|
|
|
Task IDs follow `{phase}-{plan}-{task}` where task numbers match the `<task>` order in each PLAN.md.
|
|
|
|
| Task ID | Plan | Wave | Requirement | Test Type | Automated Command | File Exists | Status |
|
|
|---------|------|------|-------------|-----------|-------------------|-------------|--------|
|
|
| 09-01-01 | 01 (driver-upload-fix-and-inline-oob) | 1 | UX-01 | integration (TDD red) | `pytest tests/test_driver_upload.py::test_upload_500_regression tests/test_driver_upload.py::test_upload_returns_oob_when_called_from_form tests/test_driver_upload.py::test_upload_oob_autoselects_new_driver -x` | ✅ (file) / ❌ (test fns Wave 0) | ⬜ pending |
|
|
| 09-01-02 | 01 | 1 | UX-01 | integration (TDD green) | `pytest tests/test_driver_upload.py -x -v && pytest tests/ -x -q --ignore=tests/e2e` | ✅ | ⬜ pending |
|
|
| 09-01-03 | 01 | 1 | UX-01 | integration | `pytest tests/test_printer_form.py -x -v && pytest tests/ -x -q --ignore=tests/e2e` | ✅ | ⬜ pending |
|
|
| 09-02-01 | 02 (playwright-port-autofill) | 2 | UX-02 | setup | `python -c "import pytest_playwright, playwright; print('ok')" && pytest --collect-only tests/e2e/` | ✅ tests/e2e/__init__.py + tests/e2e/conftest.py | ✅ green |
|
|
| 09-02-02 | 02 | 2 | UX-02 | e2e (Playwright) | `pytest tests/e2e/test_port_autofill.py -v` | ✅ tests/e2e/test_port_autofill.py | ✅ green |
|
|
| 09-03-01 | 03 (script-download-links) | 1 | UX-03 | integration (TDD red) | `pytest tests/test_script_download.py tests/test_packages.py::TestCommandPreview::test_detail_page_shows_script_links -x` | ❌ W0 (test_script_download.py) / ✅ (test_packages.py) | ⬜ pending |
|
|
| 09-03-02 | 03 | 1 | UX-03 | integration (TDD green) | `pytest tests/test_script_download.py tests/test_packages.py::TestCommandPreview -x -v && pytest tests/ -x -q --ignore=tests/e2e` | ✅ | ⬜ pending |
|
|
|
|
*Status: ⬜ pending · ✅ green · ❌ red · ⚠️ flaky*
|
|
|
|
**Nyquist compliance:** Every task has an `<automated>` verify command. No 3 consecutive tasks without feedback. Wave 0 gaps tracked below.
|
|
|
|
---
|
|
|
|
## Wave 0 Requirements
|
|
|
|
- [ ] `tests/test_driver_upload.py` — add three new test functions: `test_upload_500_regression`, `test_upload_returns_oob_when_called_from_form`, `test_upload_oob_autoselects_new_driver` (+ optional `test_upload_no_oob_from_standalone_drivers_page`) — **Plan 09-01 Task 1**
|
|
- [x] `tests/e2e/__init__.py` + `tests/e2e/conftest.py` — create e2e package with session-scoped `live_server` fixture (uvicorn thread, free port, /health readiness poll, tmp data dir) — **Plan 09-02 Task 1** (commit 4e9bd9b)
|
|
- [x] `tests/e2e/test_port_autofill.py` — UX-02 Playwright test — **Plan 09-02 Task 2** (evidence: `pytest tests/e2e/test_port_autofill.py -v` → 1 passed)
|
|
- [ ] `tests/test_script_download.py` — new file with 5 tests covering .ps1 routes — **Plan 09-03 Task 1**
|
|
- [ ] `tests/test_packages.py::TestCommandPreview::test_detail_page_shows_script_links` — new assertion — **Plan 09-03 Task 1**
|
|
- [x] Dev deps: add `pytest-playwright` and `playwright` to `requirements-dev.txt`; run `pip install -r requirements-dev.txt && playwright install chromium` — **Plan 09-02 Task 1** (commit 4e9bd9b)
|
|
|
|
---
|
|
|
|
## Manual-Only Verifications
|
|
|
|
| Behavior | Requirement | Why Manual | Test Instructions |
|
|
|----------|-------------|------------|-------------------|
|
|
| Live browser visual confirmation of driver upload OOB refresh + auto-select | UX-01 | Success criterion explicitly requires "without manually reloading the page" — automated OOB contract tests cover the response shape; a one-time eyeball confirms the browser actually swaps the DOM | Start app, open the printer form, upload a real driver ZIP via the inline upload, confirm the driver dropdown updates and the new driver is auto-selected — no F5 pressed |
|
|
| Live browser visual confirmation of IP→port auto-fill (headed run) | UX-02 | Success criterion requires "observed live in a real browser and recorded in VALIDATION.md" — the Playwright headless test IS the record, but a `--headed` run once provides human-visible evidence | Run `pytest tests/e2e/test_port_autofill.py -v --headed`, observe the chromium window, paste terminal output snippet into 09-VALIDATION sign-off |
|
|
| Live browser click of 3 script download links | UX-03 | Success criterion says "can click direct download links ... individually" | Start app, open a printer detail page with a driver assigned, click each of the 3 links, confirm `install.ps1` / `uninstall.ps1` / `detect.ps1` download with correct PowerShell content |
|
|
|
|
*Automated coverage is primary; manual checks serve as the live-verification evidence required by the phase success criteria.*
|
|
|
|
---
|
|
|
|
## Validation Sign-Off
|
|
|
|
- [x] All tasks have `<automated>` verify or Wave 0 dependencies
|
|
- [x] Sampling continuity: no 3 consecutive tasks without automated verify
|
|
- [x] Wave 0 covers all MISSING references
|
|
- [x] No watch-mode flags
|
|
- [x] Feedback latency < 30s (quick suite)
|
|
- [x] `nyquist_compliant: true` set in frontmatter (task IDs finalized against PLAN.md)
|
|
|
|
**Approval:** nyquist contract approved; execution pending.
|