Repository navigation
test(e2e): settle redirected locale routes in a fresh document - #977
Merged
Merged
Conversation
An untranslated localized route renders the full Korean layout plus an
HTML refresh to the English page. On a cold dev server the English page
takes several hundred milliseconds to render, so the refresh commits while
the Korean document is still fetching its Vite modules. Chromium never
reports some of those aborted requests as finished, Playwright counts them
against the English document, and networkidle never fires, so
page.goto(route, { waitUntil: 'networkidle' }) times out.
Follow the refresh up to the English page's load event, then open the
target from about:blank and wait for networkidle there. Routes that do not
redirect keep the direct networkidle navigation.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
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
e2e/landing-dev.spec.ts:47의renders /ko/docs/features without a dev overlay or lazy import failure가 관련 없는 PR(#910, #915, #974)에서 계속 실패하던 문제를 고칩니다. 원인은 페이지가 느려서가 아니라 HTML refresh 리다이렉트와 Playwrightnetworkidle사이의 경쟁 조건입니다.근본 원인
/ko/docs/features는 번역본이 없어서[locale]/[[...slug]]/page.tsx가 한국어SiteLayout전체와<meta http-equiv="refresh" content="0;url=/docs/features">를 렌더링합니다./docs/features는 이 시점에 cold 상태라 렌더링이 오래 걸리고(CI:GET /docs/features 200 in 796ms (render: 731ms)), 그래서 새 문서는 이전 문서가 아직 모듈을 받는 도중에 커밋됩니다.networkidle이 영원히 오지 않고page.goto가 90초 타임아웃으로 끝납니다./ko→/도 같은 구조입니다. 다만/는 앞선 테스트에서 이미 warm 상태라 리다이렉트가 모듈 로딩 전에 끝나서 운 좋게 통과할 뿐입니다.증거
GET /ko/docs/features 200 in 113ms, 이어서GET /docs/features 200 in 796ms로 정상 응답합니다. 그 뒤 90초 동안 서버 요청은 없고, 테스트는navigating to ".../ko/docs/features", waiting until "networkidle"에서 타임아웃됩니다. 나머지 12개는 통과합니다./ko/docs/features문서 요청/docs/features요청(393ms 소요)status -1, time 14)lenis_react.js와 vinext 모듈 하나가status -1, time -1로 남음. wall clock 기준으로는 커밋 전에 시작한 요청인데, Playwright에는 커밋 뒤에 등록됐고 끝내 완료되지 않음. 같은 URL을 새 문서가 다시 요청해서 200을 받은 기록은 따로 있음수정
e2e/landing-dev.spec.ts에open()헬퍼를 추가했습니다.route === target이면 기존과 같이page.goto(route, { waitUntil: 'networkidle' })를 씁니다.goto(route, { waitUntil: 'commit' })로 원래 응답(200)을 받습니다.waitForURL(target, { waitUntil: 'load' })로 refresh가 실제로 영어 페이지에 도착하는지 확인합니다.about:blank를 거쳐goto(target, { waitUntil: 'networkidle' })로 깨끗한 문서에서 다시 settle합니다.이후 검증은 그대로입니다. dev overlay가 없어야 하고,
main이 렌더링돼야 하고, 테마 토글이 동작해야 하고, console이나 page error가 없어야 합니다(lazy import 실패 포함). 타임아웃은 늘리지 않았습니다. 테스트 전용 변경이라 changepack은 넣지 않았습니다.Test plan
bunx playwright test -c playwright.landing-dev.config.ts→/ko/docs/features90초 타임아웃 재현(1 failed / 12 passed)bunx prettier --single-quote --no-semi --check e2e/landing-dev.spec.tsRun Landing dev navigation tests(vinext)와(Next)단계🤖 Generated with Claude Code