Skip to content

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

fix(install): don't crash generating chrome protocol (#342)

Joel Einbinderc749b7151b82
diff --git a/utils/protocol-types-generator/index.js b/utils/protocol-types-generator/index.js
index b7d69e7542..d33342b3c8 100644
--- a/utils/protocol-types-generator/index.js
+++ b/utils/protocol-types-generator/index.js
@@ -12,7 +12,7 @@ async function generateChromeProtocol(revision) {
const playwright = await require('../../chromium');
const browserServer = await playwright.launchServer({executablePath: revision.executablePath});
const origin = browserServer.wsEndpoint().match(/ws:\/\/([0-9A-Za-z:\.]*)\//)[1];
- const page = (await browserServer.connect()).defaultContext().newPage();
+ const page = await (await browserServer.connect()).defaultContext().newPage();
await page.goto(`http://${origin}/json/protocol`);
const json = JSON.parse(await page.evaluate(() => document.documentElement.innerText));
await browserServer.close();