A script to conduct visual testing with BackstopJS. This script can give you the confidence of delivering a bug free UI and can save you from monotonus work of regression testing. This Visual Automation framework is a quick and efficient tool to identify visual changes without vetting through the whole application manually.
-
NEW FEATURES
- Support for Sitemap.xml
We have three options in this basic framework to run the tests.
If you have a large number of URLs (>1000) that you would like to test then you should configure the following files
- First, you should have one CSV file having a standard format. You can download the Sample CSV file from here
- After downloading just replace the URLs in the CSV file and keep this in
./data/
directory or any path of your choice. Just make sure to add the path in package.json underinput
If you have only a few URLs and don't want to maintain a seperate CSV file, you should configure mainConfig.js
- Change the
baseUrl
,referenceUrl
as per your requirement. - Add the slugs in the
relativeUrls
array.
If your site have large number of URL's that you would like to test without adding those URLs to CSV or manually adding them we recommend to use Sitemap XML Feature with which you the site URLs will be automatically fetched and you can perform testing on the fetched URLs. You should configure the following files for using Sitemap XML Feature:
- Create a
.env
file and add thebaseUrl
and thereferenceUrl
to this file. - Install the dependencies and Execute the run command
- Create reference screenshot from reference site (For expected results)
npm run reference:xml
- Run the test(It will take the screenshot of the given site and will test against reference screenshot)
npm run test:xml
npm install
-
Create reference screenshot from the source site (For expected results)
backstop reference
ornpm run reference
-
Run the test(It will take the screenshot of the given site and will test it against the reference screenshot)
backstop test
ornpm run test
-
Create reference screenshot from source site (For expected results)
npm run reference:csv
-
Run the test(It will take the screenshot of the given site and will test against reference screenshot)
npm run test:csv