What you’ll learn
- How to upload Playwright results from GitLab CI/CD to TestDino
- How to configure sharded test runs with merged reporting
Prerequisites
Before setting up, ensure you have:- A TestDino account with a project created
- A TestDino API key (Generate API Keys)
- A GitLab account with CI/CD pipelines enabled on your repository
- A Playwright test project (or clone the TestDino Example Repository to get started)
- Playwright configured with JSON and HTML reporters in
playwright.config.js:
playwright.config.js
Set Up Your API Key
- Go to your GitLab project
- Open Settings → CI/CD
- Expand the Variables section
- Click Add variable
- Set the key to
TESTDINO_TOKEN - Paste your TestDino API key as the value
- Check Mask variable to hide it from job logs
- Save the variable
Basic Pipeline Config
For a simple setup without sharding, add the upload step after your Playwright tests..gitlab-ci.yml
Upload Options
| Flag | Description | Default |
|---|---|---|
--environment <value> | Target environment tag (staging, production, qa) | unknown |
--tag <values> | Comma-separated run tags for categorization (max 5) | None |
--upload-images | Upload image attachments | false |
--upload-videos | Upload video attachments | false |
--upload-html | Upload HTML reports | false |
--upload-traces | Upload trace files | false |
--upload-files | Upload file attachments (.md, .pdf, .txt, .log) | false |
--upload-full-json | Upload all attachments | false |
--json | Output results as JSON to stdout (for CI/CD) | false |
-v, --verbose | Enable verbose logging | false |
Sharded Test Runs
For larger test suites, GitLab CI/CDparallel keyword splits tests across multiple jobs. Each shard produces a blob report that gets merged before uploading to TestDino.
How it works
- GitLab CI/CD runs Playwright across 4 parallel shards
- Each shard saves its blob report as a job artifact
- A separate
merge-reportjob collects all blob reports, merges them into a singlereport.json, and uploads to TestDino - The merge job runs even if some shards fail (
when: always)
Full sharded config
.gitlab-ci.yml
Key details
| Config Block | What It Does |
|---|---|
parallel: 4 | Runs 4 shard jobs in parallel |
--shard=$CI_NODE_INDEX/$CI_NODE_TOTAL | GitLab provides 1-based index and total count automatically |
artifacts: when: always | Saves blob reports even if shards fail |
needs: - job: playwright | Downloads artifacts from all parallel shard jobs |
when: always on merge job | Ensures merge and upload run regardless of shard outcomes |
Pipeline execution
After the pipeline runs, GitLab shows all shard jobs and the merge stage in the pipeline view.
Results in TestDino
Once uploaded, the test run appears in your TestDino dashboard with full failure details, flaky detection, and trend data.
Rerun Failed Tests
Cache test metadata to enable selective reruns:.gitlab-ci.yml
.gitlab-ci.yml
Troubleshooting
Upload step skipped after test failure
Upload step skipped after test failure
Ensure
artifacts: when: always is set on the test job so blob reports are saved on failure. The merge-report job must use when: always to run regardless of shard outcomes.report.json not found
report.json not found
Verify your
playwright.config.js includes both HTML and JSON reporters with HTML listed first. For sharded runs, ensure blob reports are listed in the test job artifacts: paths.TESTDINO_TOKEN not available in job
TESTDINO_TOKEN not available in job
Confirm the variable is set in Settings → CI/CD → Variables. If the variable is marked Protected, it is only available on protected branches.
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
GitLab OAuth Integration
MR comments and merge request sync