Creating Tests with the Revyl CLI
Back to README | Commands | Agent SkillsThis guide covers the full CLI authoring loop for Revyl tests:
- create tests from YAML
- scaffold a test and then edit it locally
- import reusable modules
- push, run, open, and troubleshoot tests
Choose a Workflow
Use one of these flows depending on where your test starts:- YAML-first CLI (recommended)
Start from a local YAML file, validate it, create the remote test, and bootstrap
.revyl/config.yamlautomatically. - Scaffold first
Create an empty or module-seeded remote test with
revyl test create, sync the generated YAML into.revyl/tests/, then edit and push locally. - Dev loop to regression
Use
revyl dev test createafter an exploratory session, then refine the synced YAML and push it back as a stable regression.
Prerequisites
Before creating tests, make sure you have:- authenticated with
revyl auth login - an app/build available for the target platform
- the correct app name for
test.build.name
test.build.name must match a Revyl app name for the test’s platform. If the name does not resolve, test push will fail.
Workflow 1: YAML-First CLI
This is the best path when you already know the flow you want to encode.1. Write a YAML file
Examplesmoke-login-ios.yaml:
2. Validate the YAML
--json when you want machine-readable output in CI or scripts:
3. Create the test from the YAML file
- validates the YAML
- copies it to
.revyl/tests/smoke-login-ios.yaml - creates or updates the remote test through the normal push flow
- writes
.revyl/config.yamlif it does not already exist - stores
_meta.remote_id,_meta.remote_version, checksum, and sync timestamps in the local YAML
.revyl/config.yaml.
4. Iterate locally and push changes
Edit the synced file:--force when you want to overwrite the current remote version with your local YAML.
5. Run or open the test
Workflow 2: Scaffold First, Then Edit Locally
This path is useful when you want the CLI to create the remote test shell first.1. Create the test scaffold
- creates the remote test immediately
- adds the alias to
.revyl/config.yamlunless--no-syncis used - syncs the generated YAML into
.revyl/tests/<name>.yaml - optionally opens the browser editor unless
--no-openis used
2. Edit the local YAML
After scaffold creation, refine:revyl test open smoke-login-ios when you want to continue editing in the browser instead of locally.
YAML Anatomy
Every test file has the same top-level structure:test.metadata.name: the remote test nametest.metadata.platform:iosorandroidtest.build.name: the Revyl app name to run againsttest.blocks: the ordered test steps
instructionsUse for a single user action.validationUse for assertions about the expected state after an action.manualUse for framework-level actions such aswait,go_home,navigate,set_location,kill_app, oropen_app.module_importUse for reusable flows such as login or onboarding.if,while,extraction,code_executionUse when you need conditional logic, variables, or dynamic behavior.
open_app is valid, but Revyl opens the app automatically at test start, so using it as the first block is often unnecessary.
Authoring Rules for Stable Tests
Prefer these patterns:- One action per instruction step.
- Keep assertions in separate
validationblocks. - Validate durable user-visible outcomes instead of transient loading copy.
- Use variables for credentials and secrets instead of hard-coding them in reusable tests.
- Keep module imports at the top of the flow when they establish shared setup.
Reusing Modules
Modules let you keep common flows out of individual tests. List modules:test.blocks, or seed a scaffolded test directly:
Troubleshooting
A test with that name already exists
If create or push fails because the remote name already exists:- choose a new test name, or
- inspect remote names first with
revyl test remote, or - use the scaffold flow when your goal is to reuse an existing remote test name and sync it locally
build.name does not resolve
If push says the app could not be found:
test.build.name to match the actual Revyl app name exactly.
Test shows as stale or [missing-upstream]
This usually means the local file or alias points at a remote test ID that no longer exists or is not visible in the current org.
Start with:
Target a non-default backend
UseREVYL_BACKEND_URL when you want test creation and push to hit a local, staging, or preview backend:
127.0.0.1 over localhost if your machine resolves localhost to IPv6 and the backend only listens on IPv4.
If you also need browser-based commands such as revyl test open to point at a non-default frontend, set REVYL_APP_URL to the matching app host.