perf(e2e): navigate to game states via URL routing and localStorage injection#74
Open
adrienbrault wants to merge 5 commits into
Open
perf(e2e): navigate to game states via URL routing and localStorage injection#74adrienbrault wants to merge 5 commits into
adrienbrault wants to merge 5 commits into
Conversation
…njection
The screenshot tests were spending 1-2s per test on click-through navigation
(landing → start solo → pick difficulty → board). The app exposes direct routes
for each screen, which eliminates the full SPA click-through overhead.
- gotoSoloGame: replaced 3-step click-through with page.goto("/solo/easy/e2e-screenshot-test")
- daily challenge test: page.goto("/daily") instead of landing → button click
- join game test: page.goto("/join") instead of landing → button click
- "in progress" test: inject pre-built SavedGame into localStorage so the board
restores a realistic in-progress state (given cells + 6 user fills + pencil notes)
without any UI interaction loop or artificial waitForTimeout calls.
Previously 5.19s avg; now ~1.7s avg — same as other direct-nav tests.
https://claude.ai/code/session_01KZVJRBbKGBnppCXDpeJAzW
…enshot This test called gotoSoloGame and immediately took a screenshot with no DOM injection — producing an output identical to "solo game". The "hidden bars" state is already covered by every solo game screenshot, making this 9-project test a duplicate that adds ~15s of serial test time. https://claude.ai/code/session_01KZVJRBbKGBnppCXDpeJAzW
…rojects Dark mode and the "with friends" landing variant test theming and data display, not viewport-specific layout. Running them on all 9 projects adds test volume without catching layout regressions. Add grepInvert: /dark mode|with friends/ to the 7 secondary projects (iPhone 14, iPad Mini, iPhone 14 Safari, iPhone 14 Landscape, iPhone SE Landscape, iPhone 14 Landscape Safari, iPhone SE Landscape Safari). iPhone SE and Desktop retain full test coverage including all variants. Also promote Desktop to a primary project alongside iPhone SE so it appears first in the project list alongside the other primary project. https://claude.ai/code/session_01KZVJRBbKGBnppCXDpeJAzW
Each isolated Playwright test pays a fixed ~1.25s cost for browser context creation + initial navigation. With 129 tests, that was ~160s of pure overhead that contributed nothing to the screenshots themselves. Restructured to a single "all screenshots" test per project. All 13-19 screenshot scenarios for a device run sequentially within one shared browser context. Variant screenshots (dark mode, numpad position) use page.reload() after setting localStorage — a ~400ms reload vs ~1.25s new context. Primary projects (iPhone SE, Desktop) run the full 19-scenario suite including dark-mode and with-friends variants. Secondary projects run the 13-scenario subset via an isPrimary() check. Each scenario uses test.step() for granularity in test reports. Also removed waitForTimeout(150) in the win modal step in favour of waiting for the injected overlay element to appear. Results: 129 tests → 9 tests | 266s serial → 127s serial | 75s wall → 26s wall https://claude.ai/code/session_01KZVJRBbKGBnppCXDpeJAzW
With one test per project, setting workers=9 ensures all 9 project tests start simultaneously rather than queuing. Previously grepInvert was used to filter dark-mode tests from secondary projects at the config level; this is now handled via isPrimary() inside the consolidated test, so the LAYOUT_ONLY regex and per-project grepInvert are no longer needed. https://claude.ai/code/session_01KZVJRBbKGBnppCXDpeJAzW
Deploying sudoku with
|
| Latest commit: |
49be74f
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e51af3b4.sudoku-4cc.pages.dev |
| Branch Preview URL: | https://claude-optimize-e2e-tests-op.sudoku-4cc.pages.dev |
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.
The screenshot tests were spending 1-2s per test on click-through navigation
(landing → start solo → pick difficulty → board). The app exposes direct routes
for each screen, which eliminates the full SPA click-through overhead.
restores a realistic in-progress state (given cells + 6 user fills + pencil notes)
without any UI interaction loop or artificial waitForTimeout calls.
Previously 5.19s avg; now ~1.7s avg — same as other direct-nav tests.
https://claude.ai/code/session_01KZVJRBbKGBnppCXDpeJAzW