Typefully

Visual Testing example with Playwright

Avatar

Share

 • 

3 years ago

 • 

View on X

@playwrightweb #VisualTesting is awesome. Take a look at this approach. It does not only save some lines of code. It can also catch CSS issues like color changes or elements alignment that the toBeVisible function cannot.
Here is an example. I tweaked the expected sign-in form on the SauceDemo website so the test failed the visual comparison. #Playwright created three files so you can easily see what is the issue. Would this have been caught by toBeVisible only? Check the diff file! 😍
Explore it further here! playwright.dev/docs/test-snapshots
Avatar

Fernando Távora

@fertavora

Lead Software Engineer in Test 🇦🇷🇪🇸