All skills
asyrafhussin avatar

/e2e-playwright-testing

@c03e38f

End-to-end testing with Playwright for web applications. Use when writing E2E tests, browser automation, form submission testing, or user flow testing. Triggers on "playwright", "e2e test", "browser test", "end-to-end", "form flow testing", or test files in tests/e2e/.

Use this Skill: https://skilld.dev/gh/asyrafhussin/agent-skills/e2e-playwright-testing

This session only. Nothing lands on disk.

rules_sections.md

≈535 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Sections

This file defines all sections, their ordering, impact levels, and descriptions. The section ID (in parentheses) is the filename prefix used to group rules.


1. Locators (loc)

Impact: CRITICAL Description: Choosing the right locators is the foundation of reliable E2E tests. Prefer user-facing attributes (role, label, text) over implementation details (CSS classes, IDs). Use getByRole as the primary strategy, getByLabel/getByText as secondary, and CSS/XPath only as a last resort. Handle strict mode violations with { exact: true } or scoped locators.

2. Authentication (auth)

Impact: CRITICAL Description: Authentication is the most common E2E bottleneck. Log in once per role using the setup project pattern, save browser state (cookies + localStorage) to JSON files, and reuse via storageState in test contexts. Never log in per-test — it wastes time and creates flaky rate-limit failures.

3. Assertions (assert)

Impact: HIGH Description: Use Playwright's web-first assertions (expect(locator)) which auto-retry until the condition is met or timeout. Never use page.$(selector) + manual checks. Assert on user-visible state (text content, visibility, enabled/disabled), not internal implementation.

4. Forms & Inputs (form)

Impact: HIGH Description: Form testing catches the most real bugs in web apps. Handle React controlled inputs correctly — fill() works for text but keyboard.type() is needed for date/time pickers. Custom checkbox components using sr-only patterns need special click handling to avoid double-toggle bugs.

5. Test Organization (org)

Impact: MEDIUM Description: Organize tests by feature area mirroring your route structure. Use custom fixtures for role-based authentication. Keep test files focused — one describe block per page or feature.

6. Reliability (rel)

Impact: MEDIUM Description: Flaky tests destroy CI confidence. Never use arbitrary waitForTimeout — use auto-waiting locators and web-first assertions instead. Run tests sequentially when they share mutable database state.

Source: SKILL.md on GitHub

No alerts16d4 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides a comprehensive set of best practices and patterns for writing reliable end-to-end tests using Playwright. It focuses on locator strategies, authentication reuse, form handling, and test organization. No security issues were detected.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at c03e38f. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub last month.

Steadyupdated 6 months ago
Other metadata
metadata
{
  "author": "Agent Skills Contributors",
  "version": "1.0.0",
  "playwrightVersion": "1.50+",
  "nodeVersion": "18+"
}

README badge

README badge for asyrafhussin/agent-skills/e2e-playwright-testing