Added bok choy test for proctoring instructor dashboard
This commit is contained in:
@@ -767,6 +767,53 @@ class SpecialExamsPageAllowanceSection(PageObject):
|
||||
"""
|
||||
return self.q(css="a#add-allowance").present
|
||||
|
||||
@property
|
||||
def is_allowance_record_visible(self):
|
||||
"""
|
||||
Returns True if the Add Allowance button is present.
|
||||
"""
|
||||
return self.q(css="table.allowance-table tr.allowance-items").present
|
||||
|
||||
@property
|
||||
def is_add_allowance_popup_visible(self):
|
||||
"""
|
||||
Returns True if the Add Allowance popup and it's all assets are present.
|
||||
"""
|
||||
return self.q(css="div.modal div.modal-header").present and self._are_all_assets_present()
|
||||
|
||||
def _are_all_assets_present(self):
|
||||
"""
|
||||
Returns True if all the assets present in add allowance popup/form
|
||||
"""
|
||||
return (
|
||||
self.q(css="select#proctored_exam").present and
|
||||
self.q(css="label#exam_type_label").present and
|
||||
self.q(css="input#allowance_value").present and
|
||||
self.q(css="input#user_info").present and
|
||||
self.q(css="input#addNewAllowance").present
|
||||
) and (
|
||||
# This will be present if exam is proctored
|
||||
self.q(css="select#allowance_type").present or
|
||||
# This will be present if exam is timed
|
||||
self.q(css="label#timed_exam_allowance_type").present
|
||||
)
|
||||
|
||||
def click_add_allowance_button(self):
|
||||
"""
|
||||
Click the add allowance button
|
||||
"""
|
||||
self.q(css="a#add-allowance").click()
|
||||
self.wait_for_element_presence("div.modal div.modal-header", "Popup should be visible")
|
||||
|
||||
def submit_allowance_form(self, allowed_minutes, username):
|
||||
"""
|
||||
Fill and submit the allowance
|
||||
"""
|
||||
self.q(css='input#allowance_value').fill(allowed_minutes)
|
||||
self.q(css='input#user_info').fill(username)
|
||||
self.q(css="input#addNewAllowance").click()
|
||||
self.wait_for_element_absence("div.modal div.modal-header", "Popup should be hidden")
|
||||
|
||||
|
||||
class SpecialExamsPageAttemptsSection(PageObject):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user