Test runner for visual regression testing and not only.
Ensure that a selenium/browser WebDriver is started. Install the NPM package:
npm install webdriver-client-test-runner@https://github.com/DenisKudelin/webdriver-client-test-runner.git
An example repository using webdriver-client-test-runner can be found here.
The configuration file contains all necessary information to run your test suite. Here is an example configuration with all supported properties:
// All patterns or paths are relative to the directory where the config file resides.moduleexports =// Jasmine configuration.jasmine:defaultTimeoutInterval: 30000// [REQUIRED] Patterns of test files to run.specs:"./lib/tests/**/*Tests.js"// [REQUIRED] Browser list to run tests. All specs will be launched for each browser.capabilities:browserName: "chrome"browserName: "chromium" // we also can use "chromium" as the browser name, but a path to chrome.exe should be defined.chromeOptions:binary: "path to chrome.exe"browserName: "firefox"firefox_binary: "path to firefox.exe"browserName: "internet explorer"// Url or path to a html file that will be opened before all specs are started. If not defined, the blank page will be used.defaultTestPageUrl: ""// Urls or patterns to *.css/*.js files that will be inserted to the start page as link or script blocks. Can be used only for local pages.files:"../Externals/JQuery/jquery.js"// Patterns to *.js files that will be evaluated on the start page.execFiles:"../helpers/**.js"// Webdrivercss configuration. (These are the default settings)webdrivercss:screenshotRoot: "screenshots/" // The path to save original screenshotsfailedComparisonsRoot: "screenshots/failedComparisons" // The path to save differences from original screenshotsmisMatchTolerance: 0 // Number between 0 and 100 that defines the degree of mismatch to consider two images as identical, increasing this value will decrease test coverage.gmOptions: // Graphics Magick optionsappPath: // Path to the Graphics Magick binaries
To write tests we use Jasmine test framework. To access the browser functions we use the global variable "browser". Here is an example test:
For example, we can use the gulp to run our tests:
var gulp = ;var webdriverClientTestRunner = ;gulp;
Now we can run our tests: