Scenarios & Steps

Scenarios are sequences of steps that end in one or more captures. They can be recorded interactively or written manually, but the stored model is always JSON.

Visuals explorer
Every scenario's captures land in the visuals explorer, grouped by scenario and variant so you can review what each step produced.

Smallest scenario

Every scenario needs a unique key, a human-readable name, and the target url. The url is the route Reshot navigates to — you do not add a goto step for it. screenshot steps each need their own unique key.

JSON
{
  "scenarios": [
    {
      "key": "billing-overview",
      "name": "Billing Overview",
      "url": "/app/billing",
      "steps": [
        { "action": "wait", "ms": 1000 },
        { "action": "screenshot", "key": "billing-overview" }
      ]
    }
  ]
}

Expanded example

JSON
{
  "scenarios": [
    {
      "key": "user-login",
      "name": "User Login",
      "url": "/login",
      "steps": [
        { "action": "type", "selector": "#email", "text": "user@example.com" },
        { "action": "type", "selector": "#password", "text": "password123" },
        { "action": "click", "selector": "button[type='submit']" },
        { "action": "waitForSelector", "selector": "[data-testid='dashboard']" },
        { "action": "screenshot", "key": "dashboard-logged-in" }
      ]
    }
  ]
}

Step API reference

ActionRequired fieldsOptional fieldsDescription
clickselectordescriptionClick an element
typeselector, text-Type into an input
hoverselector-Hover an element
wait-msPause execution
waitForSelectorselectortimeoutWait for a selector
scroll-selectorScroll the page or to an element
screenshotkeyselector, clip, crop, descriptionCapture the current view

Scenario-level overrides

JSON
{
  "key": "checkout-flow",
  "name": "Checkout Flow",
  "url": "/checkout",
  "timeout": 60000,
  "viewport": {
    "width": 1920,
    "height": 1080
  },
  "steps": []
}

Scenario-level settings override the global config.

Selector guidance

Prefer app-owned selectors such as data-testid or data-reshot-* attributes. They are easier to keep stable across product changes than visual CSS selectors.