selenium-mocha
run selenium tests in the browser using generators and mocha
Installation
npm install selenium-mocha
Usage
For full example see "test" folder. A fresh browser is automatically created and disposed of for each test case. Each test case runs in parallel by default (unless you use --grep
which forces it into serial operation).
'use strict'; var assert = ;var chromedriver = ;var browser = ; chromedriverstart;browser;; ;
Initialization. Configure the following settings:
//configure how to connect to the remote using the same arguments as `wd.remote`browser; //set a timeout for all browser test casesbrowser; //set a timeout that gets reset once each `yield` statement completesbrowser; //optionaly force all tests to evaluate in sequence (this is typically much slower)browser;
You can also pass any of those as options.
Enabling generators
To enable generators, install gnode via npm install gnode --save-dev
then enable them by creating a mocha.otps
file in the unit tests folder with the following body:
--require gnode
This will precompile files using facebook's regenerator.
License
MIT