Skip to main content
Set up a Jenkins pipeline that streams Playwright test results to TestDino during the run and view aggregated analytics, failure analysis, and flaky test detection on your dashboard.

Prerequisites

playwright.config.ts

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.
  1. Open Jenkins
  2. Go to Manage Jenkins → Credentials
  3. Open the store where you want to add the secret
  4. Click Add Credentials
  5. Set Kind to Secret text
  6. Paste your TestDino API key into Secret
  7. Set the ID to TESTDINO_TOKEN
  8. Click Save
WarningNever commit your API key directly in pipeline files. Always use Jenkins credentials. Secret credentials are not exposed in build logs.

Basic Pipeline Config

For a simple setup without sharding, run your tests with the TESTDINO_TOKEN credential in scope. Results stream to TestDino during the run, so no separate upload stage is needed.
Jenkinsfile
TipThe credentials() function maps the Jenkins credential to the TESTDINO_TOKEN environment variable @testdino/playwright reads. Results stream live even when tests fail, so failures land on the dashboard without a post.always upload stage.

Sharded Test Runs

For larger test suites, Jenkins parallel stages split tests across multiple shards. Each shard streams its own results, and TestDino groups them into one run when they share a ci-run-id.

How it works

  1. Jenkins runs Playwright across 4 shards using parallel stages
  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 stage runs after the shards finish

Full sharded config

Jenkinsfile

Key details

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

Pipeline execution

After the pipeline runs, Jenkins shows each stage in the pipeline graph with pass, fail, or unstable status. Each shard streams its results, and TestDino merges them into one run. Jenkins pipeline stages view showing Checkout and parallel Playwright shard stages streaming 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 Jenkins pipeline with pass/fail counts and AI Insights

Troubleshooting

Confirm @testdino/playwright is in your playwright.config reporter array and the TESTDINO_TOKEN credential is mapped in the environment block. Results stream during the run, so no separate upload stage is required.
Pass the same --ci-run-id "$BUILD_TAG" (or ciRunId reporter option) to every shard. Different values create one run per shard.
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.

CI Optimization

Reduce CI time with smart reruns

Environment Mapping

Route test results to Dev, Staging, or Production by branch

Integrations

Connect Slack, Jira, Linear, Asana, and more

TestDino MCP

Access test results and fix issues with AI agents