Skip to content

Commit ebd9969

Browse files
committed
test: ignore aborted icon font loads in chat e2e
1 parent fe4aa8f commit ebd9969

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

examples/chat/angular/e2e/test-helpers.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,19 @@ export function attachBrowserHygiene(page: Page): {
2121
page.on('requestfailed', (request) => {
2222
const failure = request.failure()?.errorText ?? '';
2323
const url = request.url();
24-
if (/runs\/stream/.test(url) && /abort|ERR_ABORTED/i.test(failure)) return;
24+
if (isBenignAbortedRequest(url, failure)) return;
2525
failedRequests.push(`${request.method()} ${url} ${failure}`.trim());
2626
});
2727

2828
return { consoleErrors, failedRequests };
2929
}
3030

31+
function isBenignAbortedRequest(url: string, failure: string): boolean {
32+
if (!/abort|ERR_ABORTED/i.test(failure)) return false;
33+
if (/runs\/stream/.test(url)) return true;
34+
return /fonts\.gstatic\.com\/s\/materialsymbolsoutlined\/.+\.woff2/.test(url);
35+
}
36+
3137
export async function openDemo(page: Page, path = '/embed'): Promise<void> {
3238
await page.goto(path);
3339
await page.evaluate(() => {

0 commit comments

Comments
 (0)