web - guard against error from stopping tracing on tear down of tests

This commit is contained in:
Benjamin Pasero 2021-08-03 14:15:55 +02:00
parent 4b07dae7fd
commit db4cda10a8
No known key found for this signature in database
GPG key ID: E6380CC4C8219E65

View file

@ -43,8 +43,12 @@ function buildDriver(browser: playwright.Browser, context: playwright.BrowserCon
capturePage: () => Promise.resolve(''),
reloadWindow: (windowId) => Promise.resolve(),
exitApplication: async () => {
await context.tracing.stop({ path: join(logsPath, `playwright-trace-${traceCounter++}.zip`) });
await browser.close();
try {
await context.tracing.stop({ path: join(logsPath, `playwright-trace-${traceCounter++}.zip`) });
await browser.close();
} catch (error) {
console.error(error); // do not fail the build when this fails
}
await teardown();
},
dispatchKeybinding: async (windowId, keybinding) => {