Appium reporter
Install @qualflare/appium for Appium suites run through WebdriverIO, add it to wdio.conf.js and upload iOS and Android results with the Qualflare CLI.
Last updated
@qualflare/appium is the Qualflare reporter for Appium suites run through WebdriverIO 8 or 9: it records iOS and Android results with the device each test ran on, retries and screenshots in ./qualflare-results, and qf <identifier> collect uploads them as one launch.
| Fact | Detail |
|---|---|
| Package | @qualflare/appium on npm |
| Works with | Appium through WebdriverIO 8 or 9, Node.js 18.20 or later |
| qf | qf ≥ 0.1.37 (requires qf 0.1.37 or later) |
| License | Apache-2.0 |
| Source | Qualflare/qualflare-appium on GitHub |
| Without the reporter | --format junit with WebdriverIO's JUnit XML; --format appium reads only this reporter's output |
Before you begin
- The Qualflare CLI,
qf: Install the CLI. - A saved login:
qf login <identifier>with a project access token whose creator still holds the project role that uploads need Editor+ · project (requires the Editor role or higher in the project) (Authenticate with qf login). - The Identifier of the environment the results belong to (Environments).
Driving Appium from Java or Python? Use your test runner's reporter instead: TestNG, JUnit 5 or pytest.
Install
npm install --save-dev @qualflare/appiumConfigure
Add the reporter to wdio.conf.js, next to the Appium service that starts the server:
export const config = {
// ...
capabilities: [{
platformName: 'iOS',
'appium:automationName': 'XCUITest',
'appium:deviceName': 'iPhone 17 Pro',
'appium:app': './build/MyApp.app',
}],
services: ['appium'],
reporters: ['spec', ['@qualflare/appium', { environment: 'staging' }]],
};The options, the optional service (@qualflare/appium/service) and the limits are those of the WebdriverIO reporter, except that the framework label is always Appium.
Every reporter shares the other settings: see Reporter configuration.
Set environment to the environment's Identifier: a name such as Staging fails the upload with HTTP 400 (Environment).
Run and upload
npx wdio run wdio.conf.js
qf <identifier> collect ./qualflare-resultsRun in CI
- name: Upload results to Qualflare
if: ${{ !cancelled() }}
env:
QF_TOKEN: ${{ secrets.QF_TOKEN }}
QF_BRANCH: ${{ github.head_ref || github.ref_name }}
QF_COMMIT: ${{ github.event.pull_request.head.sha || github.sha }}
run: |
npm install -g @qualflare/cli
qf login ci --force
qf ci collect ./qualflare-resultsif: ${{ !cancelled() }} uploads the results when tests fail, and QF_BRANCH and QF_COMMIT record a pull request's own branch and commit (Pull request branches). For GitLab CI/CD, Jenkins and Azure Pipelines, see Run the upload when tests fail.
Sharding and retries
- Every spec file runs in its own worker and writes its own report;
qfmerges the reports that share a run ID, which every worker takes from thewdio runlauncher or the CI run. See Merge sharded CI jobs into one launch. - Mocha
this.retries(n)gives one test with every attempt's error and timing; it is flaky when a retry passed.
What gets uploaded
- The platform:
iosorandroidfromplatformName. Mobile Safari isios. platformName,platformVersion,deviceNameandautomationNameon every test.- A test ID that includes the platform, so iOS and Android keep separate histories.
- Every
driver.takeScreenshot()andsaveScreenshot(), attached to its test.
Metadata calls come from @qualflare/appium/runtime:
import { qualflare } from '@qualflare/appium/runtime';qf doesn't read the branch, commit, language or milestone from the report: set them on the upload (Branch, commit, language and milestone).
Troubleshooting
- The launch shows the category
generic:qfis older than 0.1.37. environment "Staging" does not exist in this project: use the environment's Identifier, or pass--environmenton the upload (Environment).- Screenshots can't be downloaded:
qfis older than 0.1.24. Upgrade qf.
Related
WebdriverIO reporter
Install @qualflare/webdriverio, add it to the reporters in wdio.conf.js and upload every worker's report as one launch with the Qualflare CLI.
Detox reporter
Install @qualflare/detox in the Jest config Detox uses, then upload its qualflare-results folder and Detox artifacts with the Qualflare CLI.