Skip to content
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

Open
wsuwt opened this issue Jan 6, 2025 · 1 comment
Open

Comments

@wsuwt
Copy link

wsuwt commented Jan 6, 2025

🚀 Feature Request

Support omitBackground in expect > 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

export default defineConfig({
    expect: {
      toHaveScreenshot: {
        omitBackground: true,
    }
  }
})

Motivation

A flag to globally omit background when screenshot is taken.

@Skn0tt
Copy link
Member

Skn0tt commented Jan 9, 2025

Hi, could you elaborate on why you're using omitBackground in your snapshot tests? We originally added it for printing screenshots, not for testing, so it's interesting to learn more about new usecases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants