DemoFlow

Recording

demoflow record writes a scenario from what you do in the app, so you do not have to write the JSON. If you already have Playwright tests, see Reuse Playwright tests instead.

npx demoflow record signup

The scenario is saved as demoflow/signup.demo.json. Without a name it is demoflow/recording.demo.json.

FlagMeaning
--forceOverwrite an existing scenario file. Without it, an existing file is left alone.
--no-runDo not offer to run the scenario after saving it.
--viewport <WxH>The browser size, written into the scenario. Default 1280x720.

How a recording goes

  1. DemoFlow reads demoflow.config.json. If it has a devCommand, it starts your app and waits for it.
  2. It opens two windows: your app in a browser, and a panel.
  3. Use the app as a user would. Clicks, typing, selects and key presses become steps. Navigation stays inside allowedOrigins.
  4. Use the panel for what a click cannot say, then choose Stop and save.
  5. The scenario is written and DemoFlow offers to run it.

Nothing is written if no steps were recorded.

The panel

ControlAdds
Scene, CaptionA marker step with the text in the title field.
WaitA wait step of the given milliseconds.
Wait for readyA waitForReady step for the name in the ready field: the run waits until your app calls window.demoflow.ready('<name>'). See Application SDK.
Pick: visible, Pick: textAn assertVisible or assertText on the next element you click.
Hover nextA hover on the next element you point at.
Secret nextThe next typed value is recorded as valueFrom.env with the variable named in the panel, and the value is not saved.

The panel also lists the recorded steps so you can check them as you go.

Repeat over data

To post the same thing for several items, tick a run of steps in the panel and choose Repeat over data:

  1. Name the list.
  2. For each typed value in the ticked steps, give one line per item. The first line is what you recorded.
  3. Choose Create repeat.

The panel writes the data block and wraps the steps in a repeat, with {{item.text}} in place of each typed value. Secret fills are left as recorded. See Repeat over data for the format.