|
| 1 | +# Feature 068: Playwright Local Critical User Flows |
| 2 | +> **Status:** 🗒️ Planning |
| 3 | +> **Priority:** High |
| 4 | +> **Estimated Effort:** Small (< 1 sprint) |
| 5 | +> **Dependencies:** Feature 062 (Functional E2E Test Suite) |
| 6 | +
|
| 7 | +## Overview |
| 8 | + |
| 9 | +Define and implement a focused Playwright E2E coverage baseline for the most critical day-to-day user journeys in the local development environment. This feature intentionally limits scope to three flows: adding transactions, adding accounts, and adding categories. |
| 10 | + |
| 11 | +Tests are designed to run against the local API-hosted client during development and debugging, while remaining excluded from GitHub Actions until the suite is stabilized. |
| 12 | + |
| 13 | +## Problem Statement |
| 14 | + |
| 15 | +### Current State |
| 16 | + |
| 17 | +- E2E direction exists, but core create flows are not guaranteed by a single minimal, high-signal local suite. |
| 18 | +- Developers can introduce regressions in critical create workflows without immediate local Playwright feedback. |
| 19 | +- CI execution scope for E2E is intentionally conservative and should not be expanded yet. |
| 20 | + |
| 21 | +### Target State |
| 22 | + |
| 23 | +- A small Playwright suite validates the three core creation workflows end-to-end. |
| 24 | +- Tests are easy to run locally against the standard development host. |
| 25 | +- GitHub Actions does not execute this new local-critical suite yet. |
| 26 | + |
| 27 | +--- |
| 28 | + |
| 29 | +## User Stories |
| 30 | + |
| 31 | +### Core Local E2E Coverage |
| 32 | + |
| 33 | +#### US-068-001: Add Transaction Flow |
| 34 | +**As a** developer |
| 35 | +**I want to** validate the transaction creation flow end-to-end with Playwright locally |
| 36 | +**So that** transaction input regressions are caught early |
| 37 | + |
| 38 | +**Acceptance Criteria:** |
| 39 | +- [ ] Playwright test creates a transaction through the UI on local environment |
| 40 | +- [ ] Saved transaction appears in the expected list/calendar context |
| 41 | +- [ ] Test asserts success feedback and persisted visible result |
| 42 | + |
| 43 | +#### US-068-002: Add Account Flow |
| 44 | +**As a** developer |
| 45 | +**I want to** validate account creation end-to-end with Playwright locally |
| 46 | +**So that** account setup regressions are caught before merge |
| 47 | + |
| 48 | +**Acceptance Criteria:** |
| 49 | +- [ ] Playwright test creates an account through the UI on local environment |
| 50 | +- [ ] New account is selectable/visible in account UI |
| 51 | +- [ ] Test asserts resulting state reflects the created account |
| 52 | + |
| 53 | +#### US-068-003: Add Category Flow |
| 54 | +**As a** developer |
| 55 | +**I want to** validate category creation end-to-end with Playwright locally |
| 56 | +**So that** category-management regressions are detected quickly |
| 57 | + |
| 58 | +**Acceptance Criteria:** |
| 59 | +- [ ] Playwright test creates a category through the UI on local environment |
| 60 | +- [ ] New category appears in category management UI and is usable in relevant forms |
| 61 | +- [ ] Test asserts created category can be selected where applicable |
| 62 | + |
| 63 | +#### US-068-004: Local-Only Execution Scope |
| 64 | +**As a** maintainer |
| 65 | +**I want to** keep this suite local-only for now |
| 66 | +**So that** CI runtime and flakiness risk stay controlled while scenarios mature |
| 67 | + |
| 68 | +**Acceptance Criteria:** |
| 69 | +- [ ] Local command/documentation exists for running the critical Playwright suite |
| 70 | +- [ ] GitHub Actions workflows do not run this new suite |
| 71 | +- [ ] CI exclusion approach is explicit and documented (e.g., path/suite filter or separate non-invoked workflow) |
| 72 | + |
| 73 | +--- |
| 74 | + |
| 75 | +## Technical Design |
| 76 | + |
| 77 | +### Test Architecture |
| 78 | + |
| 79 | +Target structure in `tests/BudgetExperiment.E2E.Tests`: |
| 80 | + |
| 81 | +- `Tests/FunctionalTests/TransactionCreateTests.cs` |
| 82 | +- `Tests/FunctionalTests/AccountCreateTests.cs` |
| 83 | +- `Tests/FunctionalTests/CategoryCreateTests.cs` |
| 84 | + |
| 85 | +Common conventions: |
| 86 | +- Use resilient selectors (role/label/test-id based where available) |
| 87 | +- Use unique test data suffixes to avoid collisions |
| 88 | +- Keep each test independent and cleanup-safe when practical |
| 89 | + |
| 90 | +### Local Environment Execution |
| 91 | + |
| 92 | +Per repository workflow, run only the API project locally (the API hosts the Blazor client): |
| 93 | + |
| 94 | +```powershell |
| 95 | +dotnet run --project c:\ws\BudgetExperiment\src\BudgetExperiment.Api\BudgetExperiment.Api.csproj |
| 96 | +``` |
| 97 | + |
| 98 | +Then execute the focused Playwright E2E tests for these critical flows. |
| 99 | + |
| 100 | +### CI Exclusion Strategy (Initial) |
| 101 | + |
| 102 | +For this feature phase, keep execution local-only by one of the following: |
| 103 | +- Ensure existing GitHub Action test filters do not include these specific tests, or |
| 104 | +- Place them under a naming/category convention that current CI selection excludes. |
| 105 | + |
| 106 | +No change is required to enable CI execution in this feature. A future feature can promote these tests into CI once stability is proven. |
| 107 | + |
| 108 | +--- |
| 109 | + |
| 110 | +## Implementation Plan |
| 111 | + |
| 112 | +### Phase 1: Add Focused Local Critical Flow Tests |
| 113 | + |
| 114 | +**Objective:** Introduce the three high-value create-flow Playwright tests. |
| 115 | + |
| 116 | +**Tasks:** |
| 117 | +- [ ] Add transaction create E2E test |
| 118 | +- [ ] Add account create E2E test |
| 119 | +- [ ] Add category create E2E test |
| 120 | +- [ ] Verify all three pass locally against API-hosted client |
| 121 | + |
| 122 | +**Commit:** |
| 123 | +- `test(e2e): add local critical create-flow playwright tests` |
| 124 | + |
| 125 | +### Phase 2: Ensure CI Exclusion and Document Local Run Path |
| 126 | + |
| 127 | +**Objective:** Keep suite local-only and make intent explicit. |
| 128 | + |
| 129 | +**Tasks:** |
| 130 | +- [ ] Verify GitHub Actions does not execute this critical local suite |
| 131 | +- [ ] Document local run commands and prerequisites |
| 132 | +- [ ] Document CI exclusion rationale in test docs/workflow notes |
| 133 | + |
| 134 | +**Commit:** |
| 135 | +- `docs(ci): document local-only execution for critical playwright flows` |
| 136 | + |
| 137 | +--- |
| 138 | + |
| 139 | +## Testing Strategy |
| 140 | + |
| 141 | +### E2E Scenarios (Playwright) |
| 142 | + |
| 143 | +- [ ] Create transaction and verify visibility in primary transaction/calendar UI |
| 144 | +- [ ] Create account and verify it appears/selects in account controls |
| 145 | +- [ ] Create category and verify it appears in category UI and transaction category picker |
| 146 | + |
| 147 | +### Manual Verification Checklist |
| 148 | + |
| 149 | +- [ ] Start API locally and confirm client is served |
| 150 | +- [ ] Run focused Playwright critical-flow tests locally |
| 151 | +- [ ] Confirm tests are not included in current GitHub Actions execution |
| 152 | + |
| 153 | +--- |
| 154 | + |
| 155 | +## Risks and Mitigations |
| 156 | + |
| 157 | +- **Risk:** UI selector instability causes flaky tests. |
| 158 | + **Mitigation:** Prefer semantic selectors and add stable test IDs only where needed. |
| 159 | +- **Risk:** Local data collisions across repeated runs. |
| 160 | + **Mitigation:** Use unique test data identifiers and isolate scenarios. |
| 161 | +- **Risk:** Future drift between local and CI expectations. |
| 162 | + **Mitigation:** Keep CI exclusion explicitly documented and revisit in a follow-up feature. |
| 163 | + |
| 164 | +--- |
| 165 | + |
| 166 | +## Related Features |
| 167 | + |
| 168 | +- Feature 062: Functional E2E Test Suite |
| 169 | +- Feature 059: Performance E2E tests |
| 170 | + |
| 171 | +--- |
| 172 | + |
| 173 | +## Changelog |
| 174 | + |
| 175 | +| Date | Author | Description | |
| 176 | +|------|--------|-------------| |
| 177 | +| 2026-02-14 | AI | Created feature doc for local-only Playwright critical create-flow coverage | |
0 commit comments