Appearance
Generate a test script
Turn a recording into a ready-to-run Playwright test file.
One click, in the extension
- Record and stop (see Record a session).
- Name the test and fix any steps.
- Click Download Playwright test.
The file, for example checkout-flow.spec.js, goes to your Downloads folder. There is nothing to install for this step and no command to run. Copy test puts the same code on your clipboard instead.
The popup then shows the command to run it and any settings it needs:
bash
npm i -D @playwright/test # once per project
npx playwright install chromium # once per computer
npx playwright test checkout-flow.spec.jsThe output is plain code you can edit and commit.
From the command line
If you saved a recording, the same file can be made without the extension:
bash
node bin/generate.js recording.json --out my-flow.spec.jsSecrets and files
Generated scripts never contain passwords or uploads. They read them from environment variables, for example STEPTRAIL_SECRET_PASSWORD and STEPTRAIL_UPLOAD_CV. The comment at the top of the file, and the popup after a download, list the ones your test needs.
Session values
To embed cookies and storage values, tick Include my login in the test in the popup (it appears when you recorded with Stay logged in when replaying), or add --with-session on the command line.
WARNING
Session values may be secrets. Do not commit a script generated with --with-session to a shared repository.
Limits
Only one script format is supported today.