Spekra
Docs

Getting Started

  • Overview
  • Playwright
  • Jest
  • Vitest

Core Concepts

  • Flaky Tests
  • Stability Metrics
  • Test Identity

Reporters

  • Playwright
  • Playwright Config
  • Jest
  • Jest Config
  • Vitest
  • Vitest Config

Platform

  • Dashboard
  • Flaky Tests View
  • Test Runs
  • API Keys
  • Rate Limits

CI/CD

  • Overview
  • GitHub Actions
  • GitLab CI

Security

  • Overview
  • Data Handling
  • Compliance

Troubleshooting

  • Overview
  • Connection Issues
  • Missing Data
DocsGetting StartedPlaywright

Playwright Setup

Get Spekra integrated with your Playwright test suite in under 5 minutes. This guide will walk you through installation, configuration, and running your first test.

Prerequisites

  • Node.js 18 or later
  • A Playwright test suite
  • A Spekra account with an API key

Installation

Install the Spekra Playwright reporter:

npm install @spekra/playwright

Configuration

Add the reporter to your playwright.config.ts:

import { defineConfig } from '@playwright/test';

export default defineConfig({
  reporter: [
    ['html'],
    ['@spekra/playwright', {
      apiKey: process.env.SPEKRA_API_KEY,
    }],
  ],
  // ... rest of your config
});

Set Your API Key

Add your API key to your environment. You can get your API key from Settings → API Keys.

export SPEKRA_API_KEY=sk_your_api_key_here

Secure your API key

Never commit your API key to source control. Use environment variables or a secrets manager in CI.

Run Your Tests

That's it! Run your tests as usual:

npx playwright test

Your test results will appear in your Spekra dashboard within seconds of the run completing.

What Gets Captured

The reporter automatically captures:

DataDescription
Test resultsPass, fail, skip, and flaky status
DurationHow long each test took
RetriesNumber of retries attempted
ProjectsPlaywright project names (e.g., chromium, firefox)
TagsFrom annotations and @tag syntax in titles
Suite pathDescribe block hierarchy
Git infoBranch, commit SHA, author
CI infoJob URL, workflow name

Next Steps

  • Configuration options - All available reporter options
  • CI/CD integration - Set up reporting in your CI pipeline
  • Understanding flaky tests - Learn how Spekra detects flaky tests

Previous

Overview

Next

Jest