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
DocsReporters

Playwright Reporter

The @spekra/playwright reporter integrates seamlessly with Playwright Test to capture test results, timing data, and metadata. It's designed to be lightweight and non-blocking.

Installation

npm install @spekra/playwright

Basic 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,
    }],
  ],
});

How It Works

The reporter hooks into Playwright's test lifecycle:

  1. On test begin - Records start time and test metadata
  2. On test end - Captures result, duration, and any errors
  3. On run end - Batches and sends results to Spekra

Non-Blocking Design

The reporter is designed to never slow down or break your tests:

  • Results are batched and sent asynchronously
  • Network failures are silently logged (won't fail your build)
  • Timeouts are aggressive to prevent hanging

If the Spekra API is unavailable, your tests will still run normally. Results will be lost for that run, but the reporter won't block.

Data Captured

The reporter automatically captures:

FieldSourceExample
testFileTest locationtests/auth.spec.ts
fullTitleSuite + test nameLogin > should authenticate
suitePathDescribe hierarchy['Login', 'With valid credentials']
testNameIt/test titleshould authenticate
tagsAnnotations + inline['@smoke', '@P0']
projectPlaywright projectchromium
statusTest outcomepassed, failed, skipped, flaky
durationMsExecution time1234
retryRetry attempt0, 1, 2
errorFailure messageExpected 200, got 404

Git Information

When running in a git repository:

  • Branch name
  • Commit SHA
  • Commit author
  • Commit message

CI Information

When running in CI:

  • CI provider (GitHub, GitLab, etc.)
  • Job URL
  • Workflow/pipeline name
  • Build number

Tag Detection

Tags are extracted from multiple sources:

Inline Tags

test('should work @smoke @P0', async () => {
  // Tags: ['@smoke', '@P0']
});

Annotations

test('should work', {
  tag: ['@smoke', '@P0'],
}, async () => {
  // Tags: ['@smoke', '@P0']
});

Test.describe Tags

test.describe('Feature @regression', () => {
  test('works', async () => {
    // Tags: ['@regression']
  });
});

Quick Links

Configuration Options

All available reporter options and their defaults.

Quick Start

Get up and running in 5 minutes.

Previous

Test Identity

Next

Playwright Config