happo / happo.io

Happo is a cross-browser screenshot testing service
https://happo.io
MIT License
196 stars 25 forks source link

`happo dev` command not supported with some plugins #88

Open trotzig opened 5 years ago

trotzig commented 5 years ago

Currently, none of the happo-plugin-storybook and happo-plugin-gatsby plugins work when running happo dev. The dev command mostly makes sense when you have your own -happo.js files, so it might not make sense to fix support -- we might just have to bail with some useful error message.

monokrome commented 3 years ago

I think the dev command seems like it'd be useful for storybook still. Aren't stories in storybook essentially analogous to -happo.js files in the end?

trotzig commented 3 years ago

@monokrome They definitely are. Getting happo dev to work for storybook integrations is a little more tricky though because of how the integration is set up. Basically happo delegates preparing a static package to storybook (i.e. build-storybook) and then that package is sent to happo.io for screenshots. In a regular Happo examples integration we are in control of the build process, which means we can single out -happo files and make smaller packages, which makes the dev experience better as we're getting screenshots back quicker.

I've been thinking about a slightly different dev experience for Storybook projects with happo where we would have a button in the Storybook UI to quickly check what this components look like in different browsers, and then you can incrementally make changes to the component and get diffs along the way. Do you think this would be interesting? If so, maybe we can outline/sketch out the feature here?

trotzig commented 3 years ago

I've had an initial look at the outlined dev experience (button in the Storybook UI) and these are some thoughts and challenges:

trotzig commented 3 years ago

By the way, this is what I had in mind for the Storybook UI (in its simplest form):

Screenshot 2021-01-09 at 22 23 58

If you hit that button, we would show one or more screenshots in that box. If you hit it again, we would compare the new screenshots with the previous ones.

There are of course other features we could consider down the road. Here are some ideas: