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

@alphabin/trx

v1.0.4

Published

TRX reporter for Playwright tests with Azure Blob Storage upload support

Readme

TRX Playwright Reporter

Maintained by Ayush Mania (GitHub: @alphabin-01)

npm version

A Playwright reporter that sends detailed test results and environment metadata to the TRX server for advanced test analytics and reporting.

Features

  • 📊 Automatically sends Playwright test results to the TRX server.
  • 🔍 Collects comprehensive metadata about your test runs:
    • Git: Branch, commit (hash, message, author, email, timestamp), repository (name, URL), PR details (if available).
    • CI/CD: Provider detection (GitHub Actions, GitLab CI, Jenkins, etc.), pipeline (ID, name, URL), build (number, trigger), environment details.
    • System: Hostname, CPU (count, model), memory, OS, Node.js version, Playwright version.
    • Test Configuration: Detailed info including browsers used (ID, name, version, viewport, headless, retries), workers, timeouts, reporters configured, grep filters, and more.
  • 🏷️ Support for associating custom tags with test runs via reporter options.
  • 🔁 Built-in retry mechanism for API requests to the TRX server.
  • 🔒 Secure API key authentication.
  • 📝 Optional verbose debug logging via the debug option or by setting DEBUG=alphabin:trx.

Installation

npm install --save-dev @alphabin/trx
# or
yarn add --dev @alphabin/trx
# or
pnpm add --save-dev @alphabin/trx

Configuration

Add the reporter to your playwright.config.js or playwright.config.ts. You must also include Playwright's built-in json reporter, as @alphabin/trx reads its output.

// playwright.config.js
const { defineConfig } = require('@playwright/test');

module.exports = defineConfig({
  // ... other config settings
  reporter: [
    // Required reporters
    ['json', { outputFile: 'test-results/report.json' }],
    ['@alphabin/trx', {
      serverUrl: process.env.TRX_SERVER_URL || 'YOUR_TRX_SERVER_URL',
      apiKey: process.env.TRX_API_KEY,

      // Optional: Add custom tags to the run
      tags: ['smoke-test', process.env.CI_COMMIT_REF_SLUG]
      
      // ... see options below
    }],
    // If you want to upload media to cloud, enable HTML reporter like given below
    ['html', {
      outputDir: 'playwright-report',
      open: 'never'
    }],
  ],
  // ... rest of your config
});

Important: Ensure the json reporter is configured to output a file (e.g., test-results/report.json). The @alphabin/trx reporter will read this file after the test run finishes.

Reporter Options

The @alphabin/trx reporter accepts the following options:

| Option | Type | Required | Default | Description | | :--------------------- | :------ | :------- | :------------- | :----------------------------------------------------- | | serverUrl | string | Yes | - | URL of the TRX server instance. | | apiKey | string | Yes | - | API key for authenticating with the server. | | tags | string[]| No | [] | Array of custom string tags to associate with the run. | | reportDir | string | No | ./test-results| Directory where the report.json file is expected. | | debug | boolean | No | false | Enable verbose debug logging for the reporter. | | timeout | number | No | 30000 | Timeout for API requests to the server (in ms). | | retries | number | No | 3 | Number of retry attempts for failed API requests. |

Environment Variables

You can configure required options via environment variables:

  • TRX_SERVER_URL – Sets the serverUrl.
  • TRX_API_KEY – Sets the apiKey.

For debugging, set the DEBUG environment variable:

DEBUG=alphabin:trx npx playwright test

Metadata Structure

The reporter collects and sends following metadata to the TRX server:

{
  "git": {
    "branch": "string",
    "commit": {
      "hash": "string",
      "message": "string"
    },
    "repository": {
      "name": "string",
      "url": "string"
    },
    "pr": {
      "id": "string",
      "title": "string",
      "url": "string"
    }
  },
  "ci": {
    "provider": "string",
    "pipeline": {
      "id": "string",
      "name": "string",
      "url": "string"
    },
    "build": {
      "number": "string",
      "trigger": "string"
    },
    "environment": {
      "name": "string",
      "type": "string",
      "os": "string",
      "node": "string"
    }
  },
  "system": {
    "hostname": "string",
    "cpu": {
      "count": "number",
      "model": "string"
    },
    "memory": {
      "total": "string"
    },
    "os": "string",
    "nodejs": "string",
    "playwright": "string"
  },
  "test": {
    "config": {
      "browsers": [
        {
          "browserId": "string",
          "name": "string",
          "version": "string",
          "viewport": "string",
          "headless": "boolean",
          "repeatEach": "number",
          "retries": "number",
          "testDir": "string",
          "outputDir": "string"
        }
      ],
      "actualWorkers": "number",
      "timeout": "number",
      "preserveOutput": "string",
      "fullyParallel": "boolean",
      "forbidOnly": "boolean",
      "projects": "number",
      "shard": "string | null",
      "reporters": [
        {
          "name": "string",
          "options": "any"
        }
      ],
      "grep": "any",
      "grepInvert": "any"
    },
    "customTags": ["string"]
  }
}

Supported CI/CD Providers

The reporter automatically detects and collects information from the following CI/CD providers by checking standard environment variables:

  • GitHub Actions
  • GitLab CI
  • CircleCI
  • Jenkins
  • Azure DevOps
  • (Generic CI=true detection)

Examples

See the examples directory for sample playwright.config.js files.

License

MIT