-
-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PlayAudit function call is closing the browser automatically after analysis #53
Comments
I am facing the same problem using the same versions of lighthouse and playwright-lighthouse. Would love to see some solution for this. |
Hello, Would love to have this feature as well, i.e. don't close the page automatically once the playAudit function completes. May be an optional additional argument to this function to decide whether to close or leave the page open would be great. |
@abhinaba-ghosh , can we have this optional argument within playAduit function to keep the browser alive so that the next user-action can take place and we can call the audit function again. This would help mostly when integrating playwright-lighthouse in existing E2E scripts strategically. |
Any updates on this please? |
I ran into this when when I was trying to attach the lighthouse report artifact to the Playwright report. My workaround was the wrap the
Alternatively, you might be able to adjust the score thresholds to a lower setting, so an error won't be raised (I haven't tested this).
|
You can use as following |
hey @Swaroop-bgowda , good idea. would you mind raising a PR? |
Hi All, we are trying to perform analysis on a single page application and we want to use Playwright-lighthouse as a utility by calling it in multiple stages within our test script.
Sample:
Before all {
browser initiation }
test {
goto(url);
await playaudit{}
locator().click();
await playaudit{}
};
Problem is once the URL is opened and playaudit is performed the browser is automatically closing leading to which the locator().click() is throwing Error: locator.click: Target page, context or browser has been closed error.
I'm currently using downgraded version of lightHouse & playwright-lighthouse due to existing import issue in latest versions.
"@playwright/test": "^1.35.1",
"lighthouse": "^9.6.8",
"playwright-lighthouse": "^2.2.2",
The text was updated successfully, but these errors were encountered: