Appium Configuration Reference
Complete reference for all @testrelic/appium-analytics configuration options — AppiumReporterConfig, TestRelicService options, and cloud upload settings.
@testrelic/appium-analytics is configured through options passed to TestRelicService (in services) and TestRelicReporter (in reporters) in your wdio.conf.ts.
Playwright configuration
This page covers @testrelic/appium-analytics options. For Playwright configuration, see the Playwright overview.
TestRelicService options
TestRelicService runs during each test session. It collects device logs, network traffic, commands, and screenshots. Pass options as the second element of the service tuple:
services: [
[TestRelicService, {
includeDeviceLogs: true,
includeNetworkLogs: true,
screenshotOnEvery: 'failure',
}],
],| Option | Type | Default | Description |
|---|---|---|---|
includeDeviceLogs | boolean | true | Capture Android logcat / iOS syslog per test |
includeNetworkLogs | boolean | true | Capture HTTP network traffic |
includeConsoleLogs | boolean | true | Capture browser/app console output |
includeScreenshots | boolean | true | Capture screenshots |
screenshotOnEvery | 'test' | 'failure' | 'never' | 'failure' | When to capture screenshots |
includeVideoRecording | boolean | false | Capture screen video (performance impact) |
includeCommands | boolean | true | Capture every WebDriver command with args and timing |
includeAssertions | boolean | true | Capture assertion results |
includeActionSteps | boolean | true | Capture named action steps |
deviceLogPollInterval | number | 1000 | Milliseconds between device log polls (minimum 100) |
preferBiDi | boolean | true | Prefer WebDriver BiDi (log.entryAdded) for console log capture; falls back to polling when unavailable |
TestRelicReporter options
TestRelicReporter runs after all tests complete. It writes the structured report file and optionally uploads to the cloud. Pass options as the second element of the reporter tuple:
reporters: [
'spec',
[TestRelicReporter, {
outputPath: './test-results/testrelic-timeline.json',
openReport: true,
cloud: {
apiKey: process.env.TESTRELIC_API_KEY,
},
}],
],Core options
| Option | Type | Default | Description |
|---|---|---|---|
outputPath | string | './test-results/testrelic-timeline.json' | Path for the JSON report file |
htmlReportPath | string | Derived from outputPath (.html extension) | Path for the HTML report file |
openReport | boolean | true | Open the HTML report in the browser after the run |
testRunId | string | Auto-generated UUID | Override the run ID — useful for correlating with CI build numbers |
maxDeviceLogs | number | 2000 | Keep at most this many device-log lines per test (the most recent); 0 keeps all |
redactPatterns | (string | RegExp)[] | 4 built-in patterns | Additional patterns to redact from output (appended to built-in patterns) |
metadata | Record<string, unknown> | undefined | Custom metadata attached to the report |
quiet | boolean | false | Suppress the console summary printed after the run |
cloud | CloudReporterOptions | undefined | Cloud upload configuration — see below |
Output files
The reporter writes the JSON report to outputPath, plus a per-worker copy suffixed with the run ID (testrelic-timeline-<testRunId>.json) so parallel workers never overwrite each other, and the HTML report to htmlReportPath. Merge worker files with npx testrelic-appium merge — see Merging shards.
redactPatterns
Built-in patterns already redact AWS access keys, Bearer tokens, private key blocks, and credentials embedded in URLs. The redactPatterns option appends additional patterns — it does not replace the built-ins.
redactPatterns: [
/api_key=[^&\s]+/gi,
/password=[^&\s]+/gi,
]Cloud upload options (CloudReporterOptions)
The cloud object inside reporter options controls cloud upload behaviour.
| Option | Type | Default | Description |
|---|---|---|---|
apiKey | string | — | Required. Your TestRelic API key (a '$VAR' string is read from that environment variable) |
endpoint | string | 'https://platform.testrelic.ai/api/v1' | Cloud API endpoint (override for self-hosted) |
upload | 'batch' | 'realtime' | 'both' | 'batch' | Upload strategy: one payload at the end, per-test as tests finish, or both |
timeout | number | 30000 | Upload request timeout in milliseconds |
projectName | string | undefined | Project name, used to identify the repository when there is no git remote |
uploadArtifacts | boolean | true | Upload screenshots and video alongside the report |
artifactMaxSizeMb | number | 50 | Per-file size limit for artifact uploads (MB) |
queueMaxAge | string | '7d' | How long failed uploads stay queued before discarding (s, m, h, d units) |
queueDirectory | string | '.testrelic/queue' | Directory where failed uploads are queued for retry |
Cloud settings are also read from .testrelic/testrelic-config.json (same format as the Playwright config file) and from the TESTRELIC_API_KEY, TESTRELIC_CLOUD_ENDPOINT, TESTRELIC_UPLOAD_STRATEGY and TESTRELIC_CLOUD_TIMEOUT environment variables, which take the highest priority.
Provide the key through the environment or config file
TestRelicReporter.finalize() runs in the WDIO launcher process and rebuilds its cloud connection from TESTRELIC_API_KEY and .testrelic/testrelic-config.json only. An API key that exists solely as a literal in the reporter's cloud options is not visible there, so the final upload is skipped. Keep the key in TESTRELIC_API_KEY (as the examples do with process.env.TESTRELIC_API_KEY) or in the config file.
Retry queue
If an upload fails (e.g., network error), the reporter writes the payload to the local queue directory and retries on the next run. Entries older than queueMaxAge are automatically discarded. Configure queueDirectory to a project-specific path if you need deterministic queue locations across CI agents.
Full configuration example
Generate a full configuration with an AI assistant
Update my wdio.conf.ts to use @testrelic/appium-analytics with a production CI configuration:
services:
- TestRelicService with:
includeDeviceLogs: true
includeNetworkLogs: true
includeScreenshots: true
screenshotOnEvery: 'failure'
includeCommands: true
includeActionSteps: true
preferBiDi: true
reporters:
- TestRelicReporter with:
outputPath: './test-results/testrelic-timeline.json'
openReport: false
testRunId: process.env.CI_BUILD_ID (or null if not set)
metadata: { branch: process.env.CI_BRANCH, commit: process.env.CI_COMMIT_SHA }
cloud: { apiKey: process.env.TESTRELIC_API_KEY, uploadArtifacts: true, artifactMaxSizeMb: 100 }
Also add an onComplete hook that calls TestRelicReporter.finalize().
Add 'import dotenv/config' at the top.
Show me the complete updated file.Update my wdio.conf.ts to use @testrelic/appium-analytics with minimal local-only configuration.
No cloud upload needed — just capture device logs and screenshots on failure.
Show me the updated services and reporters sections only.Update my wdio.conf.ts to add custom redactPatterns to TestRelicService.
I want to redact:
- Any string matching /auth_token=[^&\s]+/gi
- Any string matching /x-api-key:\s*\S+/gi
Show me the updated service options.Cloud quickstart
Connect your Appium/WebdriverIO project to the TestRelic cloud platform — create an account, add the API key, and explore your first mobile test run.
Examples
Real-world Appium/WebdriverIO test examples using @testrelic/appium-analytics — Android native, iOS native, and mobile web testing.