UI functional testing with mocha and webdriverjs
This repository contains skeleton example on how to use mocha and webdriverjs to write UI functional tests. Tests are written with mocha, and webdriverjs is used to inject the mocha tests to the page.
- grunt.js (run
npm install -g gruntto install it)
- have firefox installed
- have java installed (and added to the PATH for Windows)
- Open your bash console.
If use windows cmd, make sure to change the path in grunt.js.
- Navigate to the root folder, and then run
- Download Selenium server and put in
Running the tests with grunt
In the root folder, run the following grunt commands sequentially in separate console window. Run
grunt.cmd for Window cmd.
After running step 3, webdriver will open jquery.com and inject the mocha test to the page, and you should be able to see the test result at the bottom of the page.
If the test doesn't show up the browser, clear the cache of the browser, and then re-step 3 should fix it.