Claude-skill-registry e2e-test
E2Eテストコーディングエージェント。ユーザーシナリオテスト、UIテスト、APIテスト、クロスブラウザテストを実現。キーワード: E2Eテスト, e2e test, 統合テスト, integration test, Playwright, Cypress.
install
source · Clone the upstream repo
git clone https://github.com/majiayu000/claude-skill-registry
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/e2e-test" ~/.claude/skills/majiayu000-claude-skill-registry-e2e-test-05afe3 && rm -rf "$T"
manifest:
skills/data/e2e-test/SKILL.mdsource content
E2Eテストコーディングエージェント
役割
E2E(End-to-End)テストの設計と実装を担当します。
E2Eテスト設計原則
ユーザーシナリオベース
1. ユーザーがログイン 2. ダッシュボードを表示 3. 新規アイテムを作成 4. アイテム一覧に表示されることを確認
ページオブジェクトパターン
テストコードの保守性を高めるため、ページ操作をオブジェクトとして抽象化
テストフレームワーク
Playwright (推奨)
# インストール npm init playwright@latest # テスト実行 npx playwright test # UIモード npx playwright test --ui # レポート表示 npx playwright show-report
テストファイル配置:
e2e/ または tests/e2e/
Cypress
# インストール npm install cypress --save-dev # テスト実行 npx cypress run # インタラクティブモード npx cypress open
テストファイル配置:
cypress/e2e/
API E2Eテスト (Supertest)
# TypeScript/Node.js npm install supertest --save-dev
import request from 'supertest'; import app from '../src/app'; describe('API E2E', () => { it('GET /items returns list', async () => { const res = await request(app) .get('/items') .expect(200); expect(res.body).toBeInstanceOf(Array); }); });
テスト環境
環境変数
# .env.test API_BASE_URL=http://localhost:3000 TEST_USER_EMAIL=test@example.com TEST_USER_PASSWORD=testpass123
テストデータ
- テスト専用のシードデータを使用
- テスト終了後にクリーンアップ
- 他のテストに依存しない独立したデータ
クロスブラウザテスト
Playwright設定
// playwright.config.ts export default defineConfig({ projects: [ { name: 'chromium', use: { ...devices['Desktop Chrome'] } }, { name: 'firefox', use: { ...devices['Desktop Firefox'] } }, { name: 'webkit', use: { ...devices['Desktop Safari'] } }, ], });
CI/CD統合
GitHub Actions
- name: Run E2E tests run: npx playwright test env: CI: true
レポート保存
- name: Upload test results uses: actions/upload-artifact@v4 if: always() with: name: playwright-report path: playwright-report/
待機処理
// 要素の表示を待機 await page.waitForSelector('[data-testid="item-list"]'); // ネットワークアイドルを待機 await page.waitForLoadState('networkidle'); // カスタム条件を待機 await page.waitForFunction(() => document.querySelectorAll('.item').length > 0 );
出力形式
E2Eテスト作成完了時に以下を報告:
- 作成したテストファイル: ファイルパスとシナリオ概要
- テストシナリオ一覧: 各シナリオの説明
- 実行コマンド: テストの実行方法
- 環境要件: 必要な環境変数、起動すべきサービス
- レポートパス: テストレポートの出力先