Prerequisites
- A TestDino account with a project created
- A TestDino API key (Generate API Keys)
- An AWS account with CodeBuild access
- A Playwright test project (or clone the TestDino Example Repository to get started)
@testdino/playwrightinstalled and configured inplaywright.config.ts|js|mjs:
playwright.config.ts
Set Up Your API Key
Store your TestDino API key as a CodeBuild environment variable so it is available to your build without exposing it in buildspec files.- Open your AWS CodeBuild project
- Choose Edit
- Open the Environment section
- Add an environment variable named
TESTDINO_TOKEN - Paste your TestDino API key as the value
- Save the project
Basic Buildspec Config
For a simple setup without sharding, run your tests withTESTDINO_TOKEN set. Results stream to TestDino during the run, so no separate upload step is needed.
buildspec.yml: Basic buildspec
buildspec.yml: Basic buildspec
buildspec.yml
Sharded Test Runs
For larger test suites, CodeBuild runs Playwright across multiple shard passes within a single build. Each shard streams its own results, and TestDino groups them into one run when they share aci-run-id.
How it works
- CodeBuild runs 4 Playwright shard passes sequentially in a single build
- Each shard streams its results to TestDino during the run
- Every shard passes the same
--ci-run-idso TestDino merges them into a single run - No merge or upload step runs after the shards finish
Full sharded config
buildspec.yml: Sharded buildspec
buildspec.yml: Sharded buildspec
buildspec.yml
Key details
Set the
ciRunId reporter option in playwright.config to $CODEBUILD_BUILD_ID if you prefer running npx playwright test directly instead of npx tdpw test.
Pipeline execution
After the pipeline runs, CodeBuild logs show the TestDino output in CloudWatch under/aws/codebuild/<project-name>. Each shard streams its results, and TestDino merges them into one run.
Results in TestDino
The test run appears in your TestDino dashboard with full failure details, flaky detection, and trend data as tests complete.
Troubleshooting
Results not appearing on the dashboard
Results not appearing on the dashboard
Confirm
@testdino/playwright is in your playwright.config reporter array and TESTDINO_TOKEN is set in the project environment. Results stream during the run, so no separate upload step is required.TESTDINO_TOKEN not available in build
TESTDINO_TOKEN not available in build
Confirm the environment variable is set in your CodeBuild project under Environment → Environment variables. If using Parameter Store or Secrets Manager, verify the IAM role has read access to the secret.
Related
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