Skip to main content
tdpw uploads Playwright test reports to TestDino, caches test metadata for intelligent reruns, and retrieves previously failed tests for selective re-execution.

Use this pre-built prompt to integrate tdpw into your project.

CursorOpen in Cursor

Quick Reference

CommandWhat it does
uploadUpload Playwright JSON and HTML reports to TestDino
cacheStore test execution metadata for intelligent reruns
last-failedRetrieve previously failed tests for selective reruns

Prerequisites

  • Node.js >= 18.0.0
  • @playwright/test >= 1.52.0
  • TestDino API token (generate one)
  • Git initialized repository (for commit and branch metadata)

Installation

npm install tdpw
Or use without installing:
npx tdpw <command> --token="your-token"

Upload

Uploads Playwright test reports to TestDino with optional attachments.
npx tdpw upload ./playwright-report --token="your-token"
With full attachments:
npx tdpw upload ./playwright-report --token="your-token" --upload-full-json
With tags and environment:
npx tdpw upload ./playwright-report --token="your-token" --environment="staging" --tag="regression,smoke"

Upload Options

FlagDescriptionDefault
<report-directory>Directory containing Playwright reportsRequired
-t, --token <value>TestDino API tokenRequired
--environment <value>Target environment tagunknown
--tag <values>Comma-separated run tags (max 5)None
--upload-imagesUpload image attachmentsfalse
--upload-videosUpload video attachmentsfalse
--upload-htmlUpload HTML reports with screenshots and tracesfalse
--upload-tracesUpload trace filesfalse
--upload-filesUpload file attachments (.md, .pdf, .txt, .log)false
--upload-full-jsonUpload all attachmentsfalse
--jsonOutput results as JSON for CI/CD pipelinesfalse
-v, --verboseEnable verbose loggingfalse

Run Tags

Tags categorize entire test runs. Format: letters, numbers, hyphens, underscores, and dots only. Maximum 5 tags per run.
npx tdpw upload ./playwright-report --token="your-token" --tag="smoke,regression,v1.2.3"

JSON Output for CI/CD

Use --json to capture structured output in CI pipelines:
RESULT=$(npx tdpw upload ./playwright-report --token="$TESTDINO_TOKEN" --json)
TEST_RUN_ID=$(echo "$RESULT" | jq -r '.data.testRunId')
URL=$(echo "$RESULT" | jq -r '.data.url')
Success response:
{
  "success": true,
  "data": { "testRunId": "test_run_abc123", "url": "https://app.testdino.com/..." }
}
Error response:
{
  "success": false,
  "error": { "code": "AUTH_ERROR", "message": "Invalid API key or unauthorized access" }
}

Cache

Stores test execution metadata after Playwright runs complete. This metadata enables last-failed to identify which tests to rerun.
npx tdpw cache --token="your-token"
With a custom working directory:
npx tdpw cache --working-dir ./test-results --token="your-token"

Cache Options

FlagDescriptionDefault
--working-dir <path>Directory to scan for test resultsCurrent directory
--cache-id <value>Custom cache ID overrideAuto-detected
-t, --token <value>TestDino API tokenRequired
-v, --verboseEnable verbose loggingfalse

Last Failed

Retrieves previously failed tests for selective reruns. Outputs test file paths that can be passed directly to npx playwright test.
npx tdpw last-failed --token="your-token"
Rerun only failed tests:
npx playwright test $(npx tdpw last-failed --token="your-token")

Last Failed Options

FlagDescriptionDefault
--cache-id <value>Custom cache ID overrideAuto-detected
--branch <value>Custom branch name overrideAuto-detected
--commit <value>Custom commit hash overrideAuto-detected
-t, --token <value>TestDino API tokenRequired
-v, --verboseEnable verbose loggingfalse

Intelligent Rerun Workflow

# Run all tests
npx playwright test

# Cache the results
npx tdpw cache --token="$TESTDINO_TOKEN"

# Upload the report
npx tdpw upload ./playwright-report --token="$TESTDINO_TOKEN" --upload-full-json

# On next run, rerun only failures
npx playwright test $(npx tdpw last-failed --token="$TESTDINO_TOKEN")

Environment Variables

VariableDescription
TESTDINO_TOKENAuthentication token
TESTDINO_TARGET_ENVDefault environment tag
TESTDINO_RUN_TAGSDefault comma-separated run tags

Configure Playwright Reporters

Add JSON and HTML reporters to your Playwright config before uploading:
playwright.config.js
reporter: [
  ['html', { outputDir: './playwright-report' }],
  ['json', { outputFile: './playwright-report/report.json' }],
]
The HTML reporter must be listed before the JSON reporter. Playwright’s HTML reporter clears its output directory on each run, so placing it first ensures report.json is not deleted.

CI/CD Integration

.github/workflows/test.yml
name: Playwright Tests
on: [push, pull_request]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: actions/setup-node@v4
        with:
          node-version: '20'

      - name: Install dependencies
        run: npm ci

      - name: Install Playwright
        run: npx playwright install --with-deps

      - name: Run tests
        run: npx playwright test

      - name: Upload to TestDino
        if: always()
        env:
          TESTDINO_TOKEN: ${{ secrets.TESTDINO_TOKEN }}
        run: npx tdpw upload ./playwright-report --upload-html

What Gets Collected

CategoryData
GitBranch, commit hash, author, message, repository URL
CIProvider, build ID, PR details
SystemOS, CPU, memory, Node.js version
PlaywrightVersion, workers, projects, shard info
ArtifactsScreenshots, videos, traces, console output (when --upload-html or --upload-full-json used)
Annotationstestdino: annotations from test metadata (guide)

Troubleshooting

Verify the token is set:
echo $TESTDINO_TOKEN
Pass it directly to confirm:
npx tdpw upload ./playwright-report --token="your-api-token"
Generate a new token from API Keys if the issue persists.
Your account reached its monthly quota. Tests continue to run normally. Only uploads to TestDino pause until the quota resets.Upgrade your plan or wait for the monthly reset.
Ensure your Playwright config includes the JSON reporter:
reporter: [
  ['html', { outputDir: './playwright-report' }],
  ['json', { outputFile: './playwright-report/report.json' }],
]
Confirm the output directory matches the path passed to tdpw upload.
npx tdpw upload ./playwright-report --verbose

View Test Runs

Explore test results in the platform

Rerun Failed Tests

CI workflow for rerunning only failures

Python CLI

Use TestDino with pytest

Code Coverage

Collect coverage from Playwright tests