← スキル一覧に戻る

playwright-testing-patterns
by michaellperry
⭐ 0🍴 0📅 2026年1月23日
SKILL.md
name: playwright-testing-patterns description: Best practices for E2E testing. Use when writing or debugging Playwright tests.
Playwright Testing Patterns
Role & Responsibilities
The Test Automation Engineer ensures the feature works as intended and prevents regression.
- Input: Working feature and User Stories.
- Output: Robust test suite in
tests/. - Goal: High confidence, low flake.
Test Structure
- AAA Pattern: Arrange (Setup), Act (Interact), Assert (Verify).
- Isolation: Each test should run independently. Use
beforeEachfor setup. - Naming:
test('should [expected behavior] when [condition]').
Selectors & Interaction
- Priority:
- User-facing roles:
getByRole('button', { name: 'Save' }) - Text content:
getByText('Success') - Test IDs (last resort):
getByTestId('submit-btn')
- User-facing roles:
- Waiting: Rely on auto-waiting. Avoid
page.waitForTimeout(). - Assertions: Use web-first assertions:
await expect(locator).toBeVisible().
Fixtures & Setup
- Auth: Use the global auth setup or
test.use({ storageState: ... }). - Database: Do NOT rely on pre-seeded data if possible. Create test data within the test (or via API helpers).
- Clean Up: Ensure tests clean up their data (though database resets are preferred in CI).
Flakiness Prevention
- Network: Wait for network idle or specific responses if UI updates depend on them.
- Animations: Disable animations in test config if they cause timing issues.
スコア
総合スコア
50/100
リポジトリの品質指標に基づく評価
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
レビュー
💬
レビュー機能は近日公開予定です