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

Top Visual Regressions that You Can Spot with and without Automated Testing

Visual bugs are typically considered easy to spot. You can often see what’s missing or what’s amiss on a web page.

A photo that’s too much to the left, the wrong fonts, a missing button -- these are things that you can spot at a simple glance. But not all visual bugs are that easy to catch, especially not with the naked (or untrained eye).

This is where automated visual regression tools like Diffy come into play. They can help you spot elusive visual bugs easily, even if you have to test hundreds of pages.

4 mins read

25 Web Dev & QA Testing Statistics Every Developer Should Know [2022]

Trends move quickly in the web development and QA testing space. These trends can help predict where the QA and testing industry is headed. Development teams can adapt emerging best practices and methodologies while gaining a better understanding of the challenges they face throughout the development cycle.

 

7 min read

What Kind of Things Break During WordPress or Drupal Updates and How to Fix Them Quickly

Much of the modern Web is powered by open source content management systems (CMS) like WordPress or Drupal. Like all software, though, even the most reliable CMS needs bugfixes, and all world-class software gets new features in time. And sometimes, – we’ve all been there – no matter how good the intentions behind them are, some updates break things.
3 mins read read

Diffy helps your QA team

to ensure that websites don't get visual bugs