playwright

playwright is a skill for Claude Code, Codex from shahidshabbir-se/my-pi-setup. It costs 26 tokens per session (751 once invoked), scanned A, a copy of playwright, MIT.

A guide to writing end-to-end tests for web applications with Playwright, a tool that checks a site by acting like a user in a browser. It covers test structure, page-element selection, and checks for expected results.

In plain words
What is it for?
Use it when creating or reviewing Playwright tests in JavaScript or TypeScript, such as checking login flows and other user journeys.
Why use it?
It helps avoid fragile tests and unclear failures by showing consistent ways to isolate tests, find page elements, and verify behavior.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it when creating or reviewing Playwright tests in JavaScript or TypeScript, such as checking login flows and other user journeys.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/shahidshabbir-se/my-pi-setup/playwright
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add shahidshabbir-se/my-pi-setup --skill playwright
Clone the repo
git clone --depth 1 https://github.com/shahidshabbir-se/my-pi-setup

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for playwright

README.md
[![agentmods](https://agentmods.dev/badge/skills/shahidshabbir-se/my-pi-setup/playwright/github.svg)](https://agentmods.dev/skills/shahidshabbir-se/my-pi-setup/playwright)
Your own site
<a href="https://agentmods.dev/skills/shahidshabbir-se/my-pi-setup/playwright"><img src="https://agentmods.dev/badge/skills/shahidshabbir-se/my-pi-setup/playwright/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for playwright

Your own site · 80×15
<a href="https://agentmods.dev/skills/shahidshabbir-se/my-pi-setup/playwright"><img src="https://agentmods.dev/badge/skills/shahidshabbir-se/my-pi-setup/playwright.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 26 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 751 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin 100% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00026 $0.00751
Opus 5 $0.00013 $0.00376
Sonnet 5 $0.00005 $0.00150
Haiku 4.5 $0.00003 $0.00075

Measured 12d ago against content hash 50dd78a9e301, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

playwright scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 12d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

100% identical to playwright — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

agent/skills/playwright/SKILL.md · 105 lines

How it starts

The opening of the file, as written. The whole thing — 105 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Playwright Testing Best Practices

You are a Senior QA Automation Engineer expert in TypeScript, JavaScript, and Playwright end-to-end testing.

Test Design Principles

Test Structure

  • Create descriptive test names that clearly explain expected behavior
  • Use Playwright fixtures (test, page, expect) for test isolation
  • Implement test.beforeEach and test.afterEach for clean state management
  • Keep tests DRY by extracting reusable logic into helper functions
import { test, expect } from '@playwright/test';

test.describe('User Authentication', () => {
  test.beforeEach(async ({ page }) => {
    await page.goto('/login');
  });

  test('should login successfully with valid credentials', async ({ page }) => {
    await page.getByLabel('Email').fill('[email protected]');
    await page.getByLabel('Password').fill('password123');
    await page.getByRole('button', { name: 'Sign In' }).click();

    await expect(page.getByRole('heading', { name: 'Dashboard' })).toBeVisible();
  });
});

Locator Strategy

Recommended Locators

  • page.getByRole() - Best for accessibility and user perspective
  • page.getByLabel() - For form inputs with labels
  • page.getByText() - For elements with visible text
  • page.getByTestId() - When data-testid attributes exist
  • page.getByPlaceholder() - For inputs with placeholder text
// Recommended
await page.getByRole('button', { name: 'Submit' }).click();
await page.getByLabel('Email address').fill('[email protected]');

// Avoid
await page.locator('.btn-primary').click();

Assertions and Waits

Web-First Assertions

Prefer web-first assertions that automatically wait and retry:

  • toBeVisible() - Element is visible
  • toHaveText() - Element has specific text
  • toHaveValue() - Input has specific value
  • toHaveURL() - Page URL assertion
// Recommended - web-first assertions
await expect(page.getByRole('alert')).toBeVisible();
await expect(page).toHaveURL('/dashboard');

// Avoid - hardcoded timeouts
await page.waitForTimeout(5000); // Never do this

Read the full file on GitHub · 105 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 12d ago First seen · 105 lines · 26 tokens per session scan A 50dd78a9e301

Subscribe to this mod's changes

playwright is a skill published in the GitHub repository shahidshabbir-se/my-pi-setup (2 stars, last pushed 3mo ago), licensed MIT. It adds 26 tokens to every session and 751 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to playwright, differing in 0 lines, and is treated as a copy.