Open ZurabKV opened 6 months ago
@ZurabKV Facing the same issue
Same issue, additional consequences.
I'm running a11y audits on a page generated from a form submission (POST). Because playAudit is re-loading the page itself, it does a GET to the url and loses the form context.
await page.route('https://example.com/form-endpoint', (route, request) => {
const method = 'POST';
const postData = 'key=value';
route.continue({ method, postData });
});
await page.goto('https://example.com/form-endpoint'); // works ok
await playAudit({
page,
thresholds: {accessibility: 99},
opts: {onlyCategories: ['accessibility']},
}); // does GET request & reloads the page
It's like running lighthouse in chrome in 'Navigation' mode instead of 'Snapshot'? Could this be fixed via https://github.com/abhinaba-ghosh/playwright-lighthouse/pull/44 ?
Facing the same issue, this repo seems poor maintained
Same issue here. Sadly, this makes temporal testing impossible with Playwright which, for me, is the big selling point of LightHouse. I had to revert back several versions to get this working.
"lighthouse": "^9.6.8", "@lighthousejs/types": "^0.0.3", "playwright-lighthouse": "^2.2.2",
As Playwright is now the most popular test framework, it would be good to see the Lighthouse plugin maintained for this.
Hello. We were trying to update version of playwright-lighthouse from 2.2.2 to 4.0.0. Older version of the package ran lighthouse audit in the same browser window and it worked well. New version of lighthouse additionally openes new browser window when running function playAudit(). Is there a way to prevent this from happening and perform the audit in the initial browser window?
New browser window doesn't have necessary cookies (and maybe some other storage data?) which causes the page to open with errors. I found a way to pass necessary cookies to the second browser: return playAudit({
And it did partially help to resolve the issue. Partially, because it passed all the cookies, apart from one. My guess is it is because that specific cookie contained
=
sybol inside its value, perhaps this somehow prevents the cookie to be added to the 2nd browser?