loki icon indicating copy to clipboard operation
loki copied to clipboard

deviceScaleFactor and Docker

Open florian-milky opened this issue 3 years ago • 2 comments

In the configuration docs regarding deviceScaleFactor:

Browser pixel density multiple, use 2 for retina, not supported in docker.
target: chrome.app

Can this be an issue in docker? We are experiencing differences depending on the machine running loki (M1 Mac vs CI or regular Mac).

Apparently it's possible to force chrome headless device scale factor:

https://stackoverflow.com/questions/54484599/enforce-screenshot-resolution-with-google-chrome-headless-mode

How could that be configured in Loki?

Thanks

florian-milky avatar Mar 24 '22 10:03 florian-milky

Facing something very similar where all the diffs are caused by pixel density changes between Intel and M1 MacBook.

jookyboi avatar May 19 '22 17:05 jookyboi

@florian-milky It should be possible to pass it as a 'chromeFlags' in your loki command, e.g.

loki test --requireReference --chromeRetries=10 --chromeConcurrency=1 --reactUri=file:./storybook-static --chromeRetries=10 --chromeFlags="--headless --no-sandbox --hide-scrollbars --disable-gpu --force-device-scale-factor=1",

Although this doesn't solve the issue we have at our end where generated screenshots vary slightly as well between M1 Mac vs other platforms. Haven't been able to find a solution to that as of yet, but would be very interested in one.

hihuz avatar Aug 19 '22 08:08 hihuz