Open raDiesle opened 4 years ago
+1. Our team is comparing between storyshots-puppeteer and storycap but I cannot recognize the difference in essential features from an official storyshots-puppeteer addon. IMO if these aim the same concept, I prefer the addon provided from Storybook officially.
I can tell you out of my detailed comparison and checks: dont go with the official one, its 50 times slower and has much less features than reg-viz
Then do you think storycap can run E2E tests using Puppeteer? As far as I know, storyshots-puppeteer can do and works well, but storycap has not supported. Our team's comparison was focusing to exactly that, and it's also a primary reason why we have taken the official addon.
storycap is definitely designed for reg-viz, visual regression test. So I think to mention this fact in README will help people who is blinded by the speediness of storycap in spite of purposing E2E test.
In our project, we decided not to mix assertions with snapshot testing. That is why I do believe to keep separation of concerns is where storycap shines over storyshots capabilities. storycap approach is technology independant and its more clear for developers.
Such as for a reason: when a process is correct from ui screens, we can expect the backend wrote the correct data to database. ( For full e2e tests, we setup other test suites with other technologies in other projects to cover that. Maybe you should consider to do the same. - If in your setup you want to cover full e2e verification and it cannot be verified by ui only, I see three possible solutions for you:
In general, In the .stories definition, the storybook pages can connect to mocked data or real data - here you are flexible. In current project we have growing number of 140 screenshots, which takes in total 7 minutes to test with storyshots, where storycap will take around 30 seconds.
I agree with your think in the long view. BTAIM testing architecture would be different depending on projects. My working project was starting from small, and have empowered Jest + Storybook ecosystem gradually along with growing the project. Its result is storyshots-puppeteer.
Simply I'm just not yet as dissatisfied to take screenshots in storyshots-puppeteer + jest-image-snapshot. I'm figuring out the timing when I really need Storycap. I think it's similar to the think of "When should I use Redux?".
Well, let's back to the subject of this issue. I think the most point of difference to storyshots-puppeteer is "its purpose" and have a worth to mention in the documentation to both:
[Off-topic] Why our team need story-based assertions:
My project have to provide a bunch of components for general purpose that have tested interactions well. In addition, (sadly) we still have to support for IE. storyshots-puppeteer provides a basic idea to integrate with anything with Storybook + Jest. So we can use StoryShots as the platform of cross-browser test by developing plugin based on that. We made it on us own, but there is an open-source solution in https://github.com/andrcuns/addon-storyshots-wdio.
I would add to highlight, that storycap focuses to resolve specific problem most efficient, with a ready to go setup, e.g. meant for unit testing components in isolation with fast speed, that is why it only supports chromium headless driver browser.
@yhatt Thanks . I agree your comparison summary .
We, reg-viz, intend the following separation of concern.
So ,for example, users can choice Storycap and jest-image-snapshot if they want. (I have not tried this)
One bright spot of @storybook/addon-storyshots-puppeteer
is that it takes screenshots and it does the diffing. After reading this issue, and https://github.com/reg-viz/storycap/issues/279, it's clear you're supposed to pair storycap
with reg-suit
. I may have missed it, but I haven't seen an example of how this is done. A migration guide example from addon-storyshots-puppeteer
to storycap
+ reg-suit
could help drive adoption for a complete alternative.
As a user, I'm not too discerning about which tool does the diffing. An opinionated approach is completely fine to me; the core issue driving me to abandon addon-storyshots-puppeteer
is its slow performance. If these un-opinionated tools were wrapped up into a higher abstraction, migration could be simplified.
Hello, how does Storycap stands next to Storyshots-Puppeteer and what are the differences?
It would be nice to add some information to the README.md of the project. I would be especially interested in, if storycap can provide the same results but improved performance by parallelization of executing the image tests