Skip to content

olef record

CLI v3.0.2View Markdown

Generated from Olef 3.0.2. All commands · Capabilities and requirements

These entries describe available commands, not a sequence to run. Check prerequisites before changing app, device, or cloud state. Global options are listed in the command catalog.

Turn what was done in a session (an agent’s commands, a person’s viewer input) into a test folder: record save <name> cleans up the journal, writes a Bash script of one olef command per step, replays it once from a fresh start, and saves tests/olef/<name>/

Terminal window
olef record --help

Output: json.

Start a recording in this session, optionally from a fresh start (--app P --clear-data --launch): what follows becomes the test. The viewer’s Record button runs this

Terminal window
olef record start --help

Output: json.

Argument Description
--app <PACKAGE> The app the test is for (default: the session’s app, else the app in front)
--clear-data Clear the app’s data first, so the recording starts where the test will
--launch <ACTIVITY> Launch the app first, optionally at this activity (.MainActivity)
--expect-text <TEXT> With –launch: wait until this text is on screen
--expect-rid <RESOURCE_ID> With –launch: wait until this resource id or test tag is on screen
--json Accepted for compatibility; output is always JSON.

Examples from the CLI (replace sample packages, selectors, and paths with your own):

Terminal window
olef record start --app io.github.andriyo.shadowdroid.sample --clear-data --launch .MainActivity --expect-rid status_text

Stop the recording; keeps the screen it ended on (the last step’s checks are read against it). record save then makes the test

Terminal window
olef record stop --help

Output: json.

Argument Description
--json Accepted for compatibility; output is always JSON.

Clean up the recording, compile it into a test folder, replay it once from a fresh start (putting back any step removed by mistake), and write tests/olef/<NAME>/ (test.sh, screens/, README.md, recording.json, and responses/ + expect/ when the proxy captured the flow). Works on the whole session when no recording was started

Terminal window
olef record save --help

Output: json.

Argument Description
<name> Required. The test’s name (folder name): letters, digits, - and _
--out <DIR> / -o The test folder (default: <tests.dir>/<NAME>, tests/olef/<NAME>)
--from <MARK> Start at this record mark
--to <MARK> End at this record mark
--last <N> Only the last N commands
--journal <DIR> Read this session folder’s journal instead of the current session’s (a closed session, or one left by a script)
--no-verify Skip the replay check: write the folder as compiled
--force Replace an existing test folder’s generated files (mocks/, data/ and other files are kept)
--json Accepted for compatibility; output is always JSON.

Examples from the CLI (replace sample packages, selectors, and paths with your own):

Terminal window
olef record save mission_recovery
olef record save checkout --from cart-ready --no-verify
olef record save login --to logged-in -o tests/olef/login

Whether a recording is on, and how much it holds

Terminal window
olef record status --help

Output: json.

Argument Description
--json Accepted for compatibility; output is always JSON.

The recording as it would be saved: each step as its script line, what clean-up would remove and why, and the script. Changes nothing

Terminal window
olef record show --help

Output: json.

Argument Description
--from <MARK> Start at this record mark
--to <MARK> End at this record mark
--last <N> Only the last N commands
--journal <DIR> Read this session folder’s journal instead of the current session’s (a closed session, or one left by a script)
--json Accepted for compatibility; output is always JSON.

Name the commands that follow (a step of the test): record step "pay with the saved card" becomes step pay-with-the-saved-card

Terminal window
olef record step --help

Output: json.

Argument Description
<name> Required. What the following commands do
--json Accepted for compatibility; output is always JSON.

Examples from the CLI (replace sample packages, selectors, and paths with your own):

Terminal window
olef record step "pay with the saved card"

Name the current point (logged-in), for record save --from/--to

Terminal window
olef record mark --help

Output: json.

Argument Description
<name> Required.
--json Accepted for compatibility; output is always JSON.

Add a check at this point (it must hold now), written into the test as a ui wait marked # checked by you

Terminal window
olef record check --help

Output: json.

Argument Description
--text <TEXT> Match text by case-insensitive substring. Single-target actions prefer a unique full-text match; multiple remaining matches are ambiguous
--rid <RID> Match by resource-id substring; actions prefer a unique exact match
--desc <DESC> Match by content-description substring; actions prefer a unique exact match
--has-text <TEXT> The element shows this text (its own, its description, or inside it)
--checked <BOOL> The element is checked (false: unchecked) Values: true, false.
--selected <BOOL> The element is selected (false: not selected) Values: true, false.
--enabled <BOOL> The element is enabled (false: disabled) Values: true, false.
--gone The element is gone
--json Accepted for compatibility; output is always JSON.

Examples from the CLI (replace sample packages, selectors, and paths with your own):

Terminal window
olef record check --rid status_text --has-text claimed
olef record check --rid mission_telemetry_switch --checked

Forget the recording so far: record save starts from here

Terminal window
olef record discard --help

Output: json.

Argument Description
--json Accepted for compatibility; output is always JSON.