Hi, I'm Ruben, and I am the lead solutions engineer at Chromatic, and we're the maintainers of Storybook. So, I'm going to start with a story. This is you, and UI testing is hard. There are so many states and variants, responsiveness, loading states, it's all kind of confusing and it all burns down to the ground. Well, hopefully not, but that's how it ends up sometimes.
So, really, there are two problems. Let's say that this is your third week in a row that you've gotten a call and the UI is broken on the website and you need to go fix it, or even worse, the site is completely down. Now, that's not fun for anyone. And then, on the other side, when you're not getting called in on the weekend to fix UI issues, you're dealing with flaky integration tests, and that's not fun either. So, when do you have fun in your job? Doesn't sound like you're having fun at all.
Ideally, we move away from that complicated state and torch it and really make it simple. You just want what your UI looks like and compare it to what it looks like now. And storybook is the first part of solving that problem. Storybook allows you to build your UI in isolation, and it simplifies it because you don't have to worry about back-end logic and API calls, databases, none of that. You're just building your UI. And it works. So, it speeds up the process. And then, chromatic is the other side of that, where it creates automated tests of your UI. Now, what does that look like? I'm gonna show you an example.
So, here we have an application called Mealdrop, and it's an Uber Eats clone. Storybook allows you to create all types of components. You have your atomic components, so, for instance, this button, and storybook has controls which are essentially the props for your component and allows you to play around and prototype things all within the storybook environment in your browser. And you can also create page-level components. So, for instance, like the home page. Or a restaurant detail page. And this has everything in it, right? Your whole page structure. And the best part of it is that it's isolated, and you don't have to worry about inconsistent data or anything like that. Now, that solves the first problem. But it doesn't solve the second problem of how the heck... What do you do to make sure that your UI isn't failing in production? That's where chromatic comes in.
Comments