edx/bok-choy — pull request #3 by wedaly (2013-12-09 03:11:09+00:00)
Title: Will/tests and refactor

* Refactored `PageObject` to store a reference to `WebAppUI`, which allows pages to refer to other pages.

* Added an automated test suite for `bok_choy` with 76% coverage. The main missing pieces are fixtures (ssh connection) and SauceLabs integration. I included a `travis.yml` file so the tests can run in Travis.

* Added a (hopefully) cleaner mechanism for waiting for JavaScript using decorators. You can now decorate a class like so:

@requirejs('base/main')
@js_defined('XModule')
class MyPage(PageObject):

@wait_for_js
def foo(self):
self.css_click('input')

This will ensure that `base/main` is loaded and `XModule` is defined before executing `foo`. Classes decorated like this can also use `self.wait_for_js()` within a method to wait for all the page's requirements.