What you’ll learn
- How to upload Playwright results from Bitbucket Pipelines to TestDino
- How to configure sharded test runs with merged reporting
- How to store the TESTDINO_TOKEN as a secured repository variable
bitbucket-pipelines.yml file in the root of your repository. This guide covers a basic single-step upload and a parallel sharded setup with merged reporting.
Prerequisites
Before setting up, ensure you have:- A TestDino account with a project created
- A TestDino API key (Generate API Keys)
- A Bitbucket repository with Pipelines enabled
- 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 secured repository variable so it is available to your pipeline without exposing it inbitbucket-pipelines.yml.
- Open your repository in Bitbucket
- Go to Repository settings
- Under Pipelines, click Repository variables
- Click Add variable
- Set Name to
TESTDINO_TOKEN - Paste your TestDino API key into Value
- Tick Secured so the value is masked in logs
- Click Add
Basic Pipeline Config
For a simple setup without sharding, add the upload step after your Playwright tests.bitbucket-pipelines.yml
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 large test suites, run shards in parallel and merge the results before uploading to TestDino.How it works
- Each shard runs
npx playwright test --shard=<n>/<total>in its own Bitbucket step - Each shard publishes its
blob-report/directory as a Pipelines artifact - A final step pulls every shard’s artifacts into one folder
npx playwright merge-reportsproduces a single JSON report, which is uploaded to TestDino
Full sharded config
bitbucket-pipelines.yml
blob reporter in your Playwright config:
playwright.config.js
Key details
| Detail | Notes |
|---|---|
parallel: | Bitbucket runs every step under this block at the same time, on separate runners. |
artifacts: | Files matching these globs are saved and downloaded into every later step in the same pipeline. |
blob-report/** | Playwright’s blob reporter writes one file per shard. Configure it in playwright.config.js. |
| Auto-download | The merge step receives all shard artifacts in blob-report/ with no explicit download call. |
|| true | Keeps the shard green even on test failures so the merge and upload step always runs. |
merge-reports | Playwright’s built-in tool that combines blob reports into a single JSON, HTML, or JUnit report. |
playwright-report/** | Final artifact you can download from Bitbucket’s build page for a copy outside TestDino. |
TESTDINO_TOKEN | Read from the Secured repository variable you added earlier. Masked in logs. |
Pipeline execution
After the pipeline runs, Bitbucket shows each shard step and the merge-and-upload step in the pipeline view.
Results in TestDino
Once uploaded, the test run appears in your TestDino dashboard with full failure details, flaky detection, and trend data.
Rerun Failed Tests
Cache test metadata after a run, then rerun only the previously failed tests on the next pipeline:bitbucket-pipelines.yml
bitbucket-pipelines.yml
Troubleshooting
Upload step skipped after test failure
Upload step skipped after test failure
Bitbucket stops a step on the first non-zero exit code. Add
|| true after npx playwright test so the upload step still runs when tests fail. TestDino records the failures in the run.report.json not found
report.json not found
Confirm
playwright.config.js enables both the HTML and JSON reporters, or blob and json for sharded runs. For sharded pipelines, check that every shard step lists blob-report/** under artifacts: so the merge step has them all.TESTDINO_TOKEN not available in the pipeline
TESTDINO_TOKEN not available in the pipeline
Open Repository settings → Pipelines → Repository variables and confirm a variable named exactly
TESTDINO_TOKEN exists and is marked Secured. Variable names are case-sensitive.Blob reports missing during merge
Blob reports missing during merge
Bitbucket only auto-downloads artifacts from steps that completed in the same pipeline. Check that every shard step finished, even if tests failed, and that its
artifacts: glob matches the blob-report/ directory. Use a wildcard like blob-report/** rather than a single filename.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