edx/edx-platform — pull request #594 by JonahStanley (2013-08-06 14:07:44+00:00)
Title: Jonahstanley/firefox acceptance tests

Suggested reviewers: @wedaly @jzoldak

Making a pull request so that this can be merged in and I can work on fixing the remaining tests separately and tests in firefox can begin (and start catching more bugs). In order to run the acceptance tests in firefox, change the browser_driver in browser.py to 'firefox'

With these changes, only the following will not work in firefox and are marked:
* The date/time change will not persist in subsection.feature. This is an actual bug and is on the studio backlog for this sprint
* Checklist links could not be activated. This is skipped in firefox for now
* Max Attempts behave differently in Firefox but not in a bad way. I will make a bug report in studio. But as such, the phrasing of the test no longer applies. This is thus skipped in firefox for now.
* There is a redirect issue in firefox that only occurs when running the whole suite. This is not skipped yet due to the fact that it works individually and technically spans multiple steps

The following things were added in order to get the acceptance tests to run on firefox:
* Links had to be clicked explicitly. This involved changing the css selector and can be applied to chrome
* Notification bars could not be clicked through the webdriver so instead they are clicked through javascript on firefox
* A function called is_firefox() was added that will return if the browser_driver name is 'firefox' allowing for some specific solutions / skipping based on browser
* Firefox will not trigger certain events through the webdriver, thus the function trigger_event was added. This will trigger a jquery event on the given selector. By default, it triggers the 'change' event on index 0. This was helpful in getting certain input fields to update properly. This function should be avoided when possible.
* Code Mirror will now work on firefox, this was done by forcibly blurring the codemirror field
* Certain things could not be clicked or touched by firefox because they were underneath other elements. On firefox, they are made visible through javascript
* Some small changes were made to the code so that less needed to be different between firefox and chrome.

These tests were verified to still work with the latest version of chrome and chrome driver. The version of firefox that was tested was 22.0

One other major issue is that firefox will not fire certain events if firefox is not the active window. As far as I know, this will only affect the LaTex scenario in problems.feature. Splinter will start the firefox browser as the active window. However, this means that it needs to remain the active window making testing a pain due to not being able to run in the background. Also, this will have implications on running multiple acceptance tests in parallel on firefox as only one of them can be in the foreground.