dimagi/core-hq — pull request #64 by mwhite (2012-10-02 19:46:27+00:00)
Title: Add selenium test infrastructure with example tests for cloudcare and reports

This depends on the selenium wrapper from https://github.com/dimagi/dimagi-utils/blob/5505166d546f7df27a078fdb072da0433a7b2800/dimagi/utils/django/test.py and requires additional changes to the commcare-hq repo that I have ready to go.

This adds a new manage.py command 'seltest' which runs any tests found in tests/selenium/ directories in apps.

There is a class hierarchy of testcases, one for HQ in general that logs you in given a username and password, one for an admin user, and one for a mobile worker. The credentials for these are in settings.

The example reports testcase does a basic check that all of the reports load.

The base CloudCare testcase provides convenience methods for clicking on forms, submitting forms, clicking on cases in the case list, and closing all cases after the test run.

The example CloudCare testcase implementation tests the Basic Test application from the corpora domain, creating, updating, and closing cases.

There are settings for the CommCare HQ URL and the default project to test against, as well as the browser to use for tests.

There is a setting that seamlessly lets you run the tests in Xvfb (which you have to install in your OS) instead of opening a browser window in your X session.