playwright-lighthouse
playwright-lighthouse copied to clipboard
[question]: do we really need playwright library or not?
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');
....
Are you looking to connect the library with an existing playwright connection? If yes, we can check the possibility to do so.
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:
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.
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?