Skip to main content

CLI tool for uploading Playwright test reports to TestDino platform with TestDino storage support

Project description

testdino

PyPI version Python License: MIT

TestDino CLI - Cache test metadata and upload Playwright test reports to TestDino platform

Quick Start

⚠️ Important: The testdino upload command requires a JSON report to be generated during test execution. Make sure to:

  1. Install required plugins: pip install pytest-playwright-json pytest-html
  2. Run your tests with --playwright-json flag: pytest --playwright-json=test-results/report.json
  3. Optionally generate HTML reports: pytest --html=test-results/index.html --self-contained-html

Cache Command

# Cache test execution metadata after Playwright runs
testdino cache --token="your-api-token"

# With custom directory (recommended when test results are in a specific folder)
testdino cache --working-dir test-results --token="your-api-token"

# With verbose logging
testdino cache --working-dir test-results --verbose --token="your-api-token"

Last Failed Command

# Get last failed test cases for Playwright reruns
testdino last-failed --token="your-api-token"

# Run only last failed tests
pytest $(testdino last-failed --token="your-api-token")

Upload Command

# Upload test reports with attachments
testdino upload ./test-results --token="your-api-token"

# Upload all attachments
testdino upload ./test-results --token="your-api-token" --upload-full-json

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
testdino cache --token="your-token"

# With custom working directory
testdino cache --working-dir ./test-results --token="your-token"

# With verbose logging
testdino 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
testdino last-failed --token="your-token"

# Run only last failed tests
pytest $(testdino last-failed --token="your-token")

# With custom branch and commit
testdino 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.

⚠️ Important: The testdino upload command requires a JSON report to function. You must:

  1. Install required plugins: pip install pytest-playwright-json pytest-html
  2. Run your tests with the --playwright-json flag: pytest --playwright-json=test-results/report.json
  3. Optionally generate HTML reports: pytest --html=test-results/index.html --self-contained-html
# Basic upload
testdino upload ./test-results --token="your-token"

# Upload with attachments
testdino upload ./test-results --token="your-token" --upload-images --upload-videos

# Upload all attachments
testdino upload ./test-results --token="your-token" --upload-full-json

Options:

Option Description
<report-directory> Directory containing Playwright reports (required)
-t, --token <value> TestDino API token (required)
--upload-images Upload image attachments
--upload-videos Upload video attachments
--upload-html Upload HTML reports
--upload-traces Upload trace files
--upload-files Upload file attachments (.md, .pdf, .txt, .log)
--upload-full-json Upload all attachments
-v, --verbose Enable verbose logging

Environment Variables

export TESTDINO_TOKEN="your-api-token"

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-python@v5
        with:
          python-version: '3.11'

      - name: Install dependencies
        run: |
          pip install pytest pytest-playwright pytest-playwright-json pytest-html testdino
          playwright install chromium --with-deps

      - name: Run tests
        run: |
          pytest \
            --playwright-json=test-results/report.json \
            --html=test-results/index.html \
            --self-contained-html

      - name: Cache rerun metadata
        if: always()
        run: testdino cache --working-dir test-results --token="${{ secrets.TESTDINO_TOKEN }}" -v

      - name: Upload test reports
        if: always()
        run: testdino upload ./test-results --token="${{ secrets.TESTDINO_TOKEN }}" --upload-full-json

GitLab CI

image: python:3.11

stages:
  - test

playwright-tests:
  stage: test
  script:
    - pip install pytest pytest-playwright pytest-playwright-json pytest-html testdino
    - playwright install chromium --with-deps
    - pytest --playwright-json=test-results/report.json --html=test-results/index.html --self-contained-html
    - testdino upload ./test-results --token="$TESTDINO_TOKEN" --upload-full-json
  when: always

Jenkins

pipeline {
    agent any

    environment {
        TESTDINO_TOKEN = credentials('testdino-token')
    }

    stages {
        stage('Test') {
            steps {
                sh 'pip install pytest pytest-playwright pytest-playwright-json pytest-html testdino'
                sh 'playwright install chromium --with-deps'
                sh 'pytest --playwright-json=test-results/report.json --html=test-results/index.html --self-contained-html'
                sh 'testdino upload ./test-results --token="$TESTDINO_TOKEN" --upload-full-json'
            }
        }
    }
}

Authentication

Getting Your Token

  1. Sign up at TestDino
  2. Navigate to Settings > API Tokens
  3. Generate a new token
  4. 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 with JSON and HTML reports
pytest \
  --playwright-json=test-results/report.json \
  --html=test-results/index.html \
  --self-contained-html

# Cache metadata (specify directory where test results are located)
testdino cache --working-dir test-results --token="your-token"

Intelligent Test Reruns

# Run tests with JSON and HTML reports, then cache results
pytest \
  --playwright-json=test-results/report.json \
  --html=test-results/index.html \
  --self-contained-html
testdino cache --working-dir test-results --token="your-token"

# On next run, execute only previously failed tests
pytest $(testdino last-failed --token="your-token")

Complete CI/CD Workflow

# Run all tests with JSON and HTML reports
pytest \
  --playwright-json=test-results/report.json \
  --html=test-results/index.html \
  --self-contained-html

# Cache test metadata (specify directory where test results are located)
testdino cache --working-dir test-results --token="$TESTDINO_TOKEN"

# Rerun only failed tests
if [ $? -ne 0 ]; then
  FAILED=$(testdino last-failed --token="$TESTDINO_TOKEN")
  [ -n "$FAILED" ] && pytest $FAILED
fi

Support


Made with love by the TestDino team

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

testdino-1.0.22.tar.gz (63.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

testdino-1.0.22-py3-none-any.whl (77.0 kB view details)

Uploaded Python 3

File details

Details for the file testdino-1.0.22.tar.gz.

File metadata

  • Download URL: testdino-1.0.22.tar.gz
  • Upload date:
  • Size: 63.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for testdino-1.0.22.tar.gz
Algorithm Hash digest
SHA256 cc5fe434723859a411257b3f989cb2d418f52bfae11120b3c45813bba5005be9
MD5 871ef80848c25c740530185aa882f2c2
BLAKE2b-256 be6b79ed6ec2aac3910dfc2ecefea6c42109ff6aab37e05c7647afc9e02bacc5

See more details on using hashes here.

File details

Details for the file testdino-1.0.22-py3-none-any.whl.

File metadata

  • Download URL: testdino-1.0.22-py3-none-any.whl
  • Upload date:
  • Size: 77.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.2

File hashes

Hashes for testdino-1.0.22-py3-none-any.whl
Algorithm Hash digest
SHA256 fabf0813d6b508141d14d2ab5983b10239d957235810c6429aca87194a081064
MD5 744141798ad40d60818f038da77cb89c
BLAKE2b-256 3c8517137443dd5f2427e166aad23ffea97c296fd4b97fd4cda459fee443213f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page