Cloud Quickstart
Set a TestRelic API key, configure cloud upload for your Playwright Python runs, and view results in the cloud dashboard and Session Workspace.
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 batch (default), realtime, or both |
TESTRELIC_CLOUD_TIMEOUT | Upload request timeout in milliseconds (default 30000) |
TESTRELIC_RUN_TYPE | Dashboard bucket: smoke, regression, nightly, or ci |
export TESTRELIC_API_KEY=tr_live_...
export TESTRELIC_UPLOAD_STRATEGY=batchReport generation options (output paths, redaction, capture toggles) live in testrelic_options — see Configuration.
4. Run your tests
pytestWith the default batch strategy the plugin uploads the whole run when it ends; realtime streams each test as it finishes, and both does both. If the cloud is unreachable, uploads are written to the offline queue at .testrelic/queue/ and can be replayed later with testrelic-playwright drain. Entries the server rejects move to .testrelic/queue/dead/ and aren't retried; queued entries older than 7 days are discarded.
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.
Next steps
Installation
Install pytest-playwright and testrelic-playwright, write a test, run pytest, and open the interactive HTML report — no conftest wiring required.
Configuration
Full testrelic_options reference for testrelic-playwright, plus CLI flags, environment variables, report modes, redaction, and API URL filtering.