zerobyte/e2e/test.ts
2026-03-24 07:52:54 +01:00

18 lines
486 B
TypeScript

import { expect, test as base } from "@playwright/test";
import { trackBrowserErrors } from "./helpers/browser-errors";
export const test = base.extend({
context: async ({ context }, use, testInfo) => {
const browserErrorTracker = trackBrowserErrors(context, {
attach: async (name, body, contentType) => {
await testInfo.attach(name, { body, contentType });
},
});
await use(context);
await browserErrorTracker.assertNoBrowserErrors();
},
});
export { expect };