Skip to content

Commit 6fc7d2f

Browse files
committed
Improve error log when timeout in e2e test
1 parent cded3ce commit 6fc7d2f

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

test/e2e/livecaptions.spec.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,10 @@ async function waitForEvent(
302302
try {
303303
await locator.nth(numEvents - 1).waitFor({ timeout, state: "visible" });
304304
} catch (error: any) {
305-
console.error(`Timeout waiting for ${eventName} events:`, error.message);
305+
console.error(
306+
`Timeout waiting for ${eventName} events (${numEvents}) in user ${user}:`,
307+
error.message
308+
);
306309
if (!page.isClosed()) {
307310
try {
308311
const screenshot = await page.screenshot();
@@ -422,7 +425,7 @@ async function waitForEventContentToStartWith(
422425
}
423426

424427
throw new Error(
425-
`Timeout waiting for ${eventName} content starting with "${eventContent}"`
428+
`Timeout waiting for ${eventName} event contents (${numEvents}) for user ${user} starting with "${eventContent}"`
426429
);
427430
}
428431

0 commit comments

Comments
 (0)