Skip to content
This repository was archived by the owner on Jul 10, 2025. It is now read-only.

Commit 3c1b422

Browse files
author
Akim Mamedov
committed
Add request logs
1 parent f4e0a23 commit 3c1b422

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

packages/@tests/smoke/web-cra-ts/test/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ const test = async () => {
3030
console.log(`${message.type().toUpperCase()}: ${message.text()}`),
3131
);
3232

33-
// uncomment to debug what's happening inside the browser
34-
// page.on('console', (msg) => console.log('// from console: ', msg.text()));
33+
page.on("requestfailed", (request) => {
34+
console.log(`ERROR: ${request.url()} ${request.failure()?.errorText}`);
35+
});
3536

3637
console.log("going to the page in browser...");
3738
await page.goto(uri);

packages/@tests/smoke/web/src/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ const test = async () => {
4949
console.log(`${message.type().toUpperCase()}: ${message.text()}`);
5050
});
5151

52-
// uncomment to debug what's happening inside the browser
53-
// page.on('console', (msg) => console.log('// from console: ', msg.text()));
52+
page.on("requestfailed", (request) => {
53+
console.log(`ERROR: ${request.url()} ${request.failure()?.errorText}`);
54+
});
5455

5556
console.log("going to the page in browser...");
5657
await page.goto(uri);

0 commit comments

Comments
 (0)