diff --git a/test/e2e/lib/hooks/save-console-log.js b/test/e2e/lib/hooks/save-console-log.js index cdb7aeb190162..0e85d8981e59e 100644 --- a/test/e2e/lib/hooks/save-console-log.js +++ b/test/e2e/lib/hooks/save-console-log.js @@ -11,14 +11,22 @@ export default () => { after( 'Save browser logs', async function () { const driver = global.__BROWSER__; - await Promise.allSettled( - [ - [ getBrowserLogs( driver ), 'console.log' ], - [ getPerformanceLogs( driver ), 'performance.log' ], - ].map( async ( [ logsPromise, file ] ) => { - const logs = await logsPromise; - return fs.writeFile( generatePath( file ), JSON.stringify( logs, null, 2 ) ); - } ) - ); + try { + await Promise.allSettled( + [ + [ getBrowserLogs( driver ), 'console.log' ], + [ getPerformanceLogs( driver ), 'performance.log' ], + ].map( async ( [ logsPromise, file ] ) => { + const logs = await logsPromise; + return fs.writeFile( generatePath( file ), JSON.stringify( logs, null, 2 ) ); + } ) + ); + } catch ( err ) { + console.warn( + 'Got an error trying to save logs from the browser. This IS NOT causing the test to break, is just a warning' + ); + console.warn( 'Original error:' ); + console.warn( err ); + } } ); };