New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@bugmojo/playwright-reporter

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bugmojo/playwright-reporter

Playwright reporter for BugMojo — records every run, maps specs to test cases, and uploads traces, videos and screenshots as evidence. Never fails your build.

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

@bugmojo/playwright-reporter

Your Playwright run, kept as proof. Every test you already run becomes a recorded result in BugMojo — with the trace, the video, the screenshots and the console output attached, tied to the exact commit and the exact deployed URL.

A failing test that BugMojo has never seen before becomes a test case and a bug, automatically. That is how a bug an agent found at 2am is waiting for you in the morning instead of scrolling past in a CI log.

It will never fail your build. No API key, no network, an expired token, a 40 MB trace, a 500 from the server — the reporter writes one line to stderr and gets out of the way. Reporting is not allowed to be the reason npx playwright test goes red.

Install

npm install -D @bugmojo/playwright-reporter
# or: pnpm add -D @bugmojo/playwright-reporter

Configure (3 lines)

// playwright.config.ts
import { defineConfig } from '@playwright/test';

export default defineConfig({
  reporter: [['list'], ['@bugmojo/playwright-reporter']],          // 1
  use: {
    trace: 'retain-on-failure',                                     // 2
    video: 'retain-on-failure',                                     // 3
    screenshot: 'only-on-failure',
  },
});

Then two environment variables:

BUGMOJO_API_KEY=bm_key_...     # Settings -> API keys, with write permission
BUGMOJO_PROJECT=WEB            # your project key

That is the whole setup. npx @bugmojo/cli init writes both blocks for you if you would rather not edit the config by hand.

What you get

After one npx playwright testWhere it lands
A run stamped with the commit SHA, deployed URL, environment and runner (LOCAL / CI)the project's run history
One result per test — status, duration, retries, the first line of the failurepinned to the test case's exact revision
The trace.zip, the video, the screenshots, stdout/stderr, and any JSON you attachedevidence on the failing result, replayable in the trace viewer
A PROPOSED test case + a bug for a failure with no matching casethe review queue, with the failure already written up
Flaky tests marked as flaky (failed, then passed on retry)the flakiness report

How a spec finds its test case

Two conventions, both supported. Use whichever fits.

1. Annotate the test — survives renaming the file:

test('checkout with a saved card', async ({ page }) => {
  test.info().annotations.push({ type: 'bugmojo', description: 'WEB-42' });
  // ...
});

2. Name the spec file — the convention bugmojo verify already uses, so repro specs exported from BugMojo work with no edits:

tests/bugmojo/WEB-42.spec.ts            -> WEB-42
tests/bugmojo/WEB-42-checkout.spec.ts   -> WEB-42   (prefix before the 2nd dash)

A [WEB-42] prefix in the test title and a @WEB-42 Playwright tag work too. An annotation can also carry a raw BugMojo test-case id.

No match, and the test failed? The reporter says so, and BugMojo creates the case as PROPOSED plus a bug with the spec path and the failure line. Turn it off with BUGMOJO_CREATE_MISSING_CASES=false or createMissingCases: false.

Configuration reference

Every option can be set in playwright.config.ts or via the environment. The config file wins.

OptionEnv varDefaultWhat it does
apiKeyBUGMOJO_API_KEY—Required. A key with write permission.
projectBUGMOJO_PROJECT—Required. Project key (WEB) or id.
apiUrlBUGMOJO_API_URLhttps://www.bugmojo.comSelf-hosted or staging instance.
planVersionIdBUGMOJO_PLAN_VERSION—Bind the run to a frozen test-plan version.
suiteName / suiteIdBUGMOJO_SUITE / BUGMOJO_SUITE_IDAutomated (Playwright)Which suite the run hangs off.
environmentBUGMOJO_ENVIRONMENT—staging, production, …
deployUrlBUGMOJO_DEPLOY_URLPLAYWRIGHT_BASE_URLThe build under test.
commitShaBUGMOJO_COMMIT_SHACI vars, then git rev-parse HEADWhat was tested.
runner—detectedLOCAL or CI.
runIdBUGMOJO_RUN_ID—Append to an existing run.
externalRunIdBUGMOJO_RUN_KEYthe CI run idShards of one job share it, so a sharded suite is ONE run.
createMissingCasesBUGMOJO_CREATE_MISSING_CASEStrueFailing test with no case -> PROPOSED case + bug.
uploadEvidenceBUGMOJO_UPLOAD_EVIDENCEtrueUpload artifacts at all.
evidenceOnFailureOnlyBUGMOJO_EVIDENCE_ON_FAILURE_ONLYtrueSkip artifacts for clean passes.
includeStdioBUGMOJO_INCLUDE_STDIOtrueAttach captured stdout/stderr.
timeoutMsBUGMOJO_TIMEOUT_MS120000Whole-reporter budget; exceeded means give up.
disabledBUGMOJO_DISABLEDfalseTurn reporting off entirely.
debugBUGMOJO_DEBUGfalsePrint what was resolved and uploaded.
reporter: [
  ['@bugmojo/playwright-reporter', {
    project: 'WEB',
    environment: 'staging',
    evidenceOnFailureOnly: false,   // keep traces for green runs too
  }],
],

In CI

- run: npx playwright test
  env:
    BUGMOJO_API_KEY: ${{ secrets.BUGMOJO_API_KEY }}
    BUGMOJO_PROJECT: WEB
    BUGMOJO_ENVIRONMENT: staging
    PLAYWRIGHT_BASE_URL: ${{ steps.deploy.outputs.url }}

GITHUB_SHA (or the pull request's head SHA), GITHUB_RUN_ID and CI are read automatically, so sharded jobs merge into one BugMojo run and a re-run of the same job is idempotent rather than a duplicate.

Sizes, and what gets skipped

Artifacts are uploaded straight to storage on a presigned URL — the bytes never pass through the BugMojo API. Per-artifact ceilings:

KindCap
Trace, video100 MB
HAR, rrweb25 MB
Screenshot, JSON report, other files10 MB
Console output (stdout/stderr)5 MB, tail-truncated

Plus 25 artifacts and 250 MB per test. Anything over is skipped with a warning — the result itself is always recorded.

Privacy

The reporter sends test titles, spec paths, failure messages, the artifacts Playwright produced, and the run's commit/URL metadata. It never reads or uploads your application source.

Troubleshooting

You seeWhy
reporting is off — no API key (set BUGMOJO_API_KEY)Expected on a contributor's machine with no key. The run is unaffected.
No BugMojo test case matched …The spec carries no annotation, tag or recognised file name. Add an annotation, or let a failure create the case.
evidence storage is not configured on this BugMojo instanceA self-hosted instance without S3. Results still land; artifacts do not.
reporting exceeded 120000ms — giving upThe API was unreachable or very slow. Nothing else is affected.

Set BUGMOJO_DEBUG=1 to see the resolved project, runner, CI provider and API URL before the run starts.

License

MIT · bugmojo.com

Keywords

playwright

FAQs

Package last updated on 17 Oct 2026

Related posts