Reuse a recorded test as a prerequisite for other tests. Define common flows like login or profile selection once, attach them to any number of tests, and update them in one place. Reusable tests show under Setup steps in the Tests page’s left column, and a test’s own setup steps are listed under Before this test on its page.
What’s a setup step?
A setup step is a regular test marked reusable. When a test has setup steps attached, they run before the test’s own steps — both in single runs and inside a group. Setup steps carry their own recording and visual baselines, so:
- No AI plays back the setup step’s recorded actions deterministically. No tokens spent re-deciding how to log in.
- Smart replays the setup step’s recording and falls back to the AI agent (beta) only if the screen drifts from the recording.
- AI only treats the setup step’s steps as natural-language instructions.
- Visual regression baselines live on the setup step itself. Re-baseline once, every test that uses it picks it up on the next run.
Creating a setup step
Any test can be a setup step, whether or not it is in a group. The flow is:
- Create a test with Create test on the Tests page (describe it or record it).
- Open the saved test’s page and turn on Reusable as setup.
The test now appears under Setup steps in the Tests page’s left column and in every other test’s picker. A setup step can belong to any app of the same kind (phone/tablet or TV) in your organization; a phone setup step can’t be attached to a TV test or the other way round.
Setup steps don’t nest. A test that has setup steps of its own can’t be marked reusable, and a reusable test can’t have setup steps attached. The toggle is disabled while a test has setup steps, and a reusable test’s Before this test explains why it has none.
You can turn it off at any time. Tests that already attached this setup step will fail at the start of their next run with a clear error — attach a different one or remove the reference to fix.
Attaching a setup step to a test
- On a new test, pick setups under Before this test in Review steps. On an existing test, use Before this test on its page.
- Pick from the list: it shows reusable tests of this app first, then those of your other apps of the same kind (phone/tablet or TV). A reusable test that has setups of its own isn’t listed.
- Order matters: setup steps run in the order shown, before the test’s own steps. Use the arrows to reorder and the remove button to take one off.
When the test runs:
- On its own:
setup 1 -> setup 2 -> test. - In a group: each test still runs
setup 1 -> ... -> test, with the group’s Start each test from setting applied before each test.
Updating a setup step
Re-record the setup step, edit its steps, or re-baseline its screenshots — every test that uses it picks up the change on its next run with no further action.
A test doesn’t embed a snapshot of its setup steps; it only points at them, and they are resolved fresh at every run.
API reference
A setup step is a regular test case (the API calls it a sub_flow and marks it reusable), so the existing /api/v1/tests/cases/{id} endpoints apply.
Mark a test reusable as a setup step
PATCH /api/v1/tests/cases/{case_id}
{ "is_reusable": true }
The API returns 400 if the test has setup steps of its own.
List reusable cases (setup step picker)
GET /api/v1/tests/cases/reusable
Returns every reusable test case in the caller’s organization. Add ?app_id=<app ID> to list only the reusable tests of apps of the same kind (phone/tablet or TV) as that app, its own first. Each item says whether it has setups of its own (has_setups); such a test can’t be attached.
Attach setup steps to a test
PATCH /api/v1/tests/cases/{consumer_case_id}
{ "sub_flow_ids": ["login-abc123", "select-profile-def456"] }
The backend rejects sub_flow_ids entries that are missing, not reusable, in another organization, equal to the consumer itself, or duplicated. Attempting to attach a non-reusable case returns 400.
A new test can take its setup steps when it is created: POST /api/v1/tests/cases accepts the same sub_flow_ids list (see the Tests API).
Recordings from different devices
Each setup step replays from its own recording. Its recorded positions are mapped from the device it was recorded on, not from the consumer’s device, so a setup step recorded on one phone, tablet, Apple TV or Android TV screen can be attached to a test recorded on another.
Limitations (v1)
- No nested setup steps. A reusable test attached as a setup step may not itself attach further setup steps — the run rejects the configuration with a clear error.
- No after-each / teardown setup steps. The group’s Start each test from setting handles cleanup between tests.
- A setup step in the same group runs twice. A reusable test can be in a group like any other test. If it is in the same group as a test that uses it, a run of that group runs it once as its own test and again before the test that uses it.