Open
Conversation
|
Thanks for the PR! Wouldn't it be nicer to allow specifying the screen dimensions directly as options for the await capture(assert, 'mobile-test', { windowWidth: 440, windowHeight: 680 });And then just set the window size to these values, if present, in the |
Contributor
Author
|
Yeah, I thought about this solution, but I felt it will make a mess in tests code. I thought about two use cases:
import { MOBILE } from 'tests/helpers/visual-test-setups';
await capture(assert, 'mobile-test', MOBILE);
await capture(assert, 'visual-test', { modes: ['mobile', 'tablet', 'default'] });There is also a technical reason, why I used centrally defined configurations - I'm not sure if |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've got a project with responsive design which should be tested in different screen resolutions. I thought it could be useful to support multiple configurations, instead of just one resolution per whole application.
Here I've implemented something I called modes (I'm not sure if that's a good word...). Basically it does just that - allows you to define multiple configurations and then pick one in each
capturecall.