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

[Question] Screenshot difference between mac and ubuntu #18240

Closed
mokone91 opened this issue Oct 21, 2022 · 2 comments
Closed

[Question] Screenshot difference between mac and ubuntu #18240

mokone91 opened this issue Oct 21, 2022 · 2 comments

Comments

@mokone91
Copy link

mokone91 commented Oct 21, 2022

Hi!
I going to setup screenshot testing using @storybook/test-runner + jest-image-snapshot
@storybook/test-runner uses jest-playwright under the hood, and issue is - screenshots different in various OS.

I understand that this is a normal behavior, different OS renders things differently...
But is its possible to do something to minimize this difference, so i can use some threshold as now its not possible, as it depends on to many factiors?
Seems in my case - difference in fonts and box shadows..

components-forms-input-test--default-diff

@mokone91
Copy link
Author

Have to try different cromium flags - but no luck

testEnvironmentOptions: {
    'jest-playwright': {
      ...originalConfig.testEnvironmentOptions['jest-playwright'],
      launchOptions: {
        args: [
          '--no-sandbox',
          '--headless',
          '--enable-logging',
          '--hide-scrollbars',
          '--disable-lcd-text',
          '--printBackground=true',
          '--disable-dev-shm-usage',
          '--disable-gpu',
          '--font-render-hinting=none',
          '--disable-accelerated-2d-canvas',
          '--disable-font-subpixel-positioning',
          '--disable-canvas-aa',
          '--disable-composited-antialiasing',
        ],
      },
    },

@dgozman
Copy link
Contributor

dgozman commented Oct 22, 2022

@mokone91 There's not much you can do to get the same screenshots between OSes. You can use a container to run your visual tests - this way you'll have a reproducible environment.

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