Skip to content

Record a regression test

CLI v3.0.2View Markdown

Outcome: a saved test folder that reproduces a useful flow and checks its result without a model at replay time.

Use a development app and a known starting state. Choose one behavior: adding a saved item, signing in with a test account, or opening a previously crashing screen. Saving a test normally replays the flow, so it may perform the interaction again.

  1. Open the app in a compatible Olef device viewer.
  2. Select Record steps.
  3. Perform the flow. Use Check for a visible condition that must hold.
  4. Stop recording and inspect the Steps list.
  5. Choose Save as test. Review the replay result and saved folder.
  6. Choose Check it, or ask your agent to run the test repeatedly.

The default recording starts from the current app state. The fresh-start option can clear app data; use it only when that is the intended setup.

Save the flow I just recorded as packing_list. Review the generated
selectors and assertions, tell me about any low-confidence steps, then
run it three times. Keep failures visible rather than weakening the
expected behavior to make it pass.

Replace the folder name with the path returned when saving:

Terminal window
olef test run tests/olef/packing_list --repeat 3

The folder contains test.sh, recording metadata, and screenshots of the steps. The runner produces JSON, JUnit, and HTML reports. A run that passes only after a retry is classified as flaky.

Within an existing Olef session, you can name steps and save the session’s actions:

Terminal window
olef record step add-item
# Perform your app-specific actions and checks here.
olef record show
olef record save packing_list

Use record show to inspect what will be kept before saving. See the full recording guide for session setup, parameters, generated checks, and replay behavior.

A recorded check can prove a visible state at a moment in the flow. It does not automatically prove persistence, backend correctness, or behavior on every Android version. Add those actions and checks explicitly, and run the test in the environments you support.

Next: Run tests in CI.