From dfa0f12f0b8c14f05abb82f5b95618367017f8b5 Mon Sep 17 00:00:00 2001 From: Mark George Date: Fri, 19 May 2023 15:16:14 +1000 Subject: [PATCH] fix test script --- bin/generate.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bin/generate.js b/bin/generate.js index 017a79e..55557e2 100644 --- a/bin/generate.js +++ b/bin/generate.js @@ -12,11 +12,7 @@ async function main() { console.log(urls); const browser = await playwright.chromium.launch(); - const testPages = {}; - for (const url of urls) { - testPages[url] = await browser.newPage(); - await testPages[url].goto(url); - } + const context = await browser.newContext(); console.log("Generating Critical CSS..."); @@ -27,7 +23,7 @@ async function main() { { width: 1200, height: 800 }, { width: 1920, height: 1080 }, ], - browserInterface: new BrowserInterfacePlaywright(testPages), + browserInterface: new BrowserInterfacePlaywright( context, urls ), }); if (warnings.length) {