Back to list
michaellperry

playwright-testing-patterns

by michaellperry

0🍴 0📅 Jan 23, 2026

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 beforeEach for setup.
  • Naming: test('should [expected behavior] when [condition]').

Selectors & Interaction

  • Priority:
    1. User-facing roles: getByRole('button', { name: 'Save' })
    2. Text content: getByText('Success')
    3. Test IDs (last resort): getByTestId('submit-btn')
  • 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.

Score

Total Score

50/100

Based on repository quality metrics

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

Reviews

💬

Reviews coming soon