Skip to main content
What you’ll learn
  • How to stream Playwright results from Bitbucket Pipelines to TestDino
  • How to group sharded test runs into a single run
  • How to store the TESTDINO_TOKEN as a secured repository variable
Bitbucket Pipelines runs your CI from a bitbucket-pipelines.yml file in the root of your repository. This guide covers a basic run and a parallel sharded setup that streams results to TestDino during the run.

Prerequisites

Before setting up, ensure you have:
playwright.config.ts

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 in bitbucket-pipelines.yml.
  1. Open your repository in Bitbucket
  2. Go to Repository settings
  3. Under Pipelines, click Repository variables
  4. Click Add variable
  5. Set Name to TESTDINO_TOKEN
  6. Paste your TestDino API key into Value
  7. Tick Secured so the value is masked in logs
  8. Click Add
TipUse Repository variables for a project-specific token, or Workspace variables when you want the same token available across every repository in your workspace.

Basic Pipeline Config

For a simple setup without sharding, run your tests with TESTDINO_TOKEN set. Results stream to TestDino during the run, so no separate upload step is needed.
bitbucket-pipelines.yml
TipSet TESTDINO_TOKEN as a Secured repository variable so @testdino/playwright reads it during the run. Results stream live even when tests fail, so failures land on the dashboard without a separate upload step.

Sharded Test Runs

For large test suites, run shards in parallel. Each shard streams its own results, and TestDino groups them into one run when they share a ci-run-id.

How it works

  1. Each shard runs Playwright with --shard=<n>/<total> in its own Bitbucket step
  2. Each shard streams its results to TestDino during the run
  3. Every shard passes the same --ci-run-id so TestDino merges them into a single run
  4. No merge or upload step runs after the shards finish

Full sharded config

bitbucket-pipelines.yml

Key details

Set the ciRunId reporter option in playwright.config to $BITBUCKET_BUILD_NUMBER if you prefer running npx playwright test directly instead of npx tdpw test.

Pipeline execution

After the pipeline runs, Bitbucket shows each shard step in the pipeline view. Each shard streams its results, and TestDino merges them into one run. Bitbucket Pipelines build view showing shard steps streaming Playwright results to TestDino

Results in TestDino

The test run appears in your TestDino dashboard with full failure details, flaky detection, and trend data as tests complete. TestDino Test Runs dashboard showing streamed results from Bitbucket Pipelines with pass/fail counts and AI Insights

Troubleshooting

Confirm @testdino/playwright is in your playwright.config reporter array and TESTDINO_TOKEN is available to the step. Results stream during the run, so no separate upload step is required.
Pass the same --ci-run-id "$BITBUCKET_BUILD_NUMBER" (or ciRunId reporter option) to every shard. Different values create one run per shard.
Open Repository settings → Pipelines → Repository variables and confirm a variable named exactly TESTDINO_TOKEN exists and is marked Secured. Variable names are case-sensitive.

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