What you’ll learn
- How to upload Playwright results from Jenkins pipelines to TestDino
- How to configure sharded test runs with merged reporting
- How to store the TESTDINO_TOKEN as a Jenkins credential
Prerequisites
Before setting up, ensure you have:- A TestDino account with a project created
- A TestDino API key (Generate API Keys)
- Jenkins instance with pipeline support
- A Playwright test project (or clone the TestDino Example Repository to get started)
- Playwright configured with JSON and HTML reporters in
playwright.config.js:
playwright.config.js
Set Up Your API Key
Store your TestDino API key as a Jenkins credential so it is available to your pipeline without exposing it in logs or config files.- Open Jenkins
- Go to Manage Jenkins → Credentials
- Open the store where you want to add the secret
- Click Add Credentials
- Set Kind to
Secret text - Paste your TestDino API key into Secret
- Set the ID to
TESTDINO_TOKEN - Click Save
Basic Pipeline Config
For a simple setup without sharding, add the upload step after your Playwright tests.Jenkinsfile
Upload Options
| Flag | Description | Default |
|---|---|---|
--environment <value> | Target environment tag (staging, production, qa) | unknown |
--tag <values> | Comma-separated run tags for categorization (max 5) | None |
--upload-images | Upload image attachments | false |
--upload-videos | Upload video attachments | false |
--upload-html | Upload HTML reports | false |
--upload-traces | Upload trace files | false |
--upload-files | Upload file attachments (.md, .pdf, .txt, .log) | false |
--upload-full-json | Upload all attachments | false |
--json | Output results as JSON to stdout (for CI/CD) | false |
-v, --verbose | Enable verbose logging | false |
Sharded Test Runs
For larger test suites, Jenkins parallel stages split tests across multiple shards. Each shard produces a blob report that gets merged before uploading to TestDino.How it works
- Jenkins runs Playwright across 4 shards using parallel stages
- Each shard stashes its blob report as a build artifact
- A separate
Merge and uploadstage unstashes all blob reports, merges them into a singlereport.json, and uploads to TestDino - Each shard marks the build as
unstable(not failed) if tests fail, so the merge stage always runs
Full sharded config
Jenkinsfile
Key details
| Config Block | What It Does |
|---|---|
docker { image ... } | Uses the official Playwright Docker image with all browsers pre-installed |
parallel { stage('Shard N') } | Runs 4 shard stages in parallel |
--shard=1/4 through --shard=4/4 | Passes the shard value directly to Playwright |
stash / unstash | Passes blob reports between parallel stages and the merge stage |
unstable() | Marks the build as unstable (not failed) when tests fail, so the merge stage still runs |
junit | Publishes JUnit test results for Jenkins test reporting |
merge-reports --reporter=json | Merges blob reports into a single report.json |
archiveArtifacts in post.always | Archives the merged Playwright report regardless of build outcome |
Rerun Failed Tests
Cache test metadata to enable selective reruns:Troubleshooting
Upload step skipped after test failure
Upload step skipped after test failure
Use
unstable() instead of letting the build fail. This marks the build as unstable so subsequent stages (merge, upload) still execute. Alternatively, move the upload to a post.always block.report.json not found
report.json not found
Verify your
playwright.config.js includes both HTML and JSON reporters with HTML listed first. For sharded runs, ensure all shards stash their blob-report directory and the merge stage unstashes them before merging.TESTDINO_TOKEN not available in pipeline
TESTDINO_TOKEN not available in pipeline
Confirm the credential is set in Manage Jenkins → Credentials with the ID
TESTDINO_TOKEN. Use credentials('TESTDINO_TOKEN') in the environment block to map it to an environment variable.Blob reports not found during merge
Blob reports not found during merge
Ensure each shard uses
stash allowEmpty: true to stash blob reports even on failure. Verify that the merge stage unstashes each shard’s blob report into separate directories before copying into all-blob-reports/.Next Steps
CI Optimization
Reduce CI time with smart reruns
Branch Mapping
Map branches to environments for organized test runs
Integrations
Connect Slack, Jira, Linear, Asana, and more
TestDino MCP
Access test results and fix issues with AI agents