Commit 5e1964dd by Jay Zoldak

Update bok-choy page definitions

parent b95b595e
......@@ -5,6 +5,7 @@ Login page for the LMS.
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise
from . import BASE_URL
from .dashboard import DashboardPage
class LoginPage(PageObject):
......@@ -24,29 +25,28 @@ class LoginPage(PageObject):
"""
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#password').is_present, "Click ready").fulfill()
self.q(css='input#email').fill(email)
self.q(css='input#password').fill(password)
self.q(css='button#submit').click()
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"
)
self.wait_for_ajax()
with fulfill_after(on_next_page):
self.css_fill('input#email', email)
self.css_fill('input#password', password)
self.css_click('button#submit')
def submit(self):
"""
Submit registration info to create an account.
"""
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
"""
from .course_page import CoursePage
......@@ -12,11 +11,12 @@ class ProgressPage(CoursePage):
url_path = "progress"
#@property
def is_browser_on_page(self):
has_course_info = self.q(css='div.course-info').present
has_graph = self.q(css='div#grade-detail-graph').present
return has_course_info and has_graph
is_present = (
self.q(css='div.course-info').present and
self.q(css='div#grade-detail-graph').present
)
return is_present
def scores(self, chapter, section):
"""
......
......@@ -28,6 +28,6 @@ class LoginPage(PageObject):
# Ensure that we make it to another page
EmptyPromise(
lambda: "login" not in self.browser.url,
lambda: "login" not in self.browser.current_url,
"redirected from the login page"
).fulfill()
......@@ -23,10 +23,10 @@
-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/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/acid-block.git@459aff7b63db8f2c5decd1755706c1a64fb4ebb1#egg=acid-xblock
-e git+https://github.com/edx/edx-ora2.git@release-2014-04-14#egg=edx-ora2
# Prototype XBlocks for limited roll-outs and user testing. These are not for general use.
# Prototype XBlocks for limited roll-outs and user testing. These are not for general use.
-e git+https://github.com/pmitros/ConceptXBlock.git@2376fde9ebdd83684b78dde77ef96361c3bd1aa0#egg=concept-xblock
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