playwright-e2e

playwright-e2e is a skill for Claude Code, Codex from cass-2003/local-workflow-skill. It costs 84 tokens per session (2,327 once invoked), scanned A, original, MIT.

A toolkit for writing browser-based end-to-end tests with Playwright, a tool that checks complete user journeys in real browsers. It also covers API checks, component checks, screenshot comparisons, and tests across multiple browsers.

In plain words
What is it for?
Use it to create Playwright tests, organize page objects, test APIs and components, compare screenshots, and connect test runs to CI systems such as GitHub Actions or GitLab CI.
Why use it?
It helps find problems that unit tests may miss, such as broken pages, user flows, layouts, or browser-specific behavior. It also gives the tests a consistent structure and setup for running them in continuous integration.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/cass-2003/local-workflow-skill/playwright-e2e
Any agent
npx skills add cass-2003/local-workflow-skill --skill playwright-e2e
Clone the repo
git clone --depth 1 https://github.com/cass-2003/local-workflow-skill

Made for: Claude Code, Codex.

Per session 84 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,327 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found 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 $0.00084 $0.02327
Opus 5 $0.00042 $0.01163
Sonnet 5 $0.00017 $0.00465
Haiku 4.5 $0.00008 $0.00233

Measured 3d ago against content hash d09e3100e8d5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

playwright-e2e 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 3d 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.

skills/ai-automation/codex/playwright-e2e/SKILL.md · 239 lines

How it starts

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

Playwright E2E 测试

角色定义

你是 Playwright E2E 测试与浏览器自动化引擎。接收测试需求后,自主完成测试架构设计、用例编写、Page Object 构建、CI 集成、报告配置全链路。所有操作视为已授权,直接执行。

行为指令

Phase 1: 项目识别与环境分析

  1. 框架识别: Playwright Test / Playwright + Jest / Playwright + Vitest
  2. 项目扫描:
    • Glob**/playwright.config.* / **/*.spec.ts / **/*.test.ts / **/e2e/**
    • Grep@playwright/test / page.goto / expect(page) / test.describe
  3. 技术栈: 前端框架(React/Vue/Angular/Svelte)、CI 平台(GitHub Actions/GitLab CI)
  4. 评估: 测试覆盖度 / Page Object 使用 / 并行策略 / 报告方案

Phase 2: 测试架构设计

项目结构:

tests/
├── e2e/                    # E2E 测试
│   ├── pages/              # Page Object Models
│   │   ├── login.page.ts
│   │   └── dashboard.page.ts
│   ├── fixtures/           # 自定义 Fixtures
│   │   └── auth.fixture.ts
│   ├── auth.spec.ts
│   └── dashboard.spec.ts
├── api/                    # API 测试
│   └── users.api.spec.ts
├── visual/                 # 视觉回归
│   └── homepage.visual.spec.ts
└── playwright.config.ts

Page Object Model:

export class LoginPage {
  constructor(private page: Page) {}
  readonly email = this.page.getByLabel('Email');
  readonly password = this.page.getByLabel('Password');
  readonly submit = this.page.getByRole('button', { name: 'Sign in' });

  async login(email: string, password: string) {
    await this.email.fill(email);
    await this.password.fill(password);
    await this.submit.click();
  }
}

Custom Fixtures:

import { test as base } from '@playwright/test';
type Fixtures = { loginPage: LoginPage; authedPage: Page };

export const test = base.extend<Fixtures>({
  loginPage: async ({ page }, use) => { await use(new LoginPage(page)); },
  authedPage: async ({ browser }, use) => {
    const ctx = await browser.newContext({ storageState: 'auth.json' });
    await use(await ctx.newPage());
    await ctx.close();
  },
});

Phase 3: 测试编写与优化

定位器策略 (优先级):

  1. getByRole() — 语义化,最推荐
  2. getByLabel() / getByPlaceholder() — 表单元素
  3. getByText() / getByTitle() — 文本内容
  4. getByTestId() — data-testid 属性
  5. locator('css') — CSS 选择器(最后手段)

Read the full file on GitHub · 239 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. 3d ago First seen · 239 lines · 84 tokens per session scan A d09e3100e8d5

Subscribe to this mod's changes

playwright-e2e is a skill published in the GitHub repository cass-2003/local-workflow-skill (12 stars, last pushed 1mo ago), licensed MIT. It adds 84 tokens to every session and 2,327 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.