-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
[Feature]: Support omitBackground
in toHaveScreenshot
in playwright config
#34220
Comments
Hi, could you elaborate on why you're using |
Hi, I'm using snapshot testing along with component testing. I observed minor rendering differences between each run which is totally expected but I was thinking if background can be omitted, I may be able to improve the accuracy of the test cases by eliminating spaces around the component screenshot. |
Minor differences are to be expected - browser rendering is just inherently indeterministic. Omitting background will only help partially. You'll likely get more stable results by changing |
Thanks for the insight and clarification. |
🚀 Feature Request
Support
omitBackground
inexpect > toHaveScreenshot
in playwright config.Currently, it will throw a TypeScript error when setting
omitBackground
to playwright config. It would be great if there was somehow a way to set this globally without having to do it in each assertion.Example
Motivation
A flag to globally omit background when screenshot is taken.
The text was updated successfully, but these errors were encountered: