Draft test cases from an exploration

exploration.to_casesReadsOnly looks things up; never changes your workspace.

What it does

Turns what an exploration session recorded into draft test cases. Nothing is saved: you get bodies ready for case.create_batch. Same session in, same drafts out (no AI). Only verified steps without errors become case steps. Strategy "per-path" (default): one case per run of consecutive steps whose observed page (the URL after the action) stayed the same, steps like "Fill \"#email\" with \"tester3@example.com\"" or "Submit via …"; a run with no actions produces no case. Strategy "per-page": one "Open <page title>" case per visited page. Expected results come from checks that held on that page (passed expect results first, then URL, title, success message, form count and heading checks). Example per-path body: { "title": "Contact us: 3 action(s)", "description": "Exploration <id>, path through https://app.example.com/contact.", "preCondition": "Application reachable at https://app.example.com", "steps": ["Navigate to https://app.example.com/contact", "Fill \"#name\" with \"Test User 4\"", "Fill \"#email\" with \"tester4@example.com\"", "Submit via \"#send\""], "expectedResult": "\".alert-success\" is visible; URL contains \"/contact\"; Page title contains \"Contact us\"", "priority": "P2" }. Returns { strategy, sessionId, suiteId (the session featureId, if set), bodies, next }. Review and tidy the drafts (the exploration-to-cases prompt rewrites them in plain language), check case.list for duplicates, then call case.create_batch({ suiteId, bodies }).

Ask your agent

You don’t call exploration.to_cases yourself. Say something like this to Claude Code, Cursor or another MCP-connected agent:

  • “Turn that exploration into test cases”
  • “Write test cases from the pages you just clicked through”
  • “Make one test case per page you visited”

Inputs

NameTypeDescription
sessionId
required
stringExploration session id, from exploration.start or exploration.list. Works on active or finished sessions.
strategy
optional
enum"per-path" (default): one case per run of actions on a page, best for flows like login or checkout. "per-page": one "page opens" case per visited page, best for a smoke check of every page.
Allowed: per-pathper-page
maxCases
optional
integerMost drafts to return (1–200, default 50).

The MCP call

What the agent’s MCP client sends (placeholders in angle brackets):

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "exploration.to_cases",
    "arguments": {
      "sessionId": "<sessionId>"
    }
  }
}

Connect your agent

npx -y @testmaze/mcp init tmt_xxx
claude mcp add tm --scope project -- npx -y @testmaze/mcp

Create the token in your Test Maze workspace under Settings → MCP. Setup for Cursor, Cline, Gemini CLI and Codex CLI is shown there too.