Skip to main content
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
Set up a Jenkins pipeline to upload Playwright test results to TestDino and view aggregated analytics, failure analysis, and flaky test detection on your dashboard. This guide covers a basic pipeline, sharded pipeline for parallel test execution across multiple shards, and merged reporting.

Prerequisites

Before setting up, ensure you have:
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.
  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, add the upload step after your Playwright tests.
Jenkinsfile
TipThe post.always block ensures the upload runs even if tests fail. The credentials() function maps the Jenkins credential to an environment variable accessible in the script.

Upload Options

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

  1. Jenkins runs Playwright across 4 shards using parallel stages
  2. Each shard stashes its blob report as a build artifact
  3. A separate Merge and upload stage unstashes all blob reports, merges them into a single report.json, and uploads to TestDino
  4. Each shard marks the build as unstable (not failed) if tests fail, so the merge stage always runs

Full sharded config

Jenkinsfile

Key details

Pipeline execution

After the pipeline runs, Jenkins shows each stage in the pipeline graph with pass, fail, or unstable status. Jenkins pipeline stages view showing Checkout SCM, Checkout, Run Playwright shards (unstable), Merge and upload (passed), and Post Actions stages with step details

Results in TestDino

Once uploaded, the test run appears in your TestDino dashboard with full failure details, flaky detection, and trend data. TestDino Test Runs dashboard showing uploaded results from Jenkins pipeline with pass/fail counts and AI Insights

Rerun Failed Tests

Cache test metadata to enable selective reruns:
Rerun only failed tests on the next run:
For advanced rerun strategies, caching patterns, and CI optimization techniques, see CI Optimization.

Troubleshooting

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.
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.
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.
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