Skip to main content
Harness CI runs your pipeline from a YAML definition, stored in .harness/ in your repository or inline in the Harness UI. This guide covers a sharded setup that streams results to TestDino during the run.

Prerequisites

playwright.config.ts

Set Up Your API Key

Store your TestDino API key as a Harness secret so the pipeline reads it by reference instead of holding the value in YAML.
  1. In Harness, open Project Settings (or Organization Settings to share it across projects)
  2. Go to Secrets
  3. Click New Secret, then Text
  4. Set the Secret Name to TESTDINO_TOKEN
  5. Paste your TestDino API key into the value
  6. Save the secret
Reference it in the pipeline with <+secrets.getValue("TESTDINO_TOKEN")>. Harness masks secret values in build logs.

Basic Pipeline Config

For a simple setup without sharding, run your tests in one Run step with TESTDINO_TOKEN set. Results stream to TestDino during the run, so no separate upload step is needed. Replace <ORG_ID>, <PROJECT_ID>, <GIT_CONNECTOR_ID>, and <YOUR_REPO> with your Harness values. This example targets Harness Cloud runners; self-hosted (Docker or Kubernetes) runners use the same step with a different platform and runtime.
.harness/playwright.yaml
TipTESTDINO_TOKEN is resolved from the Harness secret you added earlier. 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. A Run step installs dependencies once, then a second Run step uses strategy.parallelism to fan out into shards
  2. Each shard runs Playwright with --shard=<n>/<total> from its iteration index
  3. Each shard streams its results to TestDino during the run
  4. Every shard sets the same TESTDINO_CI_RUN_ID so TestDino merges them into a single run
  5. No merge or upload step runs after the shards finish

Full sharded config

Replace <ORG_ID>, <PROJECT_ID>, <GIT_CONNECTOR_ID>, and <YOUR_REPO> with your Harness values. This example targets Harness Cloud runners; self-hosted (Docker or Kubernetes) runners use the same steps with a different platform and runtime.
.harness/playwright.yaml

Key details

Set the ciRunId reporter option in playwright.config to process.env.TESTDINO_CI_RUN_ID if you prefer to pass it through the config instead of relying on the environment variable.

Pipeline execution

After the pipeline starts, Harness shows the parallel shards under the playwright shard step. Each shard streams its results, and TestDino merges them into one run as they complete.

Results in TestDino

The test run appears in your TestDino dashboard with full failure details, flaky detection, and trend data as tests complete.

Troubleshooting

Confirm @testdino/playwright is in your playwright.config reporter array and TESTDINO_TOKEN resolves in the step’s envVariables. Results stream during the run, so no separate upload step is required.
Confirm every shard sets TESTDINO_CI_RUN_ID to <+pipeline.sequenceId>. A per-shard value creates one run per shard.
On runners that share one workspace across steps, run npm ci once in a separate step before the sharded step, as shown above. Concurrent installs in the sharded step race on the shared node_modules.

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