Hello, and thank you very much for joining my talk. My name is Rainer Haneckamp. I am from Austria, and I am a trainer and consultant at Angular Architects. So this means I spend most of my time with Angular.
This talk is about visual regression. So this means that we will create automatically screenshots from our application, from our components, and we will match them against existing reference images. This is very similar to what we find with just snapshots, but whereas the snapshots are based on strings, visual regression uses real images.
And as I said before, we are doing a lot of workshops, and every time that I'm introducing this topic, there are two different types of developers. The first type says, well, that's great. I always wanted to see how this works. This is exactly what I needed. And it is very most likely that they are working on UI libraries or that they have applications. There a lot of time is invested into a very attractive design.
The majority though says, well, I'm writing business application or applications, and most of my time I'm using form elements. I'm using grids, and I don't create them by myself. I use already an existing framework like Material Bootstrap or whatever. Why do I have to care about visual regression? If you are sharing this opinion, then just think what happens when you're entering a website and you see that the buttons are overloaded, overflowing, or that the text is overflowing or something like that. Would you really trust this website? Would you really be ready to pay for some of their services? Very likely not. Why? Because the first impression was already a very bad one. And as everywhere in life, first, the first impression really counts. And as it is in applications, the visual part is always the first impression. So don't underestimate that, regardless what type of application you have.
And this is how we are going to do it. I will show you how to do visual regression by using three different libraries, frameworks. I will start with just Puppeteer, then Playwright, and then Cypress. Let's start. Okay, so here we are. This is our application, and what we want to test is this holiday card here. The first action is already that we don't create a screenshot of this URL, because it also contains the side menu here on the left side, the header. And if something changes there, then the test would throw an error, although the holiday card still looks nice.
Comments