@testpulse.run/playwright-events
v0.3.0
Published
Derived Playwright test events for TestPulse reporters.
Maintainers
Readme
@testpulse.run/playwright-events
Derived Playwright test events for TestPulse reporters.
This package consumes normalized core events from @testpulse.run/playwright-core and emits higher-level events such as test attempts and final test outcomes. It is useful when you are building a custom reporter and do not want to derive retries, flaky outcomes, skipped results, and attempt lifecycle yourself.
Most users should install @testpulse.run/reporter instead.
Installation
npm install -D @testpulse.run/playwright-events @testpulse.run/playwright-core @playwright/testBasic Usage
import { TestPulseReporterCore } from "@testpulse.run/playwright-core";
import { PlaywrightEvents, type TestPulseDerivedEventsPlugin } from "@testpulse.run/playwright-events";
const derivedPlugin: TestPulseDerivedEventsPlugin = {
name: "my-derived-events",
TestAttemptFinished: (event) => {
recordAttempt(event.test.title, event.status, event.retry);
},
TestOutcomeResolved: (event) => {
recordOutcome(event.test.title, event.outcome);
}
};
const events = new PlaywrightEvents({ plugins: [derivedPlugin] });
const core = new TestPulseReporterCore({ plugins: [events.asCorePlugin()] });
events.setErrorSink(core);Derived Events
TestAttemptStartedTestAttemptFinishedTestOutcomeResolved
Related Packages
@testpulse.run/reporter: preconfigured HTTP reporter for TestPulse.@testpulse.run/playwright-jsonl-reporter: writes core and derived events to JSONL or HTTP sinks.@testpulse.run/playwright-core: normalized Playwright reporter lifecycle events.
