From flow to test

How a saved flow becomes a Playwright test, and how Rehearsal checks it in a fresh browser.

When Re:agent saves a flow, Rehearsal turns it into a Playwright test. It writes the test, runs it once, then runs it again in a fresh browser. A test that passes both becomes ready to run.

What a flow holds Link to What a flow holds

  • The goal, in your words.
  • Every step Re:agent took, with the element it acted on as the page named it.
  • Where each person started, and which test account each one used.
  • The proof that the flow worked, such as an address or text on the page.
  • Placeholders in place of secrets: {{password}}, {{code}} and {{link}}.

How the test is written Link to How the test is written

Rehearsal writes one Playwright test in TypeScript that follows the flow step by step. It uses the elements the flow recorded rather than looking for new ones.

Each action and each check is a named step. That is how a run can say which step failed.

The test does not hold your app's address. Each run gives it the address to check. Passwords, codes and links are read while the test runs, never written into it.

Rehearsal runs the test to prove it. When a run fails, it reads what Playwright reported, changes the test and runs it again, up to six times.

Rehearsal keeps a test only after a run of the whole flow passes. A test that passes but leaves out a person or a file in the flow is not accepted.

The two checks Link to The two checks

StageWhat it means
Test writtenRehearsal saved the last version of the test it ran.
First run passedThat last run passed. It is kept as a run, with its recording.
Verified in a fresh browserThe saved test ran again in new browsers that know nothing about the runs before, and passed.

When the fresh run passes, the test becomes Approved and is ready to run. Both runs also appear in Runs, marked Verifying the test.

When it does not pass Link to When it does not pass

  • First run failed or Failed in a fresh browser. The card names the step where the test stopped, and quotes what Playwright reported.
  • Test not written. Rehearsal could not finish writing the test.
  • A check that stopped because of a problem on our side says so, and names no step.

A new test stays a Draft and cannot run. Press Retry in the chat to write it again from the same flow, or describe the flow to Re:agent again.

When a test changes Link to When a test changes

Changing a test in chat saves a new version of its flow. Rehearsal writes and checks a new version of the test the same way.

A run uses the newest version that passed in a fresh browser. Until the new version passes, runs keep using the one before it.

Read the code Link to Read the code

The CLI prints the Playwright code of the version a run would use.

Terminal
rehearsal tests source <test-id>

To change what a test does, press Edit in chat on its page and tell Re:agent. See Create a test in chat.

Next steps Link to Next steps