Android QA SDK that plays the scenarios Selvage compiles
Kotlin libraries that read the scenario JSON the Selvage scenario compiler writes, so one scenario format serves an iOS app and an Android app. 3 library modules and a sample Compose app.
A scenario is written once in YAML, compiled to canonical JSON and played against the app. Every run leaves evidence and a verdict.
One file holds two YAML documents split by ---: the config (appId, name, tags, seed, mocks, lanes) and the list of steps. It sits at Scenarios/Modules/<Module>/<Screen>/<id>.yaml. Sub-flows live in Common/Shared and are pulled in with runFlow, and Common/compiler.yaml holds the settings both compilers read.
Never parses YAML on the device. It reads the JSON the Selvage kernel writes.
The compiler turns each file into canonical JSON with its sub-flows inlined. An unknown key, command or argument is an error that names file:line:column, prints the line and puts a caret under the fault.
Takes the output of compile.py --out. Its conformance fixtures are compiler output and must read back and re-serialise byte for byte.
Cheap checks come first, so a broken catalogue never costs a build or a device.
No gate stage. A command the runner does not know fails its step instead of being skipped.
After sub-flows are inlined the first step is launchApp, exactly one per scenario, and an openLink right after it is folded into the launch. The seed (locale, link and the app's own values) travels with the launch. onFlowStart runs before it, onFlowComplete after the steps whether they passed or not.
The sample reads a LaunchEnvelope from its launch intent; that is how the seed's greeting prefix reaches the screen.
Each step resolves its selector (id, text, index and the rest) and acts: tap, type, scroll, wait. repeat, retry, runFlow and measure nest, and ${VARIABLES} resolve at run time.
ScenarioRunner hands each step to the ScenarioDriver the app supplies. RunGate gives pause, single step and breakpoints.
assertVisible, assertNotVisible, assertCount, assertTrue and assertNetwork check what the screen and the network promised. A failed assertion fails the scenario on that step.
An element that is not found fails the step unless its selector is optional. A driver that cannot do a command returns unsupported, which the report marks as a runner failure.
While the steps run, each SDK records what happened: screens, network, logs. Secrets are masked before anything is written to disk.
A RunReport with each step's status, time and message. The OkHttp interceptor keeps a traffic log that is masked before it is truncated, and the run journal masks secret-looking variables.
The run ends with a status per scenario and files a person and a machine can both read.
The RunReport status is PASSED, FAILED, CANCELLED or SKIPPED. The app decides how to show or ship it.
JDK 17 and the Android SDK. The sample app bundles compiled scenarios under assets/scenarios.
./gradlew check ./gradlew check :sample:assembleDebug
GitHub Actions on every push to main and every pull request: ubuntu-latest, Temurin JDK 17 and the Android SDK, with every action pinned to a commit SHA and the Gradle wrapper validated first.
bash scripts/scrub-gate.sh bash scripts/scrub-gate-test.sh bash ./gradlew check :sample:assembleDebug --no-daemon
shuttle-contracts reads what the Selvage scenario compiler writes.
shuttle-runner plays a scenario against a ScenarioDriver the app provides.
shuttle-okhttp adds an OkHttp interceptor; OkHttp is a compileOnly dependency.