-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Some jasmine tests fail depending on the screen resolution of the computer running the test #444
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
Comments
Interesting. Is this because of the viewport width (and plots are being rendered at a different pixel-width?) or because of how OSX/Chrome handles pixel scaling when using the increased resolution mode (as in, does it use real pixel values or visible pixel values?). In any case, it would probably be a good idea if we make sure all our tests have explicitly set widths and heights. |
@mdtusz For this specific issue, it's the former. The devicePixelRatio is the same in both resolutions, the width was different (and Chrome even gave a different aspect ratio for the higher resolution mode). But in general it's true that there are multiple variables to consider, e.g.
I haven't tried to address these other variations in this little PR. My $.02 is it's useful to set the screen size in test cases, e.g. to test window size responsiveness. It's also useful to have a basic window size for those type of tests that are not width/height sensitive or haven't (yet?) been sized explicitly. My immediate motivation was to be able to run the test suite without errors so it's but a small step. |
Specify window size for the karma chrome launcher (Fixes #444)
When running tests in the Default resolution of a 13" MacBook, all of
click_test.js
passed; however, four failures were reported after increasing the resolution to the maximum in System Preferences. After much fiddling on my part, @etpinard suggested it may be to do with the browser window size. Indeed, the browser window was of a different size, depending on the resolution:Manually resizing the already existing Chrome window and rerunning the test made it pass, confirming the suspicion that failure is due to less than expected viewport width.
The text was updated successfully, but these errors were encountered: