e2e

A command for creating and running end-to-end tests with Playwright. End-to-end tests imitate complete user journeys, such as logging in, searching, or paying, across the application’s interface and backend.

In plain words
What is it for?
Use it to test important workflows, browser interactions, navigation, frontend-backend integration, and release readiness, with failure reports and captured debugging files.
Why use it?
It helps verify that multiple parts of an application work together and provides evidence when a user flow fails.

Command

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/codelably/harmony-claude-code/e2e
Clone the repo
git clone --depth 1 https://github.com/codelably/harmony-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,900 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 88% 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 $0.00033 $0.02900
Opus 5 $0.00016 $0.01450
Sonnet 5 $0.00007 $0.00580
Haiku 4.5 $0.00003 $0.00290

Measured 2d ago against content hash be8ecba163ce, 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

This is a copy

88% identical to e2e — 254 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.

commands/e2e.md · 364 lines

How it starts

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

E2E 命令

此命令调用 e2e-runner 智能体(Agent)来使用 Playwright 生成、维护和执行端到端测试(End-to-End Tests/E2E)。

此命令的作用

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

何时使用

在以下场景使用 /e2e

  • 测试关键用户旅程(登录、交易、支付)
  • 验证多步骤流程的端到端运行情况
  • 测试 UI 交互和导航
  • 验证前端与后端之间的集成
  • 为生产环境部署做准备

工作原理

e2e-runner 智能体将执行以下操作:

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

使用示例

用户:/e2e 测试市场搜索和查看流程

智能体 (e2e-runner):
# E2E 测试生成:市场搜索和查看流程

## 识别出的测试场景

**用户旅程:** 市场搜索 → 查看结果 → 点击市场 → 查看详情

**测试覆盖范围:**
1. 导航到市场页面
2. 执行语义搜索
3. 验证搜索结果
4. 点击第一个结果
5. 验证市场详情页面加载
6. 验证图表渲染

## 生成的测试代码

```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. 导航到市场页面
    const marketsPage = new MarketsPage(page)
    await marketsPage.goto()

    // 验证页面加载
    await expect(page).toHaveTitle(/Markets/)
    await expect(page.locator('h1')).toContainText('Markets')

    // 2. 执行语义搜索
    await marketsPage.searchMarkets('election')

    // 等待 API 响应
    await page.waitForResponse(resp =>
      resp.url().includes('/api/markets/search') && resp.status() === 200
    )

    // 3. 验证搜索结果
    const marketCards = marketsPage.marketCards
    await expect(marketCards.first()).toBeVisible()
    const resultCount = await marketCards.count()
    expect(resultCount).toBeGreaterThan(0)

    // 截取搜索结果截图
    await page.screenshot({ path: 'artifacts/search-results.png' })

    // 4. 点击第一个结果
    const firstMarketTitle = await marketCards.first().textContent()
    await marketCards.first().click()

Read the full file on GitHub · 364 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 · 364 lines · 33 tokens per session scan A be8ecba163ce

Subscribe to this mod's changes

e2e is a command published in the GitHub repository codelably/harmony-claude-code (42 stars, last pushed 6mo ago), licensed MIT. It adds 33 tokens to every session and 2,900 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. It is 88% identical to e2e, differing in 254 lines, and is treated as a copy.