@qawolf/flows/ios defines iOS flows and advanced simulator or device control.
Primary Exports
flow(...)launch(...)deviceexpecttestContextDependencies
Flow Callback Context
All iOS flow callbacks receive:inputssetOutput(...)test(...)
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:- a target directly for the common path
{ target, launch }when startup behavior should be part of the flow
flow(...)
Use flow(...) for iOS authoring.
Behavior from the implementation:
- without launch, the callback receives
inputs,setOutput(...), andtest(...) - with
launch: true, the flow callslaunch()with default iOS startup - with
launch: <options>, the flow callslaunch(options) - when launch is enabled, the callback also receives
driver
launch(...)
launch() starts iOS automation for the active flow and returns:
Launch Shape
Launch Defaults
The current implementation applies these defaults:- when
appis omitted, launch falls back to the runner-provided executable input path and then to installed-app startup throughbundleId respectSystemAlertsdefaults totruesnapshotMaxDepthdefaults to999noResetdefaults tofalse
App Resolution
When your CI pipeline uploads an iOS build, QA Wolf setsRUN_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 bundleId.
When app is provided, the current resolution order is:
app.pathapp.envapp.url
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.Advanced Appium capabilities
The named launch options above cover the most common settings. For anything else, use thecapabilities escape hatch: its entries are spread into the underlying webdriver.io remote capabilities and passed straight to the iOS driver.
startIos is a thin wrapper around webdriver.io’s remote, so capabilities that QA Wolf does not set itself are forwarded as-is. See the Appium references for the full list of available keys:
Named options take precedence over
capabilities for the same key. In particular, noReset, respectSystemAlerts, and snapshotMaxDepth are always applied (using their defaults when omitted), so configure those through the named options rather than capabilities.Migrating from wdio.startIos
Older flows obtained a wdio handle from the test context and called startIos directly. With the flow API, pass the same configuration through the flow’s launch options instead — map the settings that have a named option, and route the rest through capabilities. The driver you receive is the same webdriver.io Browser handle, so there is no separate “raw” driver to obtain.
app: { env: "IOS_PATH" } reads the path from the environment variable named IOS_PATH, replacing the raw "appium:app": process.env.IOS_PATH form.device
device is a runtime proxy over the iOS simulator or device API. Use it for device-level operations — such as installing configuration profiles, 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 is the assertion helper for iOS flows, backed by expect-webdriverio. All WebdriverIO matchers are available — including auto-retrying element matchers like toBeDisplayed, toExist, toHaveText, and toHaveAttribute. See the expect-webdriverio matchers reference for the full list.
Always import expect from @qawolf/flows/ios rather than from expect-webdriverio directly, so that QA Wolf’s defaults (timeout, toHaveScreenshot) stay in effect.
Example:
expect(driver).toHaveScreenshot(...), see Native mobile screenshots.