Skip to content

Add Playwright E2E tests#9

Open
kokoichi206 wants to merge 2 commits into
mainfrom
feature/playwright-e2e-tests
Open

Add Playwright E2E tests#9
kokoichi206 wants to merge 2 commits into
mainfrom
feature/playwright-e2e-tests

Conversation

@kokoichi206
Copy link
Copy Markdown
Owner

Summary

  • Playwright E2E テストを追加(22テスト)
  • コンテンツスクリプト注入、ルールマッチング(urlOnly, signals + 各エクストラクタ)、優先度、表示スタイル、オプションページ CRUD、ストレージ同期をカバー
  • CI に e2e ジョブを追加(--headless=new でヘッドレス実行)

Changes

ファイル 内容
playwright.config.ts Playwright 設定(Chromium, workers:1, serve で静的ページ配信)
e2e/fixtures/extension.ts persistent context で拡張ロード、seedRules/seedDisplayStyle ヘルパー
e2e/fixtures/test-rules.ts テスト用ルール定義(7パターン)
e2e/pages/*.html テスト用静的 HTML(6ページ)
e2e/specs/content-script.spec.ts コンテンツスクリプト注入テスト(4件)
e2e/specs/rule-matching.spec.ts ルールマッチングテスト(10件)
e2e/specs/options-page.spec.ts オプションページ CRUD テスト(6件)
e2e/specs/storage-sync.spec.ts ストレージ同期テスト(2件)
src/content/ui/overlay.ts Shadow DOM を closed → open に変更
.github/workflows/ci.yml e2e ジョブ追加
package.json devDependencies + scripts 追加

Test plan

  • pnpm test — 既存ユニットテスト 60件パス
  • pnpm test:e2e — E2E テスト 22件パス(ヘッドレス)
  • CI e2e ジョブが正常完了すること

🤖 Generated with Claude Code

kokoichi206 and others added 2 commits February 10, 2026 14:10
- Add Playwright with persistent context to load the extension in Chromium
- Test content script injection, rule matching (urlOnly, signals with
  meta/domTextRegex/titleRegex/selectorText extractors), priority
  ordering, display styles (topBar/ribbon/combo), and disabled rules
- Test options page CRUD (add/edit/delete/toggle/export/display style)
- Test storage sync between options page and content script
- Add CI e2e job using pre-built artifact from test-and-build job
- Change Shadow DOM from closed to open for test accessibility
- Default to headless via --headless=new, HEADED=1 for headed mode

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Filter service workers by chrome-extension:// URL with timeout
- Add comment explaining headless:false + --headless=new requirement
- Switch npx to pnpm exec for lockfile-consistent execution
- Add trace: retain-on-failure for CI debugging
- Upload playwright-report artifact on failure

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant