Commit 5e1964dd by Jay Zoldak

Update bok-choy page definitions

parent b95b595e
...@@ -5,6 +5,7 @@ Login page for the LMS. ...@@ -5,6 +5,7 @@ Login page for the LMS.
from bok_choy.page_object import PageObject from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise from bok_choy.promise import EmptyPromise
from . import BASE_URL from . import BASE_URL
from .dashboard import DashboardPage
class LoginPage(PageObject): class LoginPage(PageObject):
...@@ -24,29 +25,28 @@ class LoginPage(PageObject): ...@@ -24,29 +25,28 @@ class LoginPage(PageObject):
""" """
Attempt to log in using `email` and `password`. Attempt to log in using `email` and `password`.
""" """
self.provide_info(email, password)
self.submit()
def provide_info(self, email, password):
"""
Fill in login info.
`email` and `password` are the user's credentials.
"""
EmptyPromise(self.q(css='input#email').is_present, "Click ready").fulfill() EmptyPromise(self.q(css='input#email').is_present, "Click ready").fulfill()
EmptyPromise(self.q(css='input#password').is_present, "Click ready").fulfill() EmptyPromise(self.q(css='input#password').is_present, "Click ready").fulfill()
self.q(css='input#email').fill(email) self.q(css='input#email').fill(email)
self.q(css='input#password').fill(password) self.q(css='input#password').fill(password)
self.q(css='button#submit').click() self.wait_for_ajax()
EmptyPromise(
lambda: "login" not in self.browser.url,
"redirected from the login page"
)
"""
# Ensure that we make it to another page
on_next_page = EmptyPromise(
lambda: "login" not in self.browser.url,
"redirected from the login page"
)
with fulfill_after(on_next_page): def submit(self):
self.css_fill('input#email', email) """
self.css_fill('input#password', password) Submit registration info to create an account.
self.css_click('button#submit') """
self.q(css='button#submit').first.click()
""" # The next page is the dashboard; make sure it loads
dashboard = DashboardPage(self.browser)
dashboard.wait_for_page()
return dashboard
""" """
Student progress page Student progress page
""" """
from .course_page import CoursePage from .course_page import CoursePage
...@@ -12,11 +11,12 @@ class ProgressPage(CoursePage): ...@@ -12,11 +11,12 @@ class ProgressPage(CoursePage):
url_path = "progress" url_path = "progress"
#@property
def is_browser_on_page(self): def is_browser_on_page(self):
has_course_info = self.q(css='div.course-info').present is_present = (
has_graph = self.q(css='div#grade-detail-graph').present self.q(css='div.course-info').present and
return has_course_info and has_graph self.q(css='div#grade-detail-graph').present
)
return is_present
def scores(self, chapter, section): def scores(self, chapter, section):
""" """
......
...@@ -28,6 +28,6 @@ class LoginPage(PageObject): ...@@ -28,6 +28,6 @@ class LoginPage(PageObject):
# Ensure that we make it to another page # Ensure that we make it to another page
EmptyPromise( EmptyPromise(
lambda: "login" not in self.browser.url, lambda: "login" not in self.browser.current_url,
"redirected from the login page" "redirected from the login page"
).fulfill() ).fulfill()
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
-e git+https://github.com/edx/js-test-tool.git@v0.1.5#egg=js_test_tool -e git+https://github.com/edx/js-test-tool.git@v0.1.5#egg=js_test_tool
-e git+https://github.com/edx/django-waffle.git@823a102e48#egg=django-waffle -e git+https://github.com/edx/django-waffle.git@823a102e48#egg=django-waffle
-e git+https://github.com/edx/event-tracking.git@f0211d702d#egg=event-tracking -e git+https://github.com/edx/event-tracking.git@f0211d702d#egg=event-tracking
-e git+https://github.com/edx/bok-choy.git@25a47b3bf87c503fc4996e52addac83b42ec6f38#egg=bok_choy -e git+https://github.com/edx/bok-choy.git@82b4e82d79b9d4c6d087ebbfa26ea23235728e62#egg=bok_choy
-e git+https://github.com/edx-solutions/django-splash.git@9965a53c269666a30bb4e2b3f6037c138aef2a55#egg=django-splash -e git+https://github.com/edx-solutions/django-splash.git@9965a53c269666a30bb4e2b3f6037c138aef2a55#egg=django-splash
-e git+https://github.com/edx/acid-block.git@459aff7b63db8f2c5decd1755706c1a64fb4ebb1#egg=acid-xblock -e git+https://github.com/edx/acid-block.git@459aff7b63db8f2c5decd1755706c1a64fb4ebb1#egg=acid-xblock
-e git+https://github.com/edx/edx-ora2.git@release-2014-04-14#egg=edx-ora2 -e git+https://github.com/edx/edx-ora2.git@release-2014-04-14#egg=edx-ora2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment