What you’ll learn
- Three commands:
upload,cache, andlast-failed - Upload options for HTML, images, videos, traces, and full bundles
- How to cache metadata and rerun only failed tests
testdino is the TestDino Python CLI for Playwright. It uploads pytest-based Playwright reports, caches test metadata, and retrieves failed tests for selective reruns.
Prerequisites
- Python
>= 3.9 pytestwithpytest-playwrightpytest-playwright-json(generates the required JSON report)pytest-html(generates HTML report)- TestDino API token (generate one)
- Git initialized repository (for commit and branch metadata)
- pytest configured with JSON and HTML reporter flags:
Installation
Quick Start
The upload command requires a JSON report. Always run pytest with the
--playwright-json flag.Commands
upload
Upload Playwright test reports and artifacts to TestDino.
| Flag | Description |
|---|---|
--upload-images | Upload screenshots |
--upload-videos | Upload video recordings |
--upload-html | Upload HTML reports |
--upload-traces | Upload trace files |
--upload-files | Upload file attachments (.md, .pdf, .txt, .log) |
--upload-full-json | Upload all attachments |
cache
Store test execution metadata after a run. Powers the last-failed command.
| Option | Description | Default |
|---|---|---|
--working-dir <path> | Directory containing test results | Current directory |
--cache-id <value> | Custom cache ID override | Auto-detected |
last-failed
Retrieve cached test failures for reruns. Outputs test identifiers that pass directly to pytest.
| Option | Description | Default |
|---|---|---|
--branch <value> | Branch name override | Auto-detected |
--commit <value> | Commit hash override | Auto-detected |
--shard <value> | Shard specification (e.g., 2/5) | None |
--environment <value> | Environment name for filtering | None |
--cache-id <value> | Custom cache ID override | Auto-detected |
Global Options
These options apply to all commands.| Option | Description |
|---|---|
-t, --token <value> | TestDino API token (required) |
-v, --verbose | Enable verbose logging |
Configuration
Set environment variables to avoid passing flags with each command.| Variable | Description |
|---|---|
TESTDINO_TOKEN | Authentication token |
TESTDINO_TARGET_ENV | Default environment tag |
CI/CD Integration
- GitHub Actions
- GitHub Actions (Sharded)
- GitLab CI
- Jenkins
.github/workflows/test.yml
Related
View Test Runs
Explore test results in the platform
CI Optimization
Optimize your CI pipeline
Node.js CLI
Use TestDino with Playwright for Node.js
Generate API Keys
Create and manage API tokens