web tests - print page errors to console

//cc @lramos15 this would have detected the missing module
This commit is contained in:
Benjamin Pasero
2021-08-03 09:10:47 +02:00
parent 934d280a9f
commit 0390d98a4e
2 changed files with 15 additions and 0 deletions

View File

@@ -38,6 +38,14 @@ async function runTestsInBrowser(browserType: BrowserType, endpoint: url.UrlWith
const page = await context.newPage();
await page.setViewportSize({ width, height });
page.on('pageerror', async error => console.error(`Playwright ERROR: page error: ${error}`));
page.on('crash', page => console.error('Playwright ERROR: page crash'));
page.on('response', async response => {
if (response.status() >= 400) {
console.error(`Playwright ERROR: HTTP status ${response.status()} for ${response.url()}`);
}
});
const host = endpoint.host;
const protocol = 'vscode-remote';