Skip to content
David Carlson edited this page Apr 29, 2015 · 6 revisions

Detailed testing instructions

These steps will walk you through running and modifying the tests within 320MLP. It assumes that you have already successfully downloaded and installed the source code. If you need help doing this, instructions can be found in the README.md.

###Running tests

All tests are run from the root directory. The following command will execute all tests in the top level of the /test folder.

$ mocha

You can specify which tests you want mocha to execute by using --grep and part or all of the name of the test you want to execute. For example

$ mocha --grep 'Integration'

Note, without a specified path, mocha will only search for the given pattern in the top-level of the test directory.

To specify a path or test a sub-folder of /test, such as the integration-test folder, execute the following

$ mocha test/test-integration

You can combine these two techniques to search for certain tests within a subfolder. For example, to test only whether or not the page exists in the integration tests

$ mocha test/test-integration 'page exists'

For more mocha commands see mochajs.org.

For protractor integration tests, which test the entire app with local server. Run all the following commands from the program root directory:

Download the webdriver manager

$ webdriver-manager update

Start the app

$ node app

Also download any browsers you want to test (Chrome, Firefox), and then start the Selenium server

$ webdriver-manager start

Run the tests with

$ protractor test/Protractor_Tests/Protractor.conf

If you wish to step through the integration test, run

$ protractor debug test/Protractor_Tests/Protractor.conf

And enter 'c' repeatedly to jump between my break statements.

Clone this wiki locally