Selenium Test Suite for Mahara
==============================

This directory contains a series of test suites for Mahara, that can be tested
using selenium [1].

The test suites are arranged into directories. Each directory has a set of tests
(html files) and a 'test_suite' file that describes the order in which those
tests should be executed. There are some common tests in 'shared', which is not
a test suite on its own. The index.html files are generated automatically by
the generate-testsuites.py script.

To quickly set up selenium core so you can run the tests, run the
install-selenium-core.sh script present in this directory. This will set up
selenium core at http://your-mahara-install-path/selenium-core/TestRunner.html.

Writing your own Test Suite
---------------------------

You can make your own test suites if you would like. Just create another
directory and start adding tests.

You have to create a test_suite file that lists what order your tests will be
run in. Just copy one from another suite directory.

Note that what your test suite does it MUST undo. For example, if you have a
test that creates a new view, then you must also have another test that
destroys it. This is so future tests being run in the full test suite can
depend on Mahara being in a certain state.

In addition, your test suite must assume the system is visited in the logged
out state. You should use the tests in `shared/` to log a user in and then log
out again at the end of your test suite.

Also make sure your test does not use any specific URLs (e.g. 'localhost' or
'mahara-test'). Instead, rely on the path to your file instead - e.g.,
/theme/default/static/images/filename.png

The 'basic-install' test will install Mahara, then insert some users that your
tests can depend on existing. Please don't create users in your tests that you
do not remove.

generate-testsuite.py
---------------------

This script searches through all of the test suites and builds an index.html
file from each test_suite file. It also builds an index.html file that
includes them all, with 'basic-install' running first. You can use this
suite on an empty, uninstalled Mahara in order to give the entire codebase a
good workout.


TODO
----

 * Make a test suite that runs basic-install then runs some of the major test
   suites.
 * Handle file uploads.


[1] http://www.openqa.org/selenium/
