dferber90 / jsdom-screenshot

📸 Take screenshots of jsdom with puppeteer

Home Page:https://github.com/dferber90/visual-regression-testing-example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Images depend on LCD font smoothing

dferber90 opened this issue · comments

Problem

The screenshot puppeteer takes is dependant of the "Use LCD font smoothing when available" setting of Mac OSX.

Consequences:

  • when the setting is changed on the operating system, the tests fail
  • when the setting is enabled and the tests were generated with LCD font smoothing, but are now run on a non-LCD monitor (not sure what is different exactly), the tests suddenly fail

See here for an example of a failing visual regression test caused by this:

image

Solution

There is a chrome-flag called lcd-text-aa at chrome://flags/#lcd-text-aa which we can always disable. Then the screenshots will never use LCD text anti-aliasing. The tests now no longer depend on the monitor or Mac OSX "Use LCD font smoothing when available" setting.

Technical

puppeteer.launch(options) accepts options.args and we can pass --disable-lcd-text to disable the lcd text antialiasing.