Skip to main content
A DemoScript is a flow’s file in .demoman/flows/<name>.json. demoman add writes it and your agent changes it; you read it in pull requests. Flows and DemoScripts shows a whole one. The script part below is the same format your agent passes to the run tool.

File fields

Targets

A step names its element in one of four ways. Your agent copies them from a snapshot of the page and never makes one up.

Script fields

Steps

Each step is an object whose do names what it does.

click

Click an element.

type

Type text into a field.

hover

Rest the pointer on an element.

scrollTo

Scroll an element into view.

waitFor

Wait for an element to show or go.

drag

Press, move and let go.

press

Press a key.

waitForLoad

Wait for the page to finish loading.

pause

Hold still, so the viewer can read. Performs nothing.

Rules

Beyond each field’s own type, a script is refused when it breaks one of these:
  • At least one step acts on the page: a script of pauses alone is refused.
  • Name a device or a viewport, not both.
  • On a device, no hover step: a phone has no hover.
  • A drag must end somewhere other than where it starts.
  • {secret:NAME} is refused in a script’s type text: it works only in .demoman/accounts.json.
  • trim.start.step and trim.end.step name a step that exists and is not a pause, and the start is not after the end.
  • A look.branding wallpaper background names one of the built-in wallpapers.
  • look names a kit or gives a branding, not both.
  • On a device, a click takes no button, clicks or holding: a phone or tablet has no mouse.