tdpw
v1.0.26
Published
CLI tool for uploading Playwright test reports to TestDino platform with TestDino storage support
Maintainers
Readme
tdpw
🦕 TestDino CLI - Cache test metadata and upload Playwright test reports to TestDino platform
🚀 Quick Start
Cache Command
# Cache test execution metadata after Playwright runs
npx tdpw cache --token="your-api-token"
# With verbose logging
npx tdpw cache --verboseLast Failed Command
# Get last failed test cases for Playwright reruns
npx tdpw last-failed --token="your-api-token"
# Run only last failed tests
npx playwright test $(npx tdpw last-failed --token="your-api-token")Upload Command
# Upload test reports with attachments
npx tdpw upload ./playwright-report --token="your-api-token"
# Upload all attachments
npx tdpw upload ./playwright-report --token="your-api-token" --upload-full-json📦 Installation
NPX
npx tdpw <command> --token="your-token"Global Installation
npm install -g tdpw
tdpw <command> --token="your-token"Project Dependency
npm install --save-dev tdpw🎯 Features
- ✅ Test Metadata Caching - Store test execution metadata after Playwright runs
- ✅ Last Failed Tests - Retrieve and rerun only failed tests for faster CI/CD pipelines
- ✅ Zero Configuration - Auto-discovers Playwright reports and configuration
- ✅ Smart Shard Detection - Automatically detects Playwright shard information
- ✅ CI/CD Ready - Works seamlessly with GitHub Actions, GitLab CI, Jenkins, Azure DevOps
- ✅ Secure Authentication - Token-based API authentication
📖 Commands
Cache Command
Store test execution metadata after Playwright runs.
# Basic usage
npx tdpw cache --token="your-token"
# With custom working directory
npx tdpw cache --working-dir ./test-results --token="your-token"
# With verbose logging
npx tdpw cache --verbose --token="your-token"Options:
| Option | Description | Default |
| ---------------------- | ---------------------------------- | ----------------- |
| --working-dir <path> | Directory to scan for test results | Current directory |
| --cache-id <value> | Custom cache ID override | Auto-detected |
| -t, --token <value> | TestDino API token | Required |
| -v, --verbose | Enable verbose logging | false |
Last Failed Command
Retrieve cached test failures for intelligent reruns.
# Basic usage
npx tdpw last-failed --token="your-token"
# Run only last failed tests
npx playwright test $(npx tdpw last-failed --token="your-token")
# With custom branch and commit
npx tdpw last-failed --branch="main" --commit="abc123" --token="your-token"Options:
| Option | Description | Default |
| --------------------- | --------------------------- | ------------- |
| --cache-id <value> | Custom cache ID override | Auto-detected |
| --branch <value> | Custom branch name override | Auto-detected |
| --commit <value> | Custom commit hash override | Auto-detected |
| -t, --token <value> | TestDino API token | Required |
| -v, --verbose | Enable verbose logging | false |
Upload Command
Upload test reports with attachments.
# Basic upload
npx tdpw upload ./playwright-report --token="your-token"
# Upload with attachments
npx tdpw upload ./playwright-report --token="your-token" --upload-images --upload-videos
# Upload all attachments
npx tdpw upload ./playwright-report --token="your-token" --upload-full-json
# Upload with target environment tag
npx tdpw upload ./playwright-report --token="your-token" --environment="staging"Options:
| Option | Description | Default |
| ----------------------- | ------------------------------------------------------ | --------- |
| <report-directory> | Directory containing Playwright reports | Required |
| -t, --token <value> | TestDino API token | Required |
| --environment <value> | Target environment tag (e.g., staging, production, qa) | unknown |
| --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 |
| -v, --verbose | Enable verbose logging | false |
Environment Variables
export TESTDINO_TOKEN="your-api-token"
export TESTDINO_API_URL="https://api.testdino.com" # Optional: Custom API endpoint
export TESTDINO_TARGET_ENV="staging" # Optional: Target environment for Testrun🔧 CI/CD Integration
GitHub Actions
name: Playwright Tests
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
- name: Install dependencies
run: npm ci
- name: Install Playwright
run: npx playwright install --with-deps
- name: Run tests
run: npx playwright test
- name: Upload test reports
if: always()
run:
npx tdpw upload ./playwright-report --token="${{ secrets.TESTDINO_TOKEN }}"
--upload-full-jsonGitLab CI
image: node:18
stages:
- test
playwright-tests:
stage: test
script:
- npm ci
- npx playwright install --with-deps
- npx playwright test
- npx tdpw upload ./playwright-report --token="$TESTDINO_TOKEN" --upload-full-json
when: alwaysJenkins
pipeline {
agent any
environment {
TESTDINO_TOKEN = credentials('testdino-token')
}
stages {
stage('Test') {
steps {
sh 'npm ci'
sh 'npx playwright install --with-deps'
sh 'npx playwright test'
sh 'npx tdpw upload ./playwright-report --token="$TESTDINO_TOKEN" --upload-full-json'
}
}
}
}🔐 Authentication
Getting Your Token
- Sign up at TestDino
- Navigate to Settings → API Tokens
- Generate a new token
- Store it securely in your CI/CD secrets
Token Format:
trx_{environment}_{64-character-hex-string}Security Best Practices:
- Never commit tokens to version control
- Use environment variables or CI/CD secrets
- Rotate tokens regularly
🎭 Examples
Basic Workflow
# Run tests and cache metadata
npx playwright test
npx tdpw cache --token="your-token"Intelligent Test Reruns
# Run tests and cache results
npx playwright test
npx tdpw cache --token="your-token"
# On next run, execute only previously failed tests
npx playwright test $(npx tdpw last-failed --token="your-token")Complete CI/CD Workflow
# Run all tests
npx playwright test
# Cache test metadata
npx tdpw cache --token="$TESTDINO_TOKEN"
# Rerun only failed tests
if [ $? -ne 0 ]; then
FAILED=$(npx tdpw last-failed --token="$TESTDINO_TOKEN")
[ -n "$FAILED" ] && npx playwright test $FAILED
fi🆘 Support
- 📖 Documentation: docs.testdino.com
- 🐛 Issues: GitHub Issues
- 📧 Email: [email protected]
Made with ❤️ by the TestDino team
