e2e_create_test
Creates a new JSON E2E test suite from declarative browser actions and hooks, letting agents define executable tests while avoiding fragile evaluate scripts.
Instructions
Create a new E2E test JSON file. Prefer built-in actions over evaluate — more robust and readable. Full catalog: the e2e-testing skill / references/action-types.md.
Action cheat-sheet:
Click: click (by text), click_regex, click_menu_item, click_option, click_chip, click_icon, click_in_context; in a dialog use click with scope:"dialog" (+ last/visible).
Select (MUI): select_combobox (open+optional filter+pick), select, focus_autocomplete.
Assert text: assert_text (present), assert_no_text (absent), assert_text_in (scoped regex), assert_element_text, assert_matches.
Assert elements (selector, NOT text): assert_visible, assert_not_visible, assert_count, assert_attribute, assert_input_value, assert_url.
Nav/wait: goto, navigate (SPA), wait {text|selector|gone|value(ms)}, wait_network_idle.
Form: type, type_react (React inputs; optional blur/waitAfter), clear, press.
Field rules: assert_text/assert_no_text use "text" (whole page); assert_visible/assert_not_visible use "selector"; for text absence use assert_no_text. Use evaluate only for computed styles, complex logic, GraphQL (window.__e2eGql), or app state.
Modules: { "$use": "module-name", "params": {...} } references reusable modules in e2e/modules/ (they compose). Run e2e_list to see available modules.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "<name>",
"tests": "<tests>"
},
"name": "e2e_create_test"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Project root directory (defaults to the current working directory). | |
| name | Yes | Suite file name without .json extension (e.g. "login-flow", "issue-1743-sidebar") | |
| hooks | No | Optional hooks: beforeAll, afterAll, beforeEach, afterEach (each an array of actions). Note: beforeAll runs on a SEPARATE page that is closed before tests — use beforeEach for auth/setup. | |
| tests | Yes | Array of test objects with { name, actions, expect } |