Automated UI test is a great way to validate UI bugs. There are many ways of doing this. One of the easiest ways to validate UI components automatically is to use Applitools. Applitools provides nice, clean APIs that you can easily plug in your automated test suite. First you need to get an Applitools account. They have a free trial account if you can try before deciding to purchase.
Once you get an API key from Applitools, you can create an applitools eyes object to use in the test.
Once you run the test, if the test fails, the eyes object will give an URL that
contains the expected/ actual image diff.
@eyes = Applitools::Eyes.new
@viewport_size = Struct.new(:width, :height).new(1024, 768)
@eyes.api_key = $eyes_api
def check_page_visually(url, name)
@eyes.test(app_name: 'TestmySite', test_name: name,
driver:@driver) do |driver|
driver.navigate.to(url)
@eyes.check_window
end
end