diff --git a/src/browsers/capabilities.ts b/src/browsers/capabilities.ts index 27f5105..27faef2 100644 --- a/src/browsers/capabilities.ts +++ b/src/browsers/capabilities.ts @@ -53,7 +53,7 @@ const defaultCapabilities: Record = { '--prerender-from-omnibox=disabled', '--no-sandbox', '--disable-gpu', - '--headless', + '--headless=new', ], }, }, diff --git a/src/use-browser.ts b/src/use-browser.ts index ecabaf3..8cb651d 100644 --- a/src/use-browser.ts +++ b/src/use-browser.ts @@ -40,8 +40,8 @@ function useBrowser(...args: [Partial, TestFunction] | [TestFu await testFn(browser); // This method does not exist in w3c protocol if (!options.skipConsoleErrorsCheck && 'getLogs' in browser) { - const logs = (await browser.getLogs('browser')) as Array<{ level: string }>; - const errors = logs.filter(entry => entry.level === 'SEVERE'); + const logs = (await browser.getLogs('browser')) as Array<{ level: string; message: string }>; + const errors = logs.filter(entry => entry.level === 'SEVERE' && !entry.message.includes('/favicon.ico')); if (errors.length > 0) { throw new Error('Unexpected errors in browser console:\n' + JSON.stringify(errors, null, 2)); }