Skip to Content
Docs
Capture

Authored scenarios

Describe browser actions, setup, and a specific failure to replay.

Prepare an example

Use a local app with an order button #place-order and a confirmation element #order-confirmation. Adapt the selectors and route to your app. This example expects confirmation to appear after clicking the button and captures the bug when it does not.

Install local dependencies first. Save the following as scenario.json in the app directory. This example assumes npm, a committed lockfile, and a development script that accepts Vite style host and port flags.

{
  "schemaVersion": "browser-scenario-v1",
  "workingDirectory": ".",
  "setupPlan": {
    "lifecycleScriptsEnabled": false,
    "commands": [
      {
        "phase": "install",
        "command": "npm ci --ignore-scripts",
        "workingDirectory": "."
      }
    ]
  },
  "startCommand": "npm run dev -- --host 127.0.0.1 --port 3000",
  "port": 3000,
  "readinessPath": "/",
  "initialPath": "/checkout",
  "viewport": { "width": 1280, "height": 800, "deviceScaleFactor": 1 },
  "timeoutMs": 30000,
  "steps": [
    {
      "id": "submit-order",
      "actions": [
        { "kind": "click", "selector": "#place-order" },
        {
          "kind": "expectVisible",
          "assertionId": "order-confirmation",
          "selector": "#order-confirmation",
          "expected": true
        }
      ]
    }
  ],
  "failureTarget": {
    "kind": "assertion",
    "stepId": "submit-order",
    "assertionId": "order-confirmation"
  }
}

Capture the scenario

From the app directory containing scenario.json, with port 3000 free:

reprolane capture scenario scenario.json

Reprolane starts the app and runs the saved actions. Local capture uses existing dependencies and skips setupPlan. Clean replay uses that plan in a fresh environment, so keep it complete.

If you already started the app at the manifest's port, run from the same directory:

reprolane capture scenario scenario.json --connect

This leaves your server running. Without --connect, the port must be available for Reprolane to start the app. Automation requires an existing manifest and never silently changes its port.

Review the failure

Expect the chosen assertion to fail when the confirmation is missing. Review the source, manifest, diagnostics, and destination before upload. If the assertion passes, the intended bug was not observed; correct the route, selector, or fixture before retrying.

Keep required scenario files in the selected source. Ignore rules still apply, and an include pattern cannot restore ignored files. Missing required inputs need correction or an explicit capture only choice.

The uploaded result records local evidence. Open it and request verification separately when eligible. For startup problems, use scenario troubleshooting.

On this page