Update bok-choy page definitions
This commit is contained in:
@@ -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):
|
|||||||
"""
|
"""
|
||||||
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(
|
def submit(self):
|
||||||
lambda: "login" not in self.browser.url,
|
"""
|
||||||
"redirected from the login page"
|
Submit registration info to create an account.
|
||||||
)
|
"""
|
||||||
|
self.q(css='button#submit').first.click()
|
||||||
|
|
||||||
"""
|
# The next page is the dashboard; make sure it loads
|
||||||
# Ensure that we make it to another page
|
dashboard = DashboardPage(self.browser)
|
||||||
on_next_page = EmptyPromise(
|
dashboard.wait_for_page()
|
||||||
lambda: "login" not in self.browser.url,
|
return dashboard
|
||||||
"redirected from the login page"
|
|
||||||
)
|
|
||||||
|
|
||||||
with fulfill_after(on_next_page):
|
|
||||||
self.css_fill('input#email', email)
|
|
||||||
self.css_fill('input#password', password)
|
|
||||||
self.css_click('button#submit')
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
"""
|
"""
|
||||||
Student progress page
|
Student progress page
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from .course_page import CoursePage
|
from .course_page import 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):
|
|||||||
|
|
||||||
# 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,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/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
|
||||||
|
|
||||||
# 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
|
-e git+https://github.com/pmitros/ConceptXBlock.git@2376fde9ebdd83684b78dde77ef96361c3bd1aa0#egg=concept-xblock
|
||||||
|
|||||||
Reference in New Issue
Block a user