Latest revision as of 22:03, 25 February 2018

Running the test

Go to the terminal and cd into your code directory. If you set it up following the wiki, that will be

cd code/mahara

The command for running tests consists of a helper script which takes two arguments:
the mode you want to run in and the test/s you want to run.

./test/behat/mahara_behat.sh <mode> <test/s>

The options for mode are:

run - runs the selected tests in a local browser

rundebug - runs the selected tests in a local browser and outputs additional debug info in the terminal

runheadless - runs the selected tests without opening a browser

rundebugheadless - runs the selected tests without opening a browser, but with additional debug info in the terminal

The second argument is optional. If you don't include one, all the tests will be run, but this will take a l-o-n-g time!
So to only run specific tests, include a tag (e.g. @mytests) to run all the tests with that tag,
or a feature file name (e.g. my_test.feature) to run the test scenarios in that file.

A couple of specific examples:

./test/behat/mahara_behat.sh rundebug @core_account

(runs all the tests in feature files tagged @core_account, using a browser, with debug output)