playwright-lighthouse icon indicating copy to clipboard operation
playwright-lighthouse copied to clipboard

[question]: do we really need playwright library or not?

Open stevez opened this issue 2 years ago • 2 comments
trafficstars

I found if I use the following code, then the playwright library can be removed:

test("Ligthouse performance test", async ({playwright}) => { const browser = await playwright.chromium.launch({ args: ['--remote-debugging-port=9222'], });

  const page = await browser.newPage();
  await page.goto('https://www.google.ca');

....

stevez avatar Aug 15 '23 15:08 stevez

Are you looking to connect the library with an existing playwright connection? If yes, we can check the possibility to do so.

abhinaba-ghosh avatar Dec 28 '23 11:12 abhinaba-ghosh

Not at all, but you can open a new browser to do that. But if you want to use the same playwright browser you could add the remote debugging port into playwright configuration:

Screenshot 2024-08-06 at 10 12 54 AM

alphonse92 avatar Aug 06 '24 15:08 alphonse92

I found that setting the --remote-debugging-port globally in the config messed up my other tests.

I'm finding when I follow the exact example in the readme, I get the following Test timeout of 30000ms exceeded. browserType.launch error on some of my Lighthouse tests, consistently.

Screenshot 2024-10-29 at 3 09 18 PM

Edit: turning off fullyParallel seemed to fix it.

Another edit: Sorry, I missed the "Using with the Playwright test-runner" part of the readme, where it shows how to support parallel runs. Not to nitpick but shouldn't this section be near the top of the readme? Isn't this what most people are using this library for?

vincerubinetti avatar Oct 29 '24 19:10 vincerubinetti