create-test

A command for creating an end-to-end (E2E) browser test by exploring an application's pages and turning a user journey into browser actions and checks.

In plain words
What is it for?
Use it to define a page flow and expected results, inspect screenshots and existing tests, examine source code when needed, and create a new test file.
Why use it?
It helps choose useful selectors and assertions based on the actual interface, reducing the chance of writing tests that do not match the application. It also checks existing tests to avoid unnecessary duplication.

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/fastslack/mtw-e2e-runner/create-test
Clone the repo
git clone --depth 1 https://github.com/fastslack/mtw-e2e-runner
Per session 15 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 803 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.00015 $0.00803
Opus 5 $0.00008 $0.00402
Sonnet 5 $0.00003 $0.00161
Haiku 4.5 $0.00002 $0.00080

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

Security

Grade A, and why

create-test 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 yesterday.

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.

.opencode/commands/create-test.md · 64 lines

How it starts

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

Create E2E Test

Help the user create a new E2E test file by exploring the application and designing appropriate test actions.

Workflow

  1. Understand the goal — Ask the user what they want to test if not already specified. Identify the page(s), user flow, and expected outcomes.

  2. Check pool — Call e2e_pool_status to ensure the Chrome pool is available.

  3. Explore the UI — Use e2e_capture to screenshot the target page(s). This helps understand the current state of the UI, available elements, and layout.

  4. Check existing tests — Call e2e_list to see what test suites already exist. Read relevant existing test files with Read to follow conventions and avoid duplication.

  5. Explore source code (optional) — If needed, use Grep and Read to find selectors, form field IDs, API endpoints, or component structure in the application source code.

  6. Design the test — Based on UI exploration and source code analysis, design the test actions:

    • Use the most specific selectors available (data-testid > id > class > text)
    • Prefer granular assertion actions over evaluate
    • Use framework-aware actions for React/MUI (type_react, click_option, focus_autocomplete)
    • Add wait actions before assertions on dynamic content
    • Add assert_no_network_errors after critical page loads
    • Consider adding an expect field for visual verification
    • DRY: If auth/setup is repeated across tests, use beforeEach hook (object format) instead of repeating per test
    • DRY: If 3+ tests repeat the same action pattern, create a module with e2e_create_module first
  7. Create the test — Call e2e_create_test with the designed test structure.

    • Check existing modules (e2e/modules/) — reuse them via $use instead of duplicating actions
    • Create new modules with e2e_create_module for repeated sequences (auth, navigation, screenshot patterns)
    • Use object format { "beforeEach": [...], "tests": [...] } when hooks are needed

Read the full file on GitHub · 64 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. yesterday First seen · 64 lines · 15 tokens per session scan A c5d3d9f1f639

Subscribe to this mod's changes

create-test is a command published in the GitHub repository fastslack/mtw-e2e-runner (3 stars, last pushed 2mo ago), licensed Apache-2.0. It adds 15 tokens to every session and 803 once invoked, about $0.0001 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-31.