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
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 — specifies where the flow runs and how it starts. Pass a plain target string to name the browser, device, or environment, or pass an object with
targetandlaunchto configure startup simultaneously — see Target literals for the exact matching rule and the list of values. - Callback — the
asyncfunction containing your test logic. What it receives depends on the launch style and platform (see below).
Launch styles
Declarative launch — recommended
Passlaunch: true to use the default startup, or pass 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.
true when you need to customize startup, such as reusing a browser profile. See the Web API Reference for the full list of options.
Explicit launch — advanced flows only
For advanced cases where the startup depends on runtime logic, you can calllaunch() explicitly inside the callback. 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.
page, context, browser, or driver) as shown in the launch styles section above.
For the full callback context shape, see the API Reference for Web, Android, and iOS.
launch(), device, and platform.target are stubs in the package code, and the runner replaces them at execution time. They only work while a flow is running inside the QA Wolf runner — keep them inside the flow callback, not at the module level. Module-level code should be limited to imports, constants, and pure helper functions.
platform.target (full API in the Top-Level Reference) lets a single flow branch on the active platform at runtime. Use it sparingly — prefer separate platform-specific flows if you find yourself branching often.Pure helper functions for platform differences
For platform-specific implementation differences that don’t fit neatly into a Page Object — such as log capture, where iOS uses"safariConsole" and parses JSON while Android uses "browser" with logging preferences — write a helper function that handles the difference internally. The flow calls the helper and stays linear.
Environment variables
Reference environment variables withprocess.env.VAR_NAME. You typically use them in the Arrange section before any interactions begin.