playwright skill

Playwright Web Testing Expert

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "playwright skill" with this command: npx skills add chrysaliscat/designgraduation/chrysaliscat-designgraduation-playwright-skill

Playwright Web Testing Expert

Capabilities

  • Test Generation: Create robust E2E test suites for Vue.js/React apps.

  • Selector Strategy: Use user-facing locators (getByRole , getByText ) over CSS/XPath.

  • Debugging: Inspect traces, screenshots, and logs to fix flaky tests.

Best Practices

  1. Locators

Bad: page.locator('.submit-btn')

Good: page.getByRole('button', { name: 'Submit' })

Why? Resilient to layout changes, accessible by default.

  1. Assertions

Bad: const text = await page.textContent('.status'); expect(text).toBe('Success');

Good: await expect(page.locator('.status')).toHaveText('Success');

Why? Auto-retrying assertions handle async UI updates naturally.

  1. Isolation
  • Tests should be independent.

  • Use test.beforeEach to set up state.

  • Mock API responses for pure UI tests using page.route() .

Workflows

Writing a New Test

  • Identify Flow: e.g., "User logs in and adds item to cart".

  • Scaffold Spec: Create tests/e2e/login.spec.ts .

  • Write Steps: Use TDD. Write the await expect(...) first.

  • Run Codegen (Optional): Use npx playwright codegen to capture selectors if stuck.

Debugging Flakes

  • Run with trace: npx playwright test --trace on .

  • View report: npx playwright show-report .

  • Check "Network" tab for failed API calls.

  • Check "Action" log for timeout reasons.

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

ui/ux pro max

No summary provided by upstream source.

Repository SourceNeeds Review
General

web test case generator

No summary provided by upstream source.

Repository SourceNeeds Review
General

debugging-with-tools

No summary provided by upstream source.

Repository SourceNeeds Review
General

debugging expert

No summary provided by upstream source.

Repository SourceNeeds Review