Skip to main content
26 February 2020

How to Avoid False Positives when Doing Visual Testing

The biggest pain point of full-page screenshot visual regression testing is false positives. They usually happen because of the dynamic nature of the content.

There are few ways of handling this situation.

First, you could mask or remove dynamic elements completely. But then you’ll miss testing them.

Another option, if you are comparing your Production with the Staging environment you could to sync the content so those dynamic elements are the same.

But what if you take screenshots from Production regularly and editors do change content over time?

We have come up with Content Fixtures. The main idea is that right before the screenshot is taken we inject javascript that alters the content of the site so you can substitute dynamic content with “lorem ipsum”.

 

Example of avoiding false positives

Original dynamic element

Content Fixtures Original Image
Original site with dynamic elements

We have applied title, paragraph, and image fixtures.

Content Fixtures Applied
Content Fixtures Applied

As you can see still after applying fixtures we have blocks slightly with different heights. That happens because the original images were of different heights. It makes sense to fine-tune this so if in the future articles will change and images will be different heights we won’t get changes because of that.

So we can apply fixtures and also apply custom CSS to make blocks the same height.

Content Fixtures Applied and CSS
Content Fixtures Applied and CSS

On Project's settings, things would look like this. Same old CSS selectors.

Project Settings Content Fixtures

 

Project Settings CSS

Functional vs. Non Functional Testing: A Comparison Guide

Testing plays a vital role in successful software deployment, product releases, or end-to-end solutions building. Both functional and non functional testing hold equal importance in successfully executing the complete SDLC. 

This article will look at the comparative analysis for both of these testing types. Need a more in-depth look at non functional testing first? Check out our comprehensive guide on non functional testing

6 min read

Automation Testing 101: Benefits, Types & Tools

If you are familiar with software testing, you already know that there are two main types: manual and automation testing. Both aim to execute a test case and compare the expected results and actual results.  The difference between the two is that manual testing is performed by a human who checks the software to determine if it is working as expected. In contrast, automation testing requires using a software tool or framework to execute test cases. 
5 mins read

Diffy helps your QA team

to ensure that websites don't get visual bugs