Migrate browser tests to native @playwright/test - #60
Merged
Merged
Conversation
Ports the browser-mode suite off vitest browser-mode (@vitest/browser-playwright) onto native @playwright/test, following the askr-i18n phase-1 pattern (askrjs/askr-i18n#28). This decouples test:browser from vite-plus's internally pinned vitest version. - playwright.config.ts drives Chromium against the real vp dev server (127.0.0.1:4179), with server.host pinned to avoid the localhost vs 127.0.0.1 webServer readiness race on CI, plus piped stdout/stderr and a generous startup timeout for diagnostics - tests/browser/docs-search.test.tsx and marketing-layout.test.tsx -> docs-search.spec.ts and marketing-layout.spec.ts, faithful ports that navigate real routes on the served site and preserve every original assertion - removed vitest.test.browser.config.ts, @vitest/browser-playwright, and the standalone playwright devDependency (now pulled in transitively by @playwright/test); removed the orphaned tests/browser/__screenshots__ directory (gitignored, untracked, and unreferenced by any test - no screenshot assertions exist in the current suite) - test:browser/lint scripts updated accordingly
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
Migrates this repo's browser-mode test suite off vitest browser-mode (
@vitest/browser-playwright) onto native@playwright/test, following the reference pattern established in phase 1 (askrjs/askr-i18n#28). This decouplestest:browserfrom vite-plus's internally pinned vitest version, which has caused recurring unrelated breakage.What changed
playwright.config.tsdrives Chromium against the realvp devserver (this is an app repo with a real dev server, unlike the library-harness pattern from phase 1) —baseURLandwebServer.urlboth pinned to127.0.0.1:4179to avoid the localhost-vs-127.0.0.1 webServer readiness race that silently timed out CI in phase 1;stdout/stderrpiped and a generous startup timeout set proactivelytests/browser/docs-search.test.tsxandmarketing-layout.test.tsx→docs-search.spec.tsandmarketing-layout.spec.ts, faithful ports thatpage.goto()real routes on the served site (rather than mounting an isolated component tree) and preserve every original assertionvitest.test.browser.config.ts,@vitest/browser-playwright, and the standaloneplaywrightdevDependency (now pulled in transitively by@playwright/test)tests/browser/__screenshots__directory — it was gitignored/untracked and unreferenced by any test (notoMatchScreenshot/screenshot assertions exist in the current suite), so nothing needed porting totoHaveScreenshot()test:browser/lintscripts updated accordinglytest:unitis untouched and still runs on vitest viavp test run.Verification
npm run fmt:check,lint,typecheckall passnpm run test:unit— 40 tests passing (vitest, unchanged)npm run test:browser— 41 tests passing (new Playwright suite: 1 docs-search + 40 marketing-layout route/viewport/theme combinations)npm run build(client build, llms docs, SSG, generated-output-contract) passes