Using screenshots for regression tests
We briefly talked about UI regression tests in Chapter 2, Automated Testing and Test runners. Now it's time to get practical. First, let's recap the concept of regression. Regression is something you hear a lot when you see bug reports. If a user says something like "I found a regression in X feature," they mean that something that was working before in a certain way has now changed. It might be a bug, an error in the app, or an unreported change of behavior.
We can say that a UI regression is when we detect that a page or component has changed visually. I want to be emphatic again. It might have changed due to a bug or an unreported change of style.
To prove a regression, you need evidence. Until now, we were testing behavior, and our evidence was the code: "If I input the user, the password, and then I click on the login button, I should get logged in."
To prove a UI regression, our evidence will be screenshots...