Skip to content

Commit

Permalink
fix test script
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark George committed May 19, 2023
1 parent c9cf024 commit dfa0f12
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions bin/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -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...");

Expand All @@ -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) {
Expand Down

0 comments on commit dfa0f12

Please sign in to comment.