Poliage

Scenarios & Steps

Scenarios are sequences of steps that result in captured assets. They can be recorded interactively or written manually.

Scenario Structure

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

Step API Reference

ActionRequired FieldsOptional FieldsDescription
gotourl-Navigates to a specific URL
clickselectordescriptionClicks an element
typeselector, text-Types text into an input
hoverselector-Hovers over an element
wait-msPauses execution
waitForselectortimeoutWaits until element is visible
capturekeyselector, clip, cropTakes a screenshot

Step Examples

{ "action": "goto", "url": "/dashboard" }

Click

{ "action": "click", "selector": "[data-testid='submit-btn']" }

Type

{ "action": "type", "selector": "#search", "text": "documentation" }

Hover (for menus)

{ "action": "hover", "selector": "[data-testid='dropdown-trigger']" }

Wait (fixed delay)

{ "action": "wait", "ms": 1000 }

Wait For Element

{ "action": "waitFor", "selector": ".loading-complete", "timeout": 5000 }

Capture

{ "action": "capture", "key": "settings-page" }

Selectors

Poliage supports multiple selector formats:

TypeExample
CSS.btn-primary, #submit
Playwright Locatorsrole=button[name="Save"], text="Welcome"
Attributes[data-testid="nav-menu"]

Prefer data-testid attributes for the most stable selectors that won't break when styles change.

Scenario Options

{
  "name": "checkout-flow",
  "timeout": 60000,
  "viewport": {
    "width": 1920,
    "height": 1080
  },
  "steps": [...]
}

Scenario-level settings override global config.