Skip to main content
@qawolf/flows/android defines Android flows and advanced device controls.

Primary Exports

  • flow(...)
  • launch(...)
  • device
  • expect
  • testContextDependencies
It also exports Android-specific target, launch, device, callback context, and flow definition types. Example:

Flow Callback Context

All Android flow callbacks receive:
  • inputs
  • setOutput(...)
  • test(...)
Launch-enabled Android flows also receive driver.
test(...) can be omitted for simple flows where grouping steps into named sub-steps doesn’t add value. For most flows, wrapping steps in test(...) is recommended — the label appears in your results and makes failures easier to locate.

testContextDependencies

testContextDependencies is exported for runner and tooling integration. Flow authors should usually use the public callback parameters above instead of depending on the raw runner dependency list.

Target Model

The current target input model is:
The implementation accepts either:
  • a target directly for the common path
  • { target, launch } when startup behavior should be part of the flow
Example:

flow(...)

Use flow(...) for Android authoring. Behavior from the implementation:
  • without launch, the callback receives inputs, setOutput(...), and test(...)
  • with launch: true, the flow calls launch() with default Android startup
  • with launch: <options>, the flow calls launch(options)
  • when launch is enabled, the callback also receives driver
Example:

launch(...)

launch() starts Android automation for the active flow and returns:
This API is only available while a flow is running. Example:

Launch Shape

Example:

Launch Defaults

The current implementation applies these defaults:
  • when app is omitted, launch falls back to the runner-provided executable input path and then to installed-app startup through appPackage
  • autoGrantPermissions defaults to true
  • noReset defaults to false
Example:

App Resolution

When your CI pipeline uploads an Android build, QA Wolf sets RUN_INPUT_PATH to the uploaded file before the flow runs. Omit app in your launch call and QA Wolf will use that path automatically — you only need to provide the appPackage. When app is provided, the current resolution order is:
  1. app.path
  2. app.env
  3. app.url
When app is omitted, launch falls back to RUN_INPUT_PATH. Relative paths are resolved against RUN_INPUTS_EXECUTABLES_DIR when that environment variable is present. Explicit app source examples:
RUN_INPUT_PATH fallback example:
If app is present but does not resolve to a value, launch does not fall back to RUN_INPUT_PATH.

device

device is a runtime proxy over the Android emulator API. Use it for device-level operations — such as setting location, simulating sensors, or managing device state — that sit outside app UI interactions. Use driver for interacting with the app itself. Example:

expect

The exported expect value is a type-safe stub in package code and is replaced by the runner during execution. Example:
Last modified on May 25, 2026