When a visual test runs in the cloud, the test output includes the following:
- Screenshots and logs: Similar to browser test output, visual tests update the test output page with screenshots and logs in real time.
- Visual changes: mabl processes each screenshot to detect visual changes. If mabl detects a visual change for a particular page in the test, the visual change appears on the test output page.
Results don't populate immediately
While mabl is still calculating visual changes, a banner appears on the test output page: "Scanning for visual changes; refresh for latest results".
Screenshots and logs
Every time a visual test runs in the cloud, the mabl-generated flow "Visual Smoke Test" visits each URL and completes the following actions:
- Capture a screenshot of the page
- Collect test diagnostics:
- Check that the page returns a 200 response
- Capture network activity on the page
- Capture a DOM snapshot
Visual changes
It takes two runs for mabl to identify visual changes in a visual test.
- On the first plan run, mabl establishes a visual baseline.
- On subsequent runs, mabl compares each page to its visual baseline.
The comparison to the visual baseline is a static comparison between the current run and the visual baseline. Each pixel is compared and considered a match if the exact same color is in the the exact pixel location of both screenshots. Then, differences are clustered and related to the full DOM information captured during the runs. Finally, components encompassing regions of individual pixel changes are identified and marked as visual changes.
If the differences between the two screenshots meet the minimum visual change threshold, which is roughly the size of a blinking cursor, mabl does the following:
- Highlight the regions of the page that appear different
- Flag the step as a visual change in the test output
- Report a visual change insight in your workspace
Notes on visual baselines
mabl creates a separate visual baseline for each browser that the test runs on.
If you make any updates to the list of URLs to visit, mabl establishes new visual baselines for all pages on the next plan run.
Learn more
To learn more about how to review insights from visual tests, check out the article on how to review a visual test.
