AutomatedVisualTesting 1.0.0
See the version list below for details.
dotnet add package AutomatedVisualTesting --version 1.0.0
NuGet\Install-Package AutomatedVisualTesting -Version 1.0.0
<PackageReference Include="AutomatedVisualTesting" Version="1.0.0" />
paket add AutomatedVisualTesting --version 1.0.0
#r "nuget: AutomatedVisualTesting, 1.0.0"
// Install AutomatedVisualTesting as a Cake Addin #addin nuget:?package=AutomatedVisualTesting&version=1.0.0 // Install AutomatedVisualTesting as a Cake Tool #tool nuget:?package=AutomatedVisualTesting&version=1.0.0
Automated Visual Testing
Lots of tests rely on Selenium WebDriver and similar tools to automate end to end testing. Whilst this ensures elements are displayed 'somewhere' on a page, they do not guarantee that elements are exactly where they should be and looking as expected!
Using this 'Visual' approach tests can execute a lot quicker and ensure elements are rendered how we expect them to be rathan than the typical approach of trying to find each element to ensure things have loaded on to a page.
It is also necessary sometimes to check contents of files, which can be quite time consuming to open up pdf files to check that the contents are as expected. Using this framework it is also possible to save all pdf pages as images and compare those to previously saved pdf images to check for changes.
How it works
Base images for websites
Once you are happy with how a particular area or how the whole of your web page looks you write tests using this framework. The first time you run your tests the base images will not exist,this framework will automatically take the base images for you and alert you to tell you that this has been done.
Compare a base image of a web page to an image of a web page taken by visiting a url:
[TestMethod]
public void Full_Page_Comparison_Test()
{
// Create a new chrome webdriver
var driver = new ChromeDriver();
// Navigate to the page we want to compare
driver.Navigate().GoToUrl("https://computer-database.herokuapp.com/computers");
// Specify where the base image is to compare
var baseImage = "ComputerDatabaseHomePage.Chrome.png";
// Get differences between base image and actual image taken with the chrome webdriver
var result = Differences(baseImage, driver);
// Assert expected result is match (no differences)
Assert.IsTrue(result.Match);
// Close down the driver
driver.Quit();
}
Debugging when tests fail
When your tests fail because results were not as expected, the framework will take screenshots of what it actually compared as well as an image displaying where the differences were found.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET Framework | net45 is compatible. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
-
- Selenium.Support (>= 3.4.0)
- Selenium.WebDriver (>= 3.12.1)
- Selenium.WebDriver.ChromeDriver (>= 2.40.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Initial release.