edx/edx-platform — pull request #64 by JonahStanley (2013-06-04 20:46:53+00:00)
Title: Jonahstanley/fix codemirror tests

Suggested Reviewers: @jzoldak @cahrens

Fixed code mirror editing issues and now the tests run successfully

The fix:

It turns out that when the code mirror area that we want to edit is focused, the place to edit can be found through:
div.CodeMirror.CodeMirror-focused > div > textarea
Keys can be sent to the element corresponding to this css selector.

In order to focus on the correct value, the element is found through the index of the key (which is unique). ".CodeMirror" is the list of all of the code mirror objects. Since there is a one-to-one correspondence between the keys and values, the index of the key is the same as the index of the value.