abhinaba-ghosh / playwright-lighthouse

:performing_arts:: Playwright Lighthouse Audit
https://www.npmjs.com/package/playwright-lighthouse
MIT License
250 stars 28 forks source link

Error: You probably have multiple tabs open to the same origin. #37

Open arvigeus opened 2 years ago

arvigeus commented 2 years ago

I am trying to run this code example from README: Running lighthouse on authenticated routes with the test runner. I use "https://playwright.dev/" and don't set any cookies (smoke testing)

"playwright-lighthouse": "^2.2.2"
"lighthouse": "^9.6.7",
"@playwright/test": "^1.26.0",

I managed it to run if I close the page in advance and use the url instead:

const url = page.url();
page.close();
await playAudit({
  url,
  port,
});

Browsing the source it seems there is no difference between url and page, so my guess is that documentation should be updated. In any case, if any future googler stumbles upon this issue, I hope it's useful!