Get Started with Playwright (Python)
Install pytest-playwright and testrelic-playwright, write a test, run pytest, and open the interactive HTML report — no conftest wiring required.
Getting started takes four steps: install the packages, install the browsers, write a test, and run pytest. The plugin auto-registers through a pytest11 entry point, so there is no conftest.py wiring to add.
Paste this prompt into your coding agent:
Add TestRelic analytics to this Playwright Python project.
1. Install the packages: pip install pytest-playwright testrelic-playwright
2. Install the browsers: playwright install
3. Add a simple Playwright test under tests/ that uses the `page` fixture.
4. Do NOT add any conftest.py wiring or imports — the plugin auto-registers
via its pytest11 entry point.
5. Run `pytest` and open test-results/analytics-timeline.html to confirm the
report was generated.Full quickstart
pip install pytest-playwright testrelic-playwright
playwright install
pytestThere is nothing to import and no conftest.py to edit. As long as testrelic-playwright is installed in the same environment as pytest, the plugin is active automatically.
Output files
A run writes the analytics timeline into test-results/:
test-results/
├── analytics-timeline.json
└── analytics-timeline.htmlOpen analytics-timeline.html in any browser for the interactive report. Outside of CI the report opens automatically when the run finishes.
Requirements
| Requirement | Version |
|---|---|
| Python | >=3.9 |
| pytest | >=7.0 |
| pytest-playwright | >=0.5.0 |
| playwright | >=1.35 |
| httpx | >=0.27 |
Next steps
Package Overview
How testrelic-playwright works as a pytest plugin: the testrelic_options mechanism, the CLI, the streaming pipeline, the local report server, and cloud upload.
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.