-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
fix: Chrome doesn't change resolution #399
Conversation
@aaronjensen interesting but now I've got failing tests on my laptop, when this deviceScaleFactor is set to 0, though same Chrome version on github doesn't show broken tests. Same main branch was working for me for today before my experiments, but now it constantly failing for 117. |
What are the failures? I can see if I can reproduce. |
I see exactly one failing test, and the failure does seem related, but it may point to Chrome having changed their default scaling for headless browsers to 2x, which means that the test may be the thing that needs to be corrected. If the test produces different results on different machines, it could be that Chrome is somehow taking into account the device's scaling (I do have a high dpi monitor and my
|
I propose that we allow deviceScaleFactor to be controlled the same way height and width is. Then the test can be set up to specify that. It should default to 0 so that it will respect the machine it is running on. |
@aaronjensen you should remove |
macOS Ventura As a point of feedback, it is maximally surprising to have rspec default to fail-fast. That's an end-user choice. I would have never known until I got incredibly frustrated playing test whack-a-mole. |
All of the failing tests are exactly the same. It is respecting my device scaling now. As a result all screenshots are higher resolution. That is, they are more accurate to what my device should actually produce. I'd suggest either allowing device pixel ratio to be controlled and updating those tests to control it, or updating the tests to test for a multiple of the expected size, rather than the exact size if, in fact, the CI server is passing these tests with Chrome 117 |
Alternatively, the tests can be corrected to expect pixel size when they expect pixel size, rather than the virtual device size with something like this: def viewport_pixel_size
evaluate <<~JS
[window.innerWidth * window.devicePixelRatio,
window.innerHeight * window.devicePixelRatio]
JS
end |
@route if you let me know what you prefer, I can work on a PR later, I think. |
I have Mac for which
Yea I'll remove that, the only intention was to set it for CI to speed up build. |
The change looks good, thanks! |
No description provided.