-
Notifications
You must be signed in to change notification settings - Fork 89
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
Expose setViewport on window #624
Comments
Jamie5@cff4d38 works, though I imagine you would prefer to not just expose things on window itself. If this general feature is something you'd like to have I can work on something that is more wrapped properly, as it would be nice not to have to maintain forks and stuff. |
I'm also interested in the ability to set the window size at the beginning of the test -- would it be possible to merge Jamie's change linked above? |
Pull in new changes from reg-viz/storycap, including the ability to shard screenshot captures across machines. We anticipate using this feature to ease the burden placed on individual CircleCI instances, since screenshot captures can be resource- and time-intensive. Resolved conflicts on: - packages/storycap/package.json - packages/storycap/src/node/capturing-browser.ts - packages/storycap/src/shared/screenshot-options-helper.ts Since we last synced from upstream, the following changes have been accepted: - Add the ability to screenshot a part of the screen (reg-viz#722) - Fixed exposeFunction not being awaited (reg-viz#632) We continue to maintain this fork because we're waiting for this issue to be addressed: - Expose setViewport on window reg-viz#624 This sync is reflected in a version bump of our fork from 1.0.4 to 1.1.0.
The request is to, in https://github.com/reg-viz/storycap/blob/master/packages/storycap/src/node/capturing-browser.ts , add to
expose()
another function, something likesetViewport: (vp) => this.page.setViewport(vp)
, so that a test could doawait window.setViewport(...)
Why?
We now have
play
functions, and hence UI interactions. These UI interactions may differ due to the size of the UI (i.e. responsive design might hide text when the window is narrow), which fundamentally goes to the window size. So it would be nice to be able to set the window size at the beginning of the test, rather than only when the screenshot happens. Otherwiseplay
functions might become flaky and confusing.Note that any other solution to the problem would be fine too - only that it would be strongly preferred for it to be possible to resize the viewport dynamically, rather than e.g. declaring in a test's parameters that it should have a given set of dimensions.
It might be possible to pass arguments to storycap to have a given viewport, but such a global option would not be preferred as individual tests might have individual viewports.
The text was updated successfully, but these errors were encountered: