flow() from the @qawolf/flows package — it tells the runner what to run, where to run it, and which runtime objects to inject into the callback.
AAA framework
QA Wolf flows follow the Arrange-Act-Assert (AAA) format.- Arrange — sets up state before the interaction.
- Act — performs the interaction being tested.
- Assert — verifies the expected outcome.
iOS and Android use
driver.$(...) calls instead of page calls.Import statement
Import from the@qawolf/flows subpath that matches the platform you are testing.
Flow wrapper
- Name — what this flow is called in your results, bug reports, and QA Wolf dashboard. Make it descriptive enough that a failing flow name tells you where to look.
- Configuration — where the flow runs and how it starts. See Launch styles below, and Target literals for the values
targetaccepts. - Callback — the
asyncfunction containing your test logic. See Callback parameters.
Launch styles
Declarative launch Recommended
Pass
launch: true to use the default startup, or an options object to customize it. Either way, QA Wolf starts the browser or app before your callback runs, and the callback receives the platform object ready to use.
If you’ve used Playwright directly, this is the equivalent of calling
await browser.launch() — QA Wolf handles that setup for you, so your callback starts with a ready-to-use page.true when you need to customize startup, such as reusing a browser profile. See the Web API Reference for the full list of options.
launch from the configuration and call launch() inside the callback when startup options aren’t known until the flow runs. The callback receives no platform object: launch() returns a result you narrow with isPersistent(), isAnonymous() or isElectron() before reading page or context. See the Web API Reference for details. For Electron desktop app testing, see Testing Electron apps.
Callback parameters
Every flow callback receives three parameters regardless of platform:inputs
Values passed into the flow from outside. Use this to read data published by another flow in the same run. Keys are uppercase by convention, e.g. inputs["EMAIL"].
setOutput(...)
Publishes one or more key-value pairs that a later flow in the same run can read via its inputs. Keys are uppercase by convention. You can publish multiple values in a single call:
A consumer flow will not run until its producer has called
setOutput. See Passing data between flows for how producers and consumers work together.test(...)
Wraps a named sub-step, grouping actions and assertions under a label that appears in your results. When a step fails, the label tells you exactly where in the flow the failure happened. All four parameters in one callback:
Platform object
A launch-enabled flow also receives the platform object, which differs by platform:
For the full callback context shape, see the API Reference for Web, Android, and iOS.
Environment variables
An environment variable is set on the environment and holds the same value for every run, such as a base URL or a test account’s password.inputs holds values another flow published during the run.
Read one with process.env.VAR_NAME, usually in the Arrange section before any interactions begin.
Platform differences
Prefer a separate flow per platform, each importing from its own@qawolf/flows subpath. When one flow has to cover several platforms, put the difference in a helper function so the flow stays linear. Log capture is a typical case:
platform.target — sparingly.