test: rebuild e2e suite on semantic selectors with real assertions - #66
Merged
Conversation
The Playwright suite navigated by hardcoded screen coordinates and its only assertion was body.innerHTML.length > 100, so it could not fail on wrong content — and its coordinates were already stale (the home Workouts tab no longer exists). - Enable Flutter web semantics behind --dart-define=ENABLE_SEMANTICS so Playwright targets widgets by accessible role/name instead of coordinates - Replace fixed waitForTimeout sleeps with auto-waiting selectors: the suite now runs in ~9s instead of minutes - Assert actual read-only behavior in coach views (no Edit workout / Start Session / Delete Session; Coach View chip present) - Add e2e/global-setup.ts: clears auth+firestore emulators and reseeds every run, so tests never depend on leftover state - Fix SessionCard missing tap semantics (assistive tech could not open session details at all) by exposing the card as a button - Fix seed_emulator.js writing session entries as an array field; the app reads the entries subcollection, so session detail always showed "No exercises recorded" - Split README screenshot generation into its own Playwright project so CI only runs the regression suite; regenerate screenshots for the current UI - CI: also wait for the Firestore emulator, cache emulator jars, upload the Playwright report and traces; retries + trace on-first-retry in config - run_e2e.sh: kill emulators it started on exit, --skip-build flag; add npm run e2e / e2e:quick / e2e:screenshots - Drop unused integration_test dependency; gitignore local run artifacts and untrack stray logs Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Playwright e2e suite navigated by hardcoded screen coordinates and its only assertion was
body.innerHTML.length > 100, so it could not fail on wrong content — and its coordinates were already stale (they clicked a home "Workouts" tab that no longer exists). This PR rebuilds it on Flutter web's semantics tree with real assertions. The suite now runs in ~9s locally (was minutes of fixed sleeps).Changes
lib/main.dartforce-enables the semantics tree behind--dart-define=ENABLE_SEMANTICS=true; specs target widgets by accessible role/name via shared helpers ine2e/helpers.tsinstead ofclickAt(x, y)+waitForTimeoute2e/global-setup.tsclears the auth+firestore emulators and reseeds before every runnpm run e2e:screenshots) so CI runs only the regression suiterun_e2e.shkills emulators it started, gains--skip-build; newnpm run e2e/e2e:quick/e2e:screenshots; unusedintegration_testdependency dropped; local run artifacts gitignored/untrackedBugs found by the new assertions
lib/widgets/session_card.dart).entriessubcollection, so seeded session details always showed "No exercises recorded". Fixed inscripts/seed_emulator.js.README screenshots regenerated to match the current 3-tab UI.
Test plan
npx playwright test --project=e2e— 4/4 pass locally against emulatorsnpx playwright test --project=screenshots— passes, screenshots verified non-blankflutter analyzeclean for changed files;flutter testfailures are pre-existing on main (tracked separately)🤖 Generated with Claude Code