test: add Playwright e2e specs for web tools and exclude e2e from Vitest#2
test: add Playwright e2e specs for web tools and exclude e2e from Vitest#2uyu423 wants to merge 1 commit intofeature/e2efrom
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8baec4ad23
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| await page.goto('/api-burst-test?locale=en-US'); | ||
| await expect(page.getByRole('heading', { level: 2 })).toContainText('API Burst Test'); |
There was a problem hiding this comment.
이 테스트는 ?locale=en-US로 영어 텍스트를 기대하지만, 앱의 locale 결정 로직은 URL prefix(/en-US/...)나 localStorage/브라우저 언어를 사용하고 쿼리 파라미터를 읽지 않습니다(예: apps/web/src/lib/i18nUtils.ts의 경로 기반 감지 로직). 따라서 Playwright 브라우저 locale이 ko-KR 등으로 설정된 환경에서는 UI 문자열이 영어가 아니어서 heading/Run 같은 assert가 실패할 수 있습니다. E2E 안정성을 위해 locale을 경로 prefix로 지정하거나 Playwright context locale 또는 localStorage를 설정해야 합니다.
Useful? React with 👍 / 👎.
Motivation
json-pretty-viewer.spec.ts샘플을 기준으로 각 도구별 시나리오를 Playwright 스펙으로 작성했습니다.TEST_CHECKLIST.md)와 실제 구현을 바탕으로 현실적인 E2E 시나리오를 구현했습니다.Description
apps/web/tests/e2e/아래에 각 도구별 Playwright 스펙 파일들을 추가했습니다 (예:api-tester.spec.ts,base64.spec.ts,cron.spec.ts,diff.spec.ts,hash.spec.ts,image-studio.spec.ts,json-pretty-viewer.spec.ts정리 등).apps/web/tests/e2e/json-pretty-viewer.spec.ts에서 사용되지 않는readFileSync/largeJson참조를 제거해 lint 오류를 해결했습니다.apps/web/vite.config.ts의 Vitest 설정에exclude: ['tests/e2e/**', '**/node_modules/**']를 추가해 E2E 스펙과 외부 패키지 테스트가 Vitest에 포함되지 않도록 했습니다.apps/web/tests/e2e의 새 스펙들을 저장소에 추가했습니다.Testing
pnpm lint를 실행해 초기no-unused-vars오류를 확인했고, 불필요한 변수 제거 후pnpm lint는 성공했습니다.pnpm test(Vitest)는tests/e2e/**및node_modules제외 설정 적용 후 단위 테스트가 통과하는 것을 확인했습니다.pnpm build는playwright.config.ts에서@playwright/test타입/모듈이 참조되어 있는 환경에서 실패했으며 이는 현재 빌드 환경에@playwright/test가 설치되지 않았기 때문입니다.pnpm --filter @yowu-devtools/web test:e2e -- <spec>)은 로컬 환경에 Playwright 바이너리/패키지가 설치되어 있지 않아 실행하지 못했음을 기록합니다.Codex Task