e2e

A command for creating and running end-to-end tests with Playwright. End-to-end tests check a complete user journey across the application, such as logging in, searching, or paying.

In plain words
What is it for?
Generating browser tests, running flows across Chrome, Firefox, and Safari, checking UI and backend integration, capturing failure artifacts, and producing reports.
Why use it?
It helps verify that connected parts of a web application work together and provides evidence when a journey fails.

Command for Claude Code

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 commands/cfrs2005/claude-init/e2e
Clone the repo
git clone --depth 1 https://github.com/cfrs2005/claude-init

Made for: Claude Code.

Per session 33 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,982 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.00033 $0.02982
Opus 5 $0.00016 $0.01491
Sonnet 5 $0.00007 $0.00596
Haiku 4.5 $0.00003 $0.00298

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

Security

Grade A, and why

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 2d 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

Copies of this mod

8 near-identical copies found in the catalogue:

  • e2e — 92% identical, 213 lines differ
  • e2e — 89% identical, 226 lines differ
  • e2e — 88% identical, 242 lines differ
  • e2e — 88% identical, 242 lines differ
  • e2e — 88% identical, 242 lines differ
  • e2e — 88% identical, 254 lines differ
  • e2e — 86% identical, 242 lines differ
  • e2e — 84% identical, 247 lines differ
templates/.claude/commands/e2e.md · 368 lines

How it starts

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

E2E 指令 (E2E Command)

此指令调用 E2E 运行者 (e2e-runner) 智能体,使用 Playwright 生成、维护和执行端到端测试。

此指令的功能

  1. 生成测试旅程 - 为用户流程创建 Playwright 测试
  2. 运行 E2E 测试 - 跨浏览器执行测试
  3. 捕获工件 - 在失败时捕获截图、视频和追踪
  4. 上传结果 - 生成 HTML 报告和 JUnit XML
  5. 识别不稳定测试 - 隔离不稳定的测试 (Flaky Tests)

何时使用

在以下情况使用 /e2e

  • 测试关键用户旅程(登录、交易、支付)
  • 验证多步骤流程是否端到端端正常工作
  • 测试 UI 交互和导航
  • 验证前端和后端之间的集成
  • 准备生产部署时

工作原理

E2E 运行者智能体将:

  1. 分析用户流程 并识别测试场景
  2. 生成 Playwright 测试 使用页面对象模型 (Page Object Model) 模式
  3. 运行测试 跨多个浏览器 (Chrome, Firefox, Safari)
  4. 捕获失败 包含截图、视频和追踪
  5. 生成报告 包含结果和工件
  6. 识别不稳定测试 并推荐修复方案

使用示例

User: /e2e Test the market search and view flow
(用户:/e2e 测试市场搜索和查看流程)

Agent (e2e-runner):
# E2E Test Generation: Market Search and View Flow
(E2E 测试生成:市场搜索和查看流程)

## Test Scenario Identified (识别的测试场景)

**User Journey (用户旅程):** Market Search (市场搜索) → View Results (查看结果) → Click Market (点击市场) → View Details (查看详情)

**Test Coverage (测试覆盖):**
1. Navigate to markets page (导航到市场页面)
2. Perform semantic search (执行语义搜索)
3. Verify search results (验证搜索结果)
4. Click on first result (点击第一个结果)
5. Verify market details page loads (验证市场详情页加载)
6. Verify chart renders (验证图表渲染)

## Generated Test Code (生成的测试代码)

```typescript
// tests/e2e/markets/search-and-view.spec.ts
import { test, expect } from '@playwright/test'
import { MarketsPage } from '../../pages/MarketsPage'
import { MarketDetailsPage } from '../../pages/MarketDetailsPage'

test.describe('Market Search and View Flow', () => {
  test('user can search markets and view details', async ({ page }) => {
    // 1. Navigate to markets page
    const marketsPage = new MarketsPage(page)
    await marketsPage.goto()

    // Verify page loaded
    await expect(page).toHaveTitle(/Markets/)
    await expect(page.locator('h1')).toContainText('Markets')

    // 2. Perform semantic search
    await marketsPage.searchMarkets('election')

    // Wait for API response
    await page.waitForResponse(resp =>
      resp.url().includes('/api/markets/search') && resp.status() === 200
    )

Read the full file on GitHub · 368 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. 2d ago First seen · 368 lines · 33 tokens per session scan A fa036e0d25bc

Subscribe to this mod's changes

e2e is a command published in the GitHub repository cfrs2005/claude-init (1,364 stars, last pushed 5mo ago), licensed MIT. It adds 33 tokens to every session and 2,982 once invoked, about $0.0002 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.