ets-berkeley-edu/calcentral — pull request #2600 by pfarestveit (2014-06-04 23:38:45+00:00)
Title: CLC-3838: Initial Selenium WebDriver UI tests

https://jira.ets.berkeley.edu/jira/browse/CLC-3838

In order to run the tests from the command line, include 'testui' as a tag argument (i.e., '--tag testui'). Use the settings.yml file to change the test environment (QA vs Dev), the browser, and a number of other configs. For now, the tests will only run on Firefox, as other browsers require additional config and/or and an executable, which we can set up gradually.

The code uses the page object design. See https://code.google.com/p/selenium/wiki/PageObjects. The Ruby 'page-object' gem is discussed here: http://www.cheezyworld.com/2011/07/29/introducing-page-object-gem/. As far as possible, the actual tests avoid any reference to the actual internals of the HTML and rely instead on the page objects.

Three of the tests are straightforward UI tests, each with a single user. These should be easy to comprehend. The fourth tests both the My Finances Billing Summary UI, validating that the values shown in the UI match those served to the UI by the CalCentral JSON layer. This test contains a loop that iterates through a defined set of UIDs, of which it knows nothing apart from the UID itself. Based on the JSON for each user, the test verifies the content of the user's billing summary. This test also generates a csv artifact, which lists information about the UIDs and can be used to reveal gaps in the current test data.