npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

stabilify

v0.1.5

Published

AI-powered auto-healing for Playwright tests

Downloads

179

Readme

Stabilify

npm version License: MIT

Ein Self-Healing Reporter für Playwright, der fehlgeschlagene Tests analysiert und alle relevanten Informationen für die Weiterverarbeitung sammelt.

Features

  • 📊 Detaillierte Failure-Reports - Sammelt alle relevanten Informationen zu fehlgeschlagenen Tests
  • 🔄 Retry-Tracking - Verfolgt alle Wiederholungsversuche mit Details
  • 📸 Artefakte - Screenshots, Traces und Videos werden automatisch erfasst
  • 🚀 Cloud-Upload - Optionaler Upload zum Stabilify-Server für zentrale Analyse
  • 🔧 CI/CD-Integration - Automatische Erkennung von 8+ CI-Providern
  • 📝 CTRF-kompatibel - Output-Format basiert auf dem Common Test Report Format

Installation

npm install stabilify

Verwendung

Füge den Reporter in deiner playwright.config.ts hinzu:

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

export default defineConfig({
  reporter: [
    ["list"],
    ["stabilify/reporter", { outputFile: "stabilify.json" }],
  ],
  use: {
    screenshot: "only-on-failure",
    trace: "retain-on-failure",
  },
});

Konfiguration

Reporter-Optionen

| Option | Typ | Beschreibung | | ------------- | ------------------- | ----------------------------------------------------------- | | outputFile | string | Basis-Dateiname oder relativer Pfad für die Ausgabe | | environment | ReportEnvironment | Umgebungsinformationen für den Report (siehe unten) | | upload | UploadOptions | Upload-Konfiguration für automatischen Upload (siehe unten) |

Environment-Optionen

Du kannst zusätzliche Kontextinformationen über die Testumgebung mitgeben:

export default defineConfig({
  reporter: [
    ["list"],
    [
      "stabilify/reporter",
      {
        outputFile: "stabilify.json",
        environment: {
          appName: "MyApp",
          appVersion: "1.0.0",
          buildName: "CI Build #123",
          buildNumber: "123",
          buildUrl: "https://ci.example.com/builds/123",
          repositoryName: "my-org/my-repo",
          repositoryUrl: "https://github.com/my-org/my-repo",
          branchName: "main",
          commit: "abc123def",
          testEnvironment: "staging",
        },
      },
    ],
  ],
});

Alle Environment-Felder sind optional:

| Feld | Beschreibung | | ----------------- | --------------------------------- | | appName | Name der Anwendung | | appVersion | Version der Anwendung | | osPlatform | Betriebssystem-Plattform | | osRelease | Betriebssystem-Release | | osVersion | Betriebssystem-Version | | buildName | Name des CI-Builds | | buildNumber | Nummer des CI-Builds | | buildUrl | URL zum CI-Build | | repositoryName | Name des Repositories | | repositoryUrl | URL zum Repository | | branchName | Git-Branch | | commit | Git-Commit-Hash | | testEnvironment | Testumgebung (z.B. staging, prod) |

Upload-Optionen

Du kannst den automatischen Upload von Test-Failures zum Stabilify-Server aktivieren:

export default defineConfig({
  reporter: [
    ["list"],
    [
      "stabilify/reporter",
      {
        outputFile: "stabilify.json",
        upload: {
          enabled: true,
          apiKey: process.env.STABILIFY_API_KEY, // Empfohlen: API-Key aus Umgebungsvariable
          retryAttempts: 3, // Optional: Anzahl der Wiederholungsversuche bei Fehlern
          retryDelayMs: 1000, // Optional: Verzögerung zwischen Wiederholungsversuchen
        },
      },
    ],
  ],
});

Upload-Felder:

| Feld | Typ | Beschreibung | Default | | --------------- | --------- | ------------------------------------------------------------ | ------- | | enabled | boolean | Upload aktivieren/deaktivieren | false | | apiKey | string | API-Key für Authentifizierung (erforderlich wenn enabled) | - | | retryAttempts | number | Anzahl der Wiederholungsversuche bei Upload-Fehlern | 3 | | retryDelayMs | number | Verzögerung zwischen Wiederholungsversuchen in Millisekunden | 1000 |

Hinweis: Der API-Key sollte aus Sicherheitsgründen immer über eine Umgebungsvariable (STABILIFY_API_KEY) bereitgestellt werden.

Test-Run Tracking

Wenn Upload aktiviert ist, wird automatisch ein Test-Run Tracking durchgeführt:

  • Report ID: Jeder Test-Run erhält eine eindeutige UUID (reportId), die alle Failures eines Runs gruppiert
  • CI/CD Metadaten: Automatische Erkennung von CI-Provider, Branch, Commit, Job-ID und Build-URL
  • Test-Statistiken: Anzahl der Tests (gesamt, bestanden, fehlgeschlagen, übersprungen)

Unterstützte CI-Provider:

  • GitHub Actions (github)
  • GitLab CI (gitlab)
  • Jenkins (jenkins)
  • CircleCI (circleci)
  • Travis CI (travis-ci)
  • Azure Pipelines (azure-pipelines)
  • Bitbucket Pipelines (bitbucket-pipelines)
  • TeamCity (teamcity)

Die CI-Metadaten werden automatisch aus den Umgebungsvariablen des jeweiligen CI-Systems extrahiert.

Umgebungsvariablen

Die Konfiguration funktioniert analog zum Playwright JSON Reporter:

