Cloud Quickstart
By default testrelic-appium writes a local timeline and HTML report. Add an API key and your runs also upload to the TestRelic cloud, where you can browse sessions, share results, and ask AI about failures.
1. Get an API key
Create a key in the TestRelic platform — see API keys. Keep it secret; treat it like a password.
2. Set the environment variable
Export your key before running pytest:
export TESTRELIC_API_KEY="trk_your_key_here"
The plugin uploads to the default cloud endpoint, https://platform.testrelic.ai/api/v1. The full set of cloud environment variables:
| Variable | Purpose |
|---|---|
TESTRELIC_API_KEY | API key used to authenticate uploads. |
TESTRELIC_CLOUD_ENDPOINT | Override the cloud endpoint (default https://platform.testrelic.ai/api/v1). |
TESTRELIC_UPLOAD_STRATEGY | How and when timelines are uploaded. |
TESTRELIC_CLOUD_TIMEOUT | Upload request timeout. |
TESTRELIC_RUN_TYPE | Tag the run type for the workspace. |
3. (Optional) Configure cloud in pyproject.toml
You can also drive cloud upload from your testrelic_options cloud object instead of (or alongside) environment variables:
[tool.pytest.ini_options]
testrelic_options = [
"cloud={'uploadStrategy': 'end-of-session'}",
]
Keep the API key in TESTRELIC_API_KEY (an environment variable / CI secret) and use the cloud object only for non-secret behavior like the upload strategy.
4. Run your tests
pytest
If the network is unavailable, timelines are written to the offline queue (.testrelic/queue/) and can be flushed later with testrelic-appium drain.
5. Confirm the session
Open the platform and find your run:
- The Test Runs dashboard lists every uploaded run.
- Click into a run to open the session workspace and explore the command timeline, screenshots, device logs, and network capture.