Cloud Quickstart
By default testrelic-playwright produces local reports. To upload runs to the TestRelic cloud — where they appear in the dashboard and Session Workspace — set an API key and point the plugin at the cloud endpoint.
1. Create an API key
Generate a key from your TestRelic account. See API Keys for how to create and manage them.
2. Set TESTRELIC_API_KEY
Export the key in the environment where you run pytest:
export TESTRELIC_API_KEY=tr_live_...
Do not hardcode the key into source. Use the shell environment or your project's existing secrets mechanism (for example, CI secrets).
3. Configure cloud upload
The cloud endpoint defaults to https://platform.testrelic.ai/api/v1, so an API key is usually all you need. The remaining behavior is controlled with environment variables:
| Variable | Purpose |
|---|---|
TESTRELIC_API_KEY | Your TestRelic API key (required for upload) |
TESTRELIC_CLOUD_ENDPOINT | Override the cloud endpoint (default https://platform.testrelic.ai/api/v1) |
TESTRELIC_UPLOAD_STRATEGY | Choose realtime or batch uploads |
TESTRELIC_CLOUD_TIMEOUT | Upload request timeout |
export TESTRELIC_API_KEY=tr_live_...
export TESTRELIC_UPLOAD_STRATEGY=batch
Report generation options (output paths, redaction, capture toggles) live in testrelic_options — see Configuration.
4. Run your tests
pytest
The plugin uploads results as the run proceeds (or in a batch at the end, depending on your strategy). If the cloud is unreachable, uploads are written to the offline queue at .testrelic/queue/ and can be replayed later with testrelic-playwright drain.
5. Confirm in the dashboard
Open the TestRelic cloud and find your run in Test Runs. Select it to open the Session Workspace, where the navigation timeline, API calls, assertions, console logs, and artifacts are all available.
Cloud device providers
When tests run on a cloud device grid, the upload auto-detects BrowserStack and LambdaTest and labels the run with the provider. No extra configuration is required.