| Umgebungsvariable | Beschreibung | Default | | ----------------------- | ------------------------------------------------------------------ | --------------------------- | | STABILIFY_OUTPUT_DIR | Verzeichnis für die Ausgabe. Ignoriert wenn OUTPUT_FILE gesetzt. | self-healing-output | | STABILIFY_OUTPUT_NAME | Basis-Dateiname, relativ zum Output-Verzeichnis | failures-{timestamp}.json | | STABILIFY_OUTPUT_FILE | Vollständiger Pfad. Überschreibt OUTPUT_DIR und OUTPUT_NAME | - |

Priorität

  1. STABILIFY_OUTPUT_FILE (vollständiger Pfad) - höchste Priorität
  2. outputFile Option + STABILIFY_OUTPUT_DIR
  3. STABILIFY_OUTPUT_NAME + STABILIFY_OUTPUT_DIR
  4. Default: {configDir}/self-healing-output/failures-{timestamp}.json

Beispiele

Mit Config-Option

["stabilify/reporter", { outputFile: "my-report.json" }],

Ausgabe: {projekt}/self-healing-output/my-report.json

Mit Umgebungsvariable

STABILIFY_OUTPUT_FILE=playwright-results/stabilify.json npx playwright test

Ausgabe: {projekt}/playwright-results/stabilify.json

Nur Verzeichnis ändern

STABILIFY_OUTPUT_DIR=my-reports npx playwright test

Ausgabe: {projekt}/my-reports/failures-{timestamp}.json

Output-Format

Der Reporter erstellt eine JSON-Datei mit folgendem Format:

{
  "timestamp": "2025-12-09T11:00:00.000Z",
  "totalFailures": 1,
  "reportId": "550e8400-e29b-41d4-a716-446655440000",
  "ciMetadata": {
    "provider": "github",
    "branch": "main",
    "commit": "abc123def456",
    "jobId": "123456789",
    "buildUrl": "https://github.com/owner/repo/actions/runs/123456789"
  },
  "stats": {
    "total": 10,
    "passed": 8,
    "failed": 1,
    "skipped": 1
  },
  "failures": [
    {
      "reportId": "550e8400-e29b-41d4-a716-446655440000",
      "testId": "abc123",
      "title": "tests › example.spec.ts › should work",
      "suite": "Login Tests > Authentication",
      "file": "/path/to/tests/example.spec.ts",
      "location": { "line": 10, "column": 5 },
      "projectName": "chromium",
      "browser": "chromium 120.0.0",
      "flaky": false,
      "rawStatus": "failed",
      "errors": [
        {
          "message": "Expected element to be visible",
          "stack": "Error: ...",
          "snippet": "await expect(page.locator('button')).toBeVisible();"
        }
      ],
      "steps": [
        {
          "name": "Click login button",
          "status": "passed",
          "duration": 100,
          "category": "test.step"
        },
        {
          "name": "Verify dashboard",
          "status": "failed",
          "duration": 50,
          "category": "test.step",
          "error": "Element not found"
        }
      ],
      "retryAttempts": [
        {
          "status": "failed",
          "duration": 4500,
          "message": "Timeout waiting for element",
          "trace": "Error: Timeout..."
        }
      ],
      "screenshots": ["/path/to/screenshot.png"],
      "traces": ["/path/to/trace.zip"],
      "videos": ["/path/to/video.webm"],
      "stdout": ["Log output"],
      "stderr": [],
      "duration": 5000,
      "retry": 1,
      "status": "failed",
      "timestamp": "2025-12-09T11:00:00.000Z",
      "environment": {
        "appName": "MyApp",
        "branchName": "main",
        "commit": "abc123"
      }
    }
  ]
}

Neue Felder (CTRF-inspiriert)

| Feld | Typ | Beschreibung | | ---------------- | --------- | --------------------------------------------------------- | | reportId | string | UUID des Test-Runs (gruppiert alle Failures eines Runs) | | suite | string | Hierarchischer Suite-Pfad (z.B. "Parent > Child") | | browser | string | Browser-Name und Version | | flaky | boolean | true wenn Test nach Retries bestanden hat | | rawStatus | string | Originaler Playwright-Status (failed, timedOut, etc.) | | retryAttempts | array | Details aller vorherigen fehlgeschlagenen Versuche | | steps[].status | string | Status jedes Steps (passed oder failed) | | steps[].error | string | Fehlermeldung wenn Step fehlgeschlagen | | environment | object | Konfigurierte Umgebungsinformationen |

Test-Run Metadaten (Report-Ebene)

| Feld | Typ | Beschreibung | | ------------ | -------- | ------------------------------------------------------------- | | reportId | string | UUID des Test-Runs (gruppiert alle Failures) | | ciMetadata | object | CI/CD Metadaten (Provider, Branch, Commit, Job-ID, Build-URL) | | stats | object | Test-Statistiken (total, passed, failed, skipped) |

TypeScript-Typen

Stabilify exportiert alle wichtigen Typen für TypeScript-Projekte:

import type {
  StabilifyReporterOptions,
  UploadOptions,
  StabilifyTest,
  StabilifyTestReport,
  StabilifyEnvironment,
} from "stabilify";

// Standalone Uploader für eigene Integrationen
import { StabilifyUploader, type UploaderOptions } from "stabilify";

Entwicklung

# Dependencies installieren
npm install

# Tests ausführen
npm test

# Build erstellen
npm run build

# Type-Check
npm run typecheck

# Für lokale Entwicklung in anderem Projekt
npm link
# Im anderen Projekt:
npm link stabilify

Lizenz

MIT