web tests - print page errors to console

//cc @lramos15 this would have detected the missing module
pull/130022/head
Benjamin Pasero 2021-08-03 09:10:47 +02:00
parent 934d280a9f
commit 0390d98a4e
No known key found for this signature in database
GPG Key ID: E6380CC4C8219E65
2 changed files with 15 additions and 0 deletions

View File

@ -188,6 +188,13 @@ export function connect(options: Options = {}): Promise<{ client: IDisposable, d
await context.tracing.start({ screenshots: true, snapshots: true });
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 payloadParam = `[["enableProposedApi",""],["skipWelcome","true"]]`;
await page.goto(`${endpoint}&folder=vscode-remote://localhost:9888${URI.file(workspacePath!).path}&payload=${payloadParam}`);
const result = {

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';