Skip to content

Commit accd861

Browse files
committed
front: handle uncaught exceptions for e2e tests
Signed-off-by: maymanaf <[email protected]>
1 parent 3e66137 commit accd861

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

front/tests/logging-fixture.ts

+5
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ const testWithLogging = baseTest.extend<{ page: Page }>({
1616
// Log before the test starts
1717
logger.info(`START: '${testInfo.title}' | Browser: ${browserName}`);
1818

19+
// Handle uncaught exceptions
20+
page.on('pageerror', (exception) => {
21+
throw new Error(`Test failed due to uncaught exception: "${exception}"`);
22+
});
23+
1924
// Run the actual test
2025
await use(page);
2126

0 commit comments

Comments
 (0)