Skip to content

Commit

Permalink
Log page output
Browse files Browse the repository at this point in the history
  • Loading branch information
sockmaster27 committed Jan 3, 2025
1 parent 6a3ca9d commit d9c016b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test-sites.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { test, expect, TestInfo, Page } from "@playwright/test";

test.beforeEach(async ({ page }) => {
/** Bind the console to the Playwright test runner, rather than the browser */
const logOuter = console.log;
page.on("console", msg => {
logOuter(`[console.${msg.type()}] ${msg.text()}`);
});
page.on("pageerror", msg => {
expect.soft(false, `Error thrown:\n${msg.message}`).toBeTruthy();
});
Expand Down

0 comments on commit d9c016b

Please sign in to comment.