chromaui / chromatic-e2e

Archive end-to-end tests to be replayed in Storybook and Chromatic
MIT License
13 stars 4 forks source link

Custom viewport on cypress #36

Closed tsirlucas closed 2 months ago

tsirlucas commented 8 months ago

Is your feature request related to a problem? Please describe. Id like to be able to set a custom viewport for snapshots when running on cypress. I see its fixed to 500x500 on this line

Describe the solution you'd like Maybe when importing the index file on setupNodeEvents it would be perfect to be able to send it as param as its the exact place I set my cypress viewport as well

image

Describe alternatives you've considered For now I just patched the lib to my custom viewport. Another nice alternative would be if you could publish the library without bundling it and I would be able to reuse some functions like writeTestResult while overwriting doArchive...

Additional context Just wanted to say sorry and that I know this is still in early development for cypress. Id gladly jump in and open some PRs if you think its ok.

skitterm commented 8 months ago

Hi @tsirlucas, thanks for the feedback! We are planning on supporting custom viewports but are in early-days in the Cypress support right now. We'll let you know when it is supported, and let us know if you have any other feedback!

winkerVSbecks commented 2 months ago

@tsirlucas this is now supported, please check out the docs: https://www.chromatic.com/docs/cypress/configure/#viewports