Skip to content

Quick start ​

Record a short flow and download it as a Playwright test. You will need StepTrail installed.

1. Record ​

  1. Open the website you want to test.
  2. Click the StepTrail icon, then Start recording. The icon shows a red REC badge while it records.
  3. Use the page normally.
  4. Click the icon again, then Stop recording.
  5. Optional: give the test a name and fix any steps in the list.
  6. Click Download Playwright test. A file such as my-flow.spec.js appears in your Downloads folder. That one click is all it takes to get a test.

To keep the raw recording as well, click Save recording (.json). It is saved as steptrail-recording.json, which is what the replay command reads.

2. Run your test ​

The popup shows the exact command after you download. In a terminal, in the folder with the file:

bash
npm i -D @playwright/test
npx playwright install chromium
npx playwright test my-flow.spec.js

The first two lines are a one-time setup. If the flow had a password or a file upload, the popup lists the settings to set first, such as STEPTRAIL_SECRET_PASSWORD.

3. Replay a recording and get a report ​

Replay plays a saved recording in a clean browser and checks every step. This uses the StepTrail command line from your install folder:

bash
node bin/replay.js steptrail-recording.json --headed --html report.html

--headed shows the browser so you can watch. You will see one line per step:

text
PASS 1. Go to https://example.test/login
PASS 2. Enter text in "Email"
FAIL 3. Click "Pay"  -> element not found
FAILED

Open report.html in a browser. A failed step includes a screenshot.

4. Generate a test from the command line (optional) ​

You can also make the test file from a saved recording, for example inside a script:

bash
node bin/generate.js steptrail-recording.json --out my-flow.spec.js

Next steps ​