本文整理汇总了Python中common.test.acceptance.pages.lms.instructor_dashboard.InstructorDashboardPage.select_student_admin方法的典型用法代码示例。如果您正苦于以下问题:Python InstructorDashboardPage.select_student_admin方法的具体用法?Python InstructorDashboardPage.select_student_admin怎么用?Python InstructorDashboardPage.select_student_admin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common.test.acceptance.pages.lms.instructor_dashboard.InstructorDashboardPage
的用法示例。
在下文中一共展示了InstructorDashboardPage.select_student_admin方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestLTIConusmer
# 需要导入模块: from common.test.acceptance.pages.lms.instructor_dashboard import InstructorDashboardPage [as 别名]
# 或者: from common.test.acceptance.pages.lms.instructor_dashboard.InstructorDashboardPage import select_student_admin [as 别名]
#.........这里部分代码省略.........
self.courseware_page.go_to_lti_container()
self.assertEqual("This is LTI tool. Success.", self.lti_iframe.lti_content)
def test_lti_graded_component_for_staff(self):
"""
Scenario: Graded LTI component in LMS is correctly works for staff
Given the course has correct LTI credentials with registered Instructor
the course has an LTI component with correct fields:
verify scores on progress and grade book pages.
"""
metadata_advance_settings = "correct_lti_id:test_client_key:test_client_secret"
metadata_lti_xblock = {
'lti_id': 'correct_lti_id',
'launch_url': 'http://{}:{}/{}'.format(self.host, '8765', 'correct_lti_endpoint'),
'open_in_a_new_page': False,
'weight': 10,
'graded': True,
'has_score': True
}
expected_scores = [(5, 10)]
self.set_advance_settings(metadata_advance_settings)
self.create_lti_xblock(metadata_lti_xblock)
auto_auth(self.browser, self.USERNAME, self.EMAIL, True, self.course_id)
self.courseware_page.visit()
self.courseware_page.go_to_lti_container()
self.lti_iframe.submit_lti_answer('#submit-button')
self.assertIn("LTI consumer (edX) responded with XML content", self.lti_iframe.lti_content)
self.lti_iframe.switch_to_default()
self.tab_nav.go_to_tab('Progress')
actual_scores = self.progress_page.scores("Test Chapter", "Test Section")
self.assertEqual(actual_scores, expected_scores)
self.assertEqual(['Overall Score', 'Overall Score\n1%'], self.progress_page.graph_overall_score())
self.tab_nav.go_to_tab('Instructor')
student_admin_section = self.instructor_dashboard_page.select_student_admin(StudentAdminPage)
student_admin_section.click_grade_book_link()
self.assertEqual("50", self.grade_book_page.get_value_in_the_grade_book('Homework 1 - Test Section', 1))
self.assertEqual("1", self.grade_book_page.get_value_in_the_grade_book('Total', 1))
def test_lti_switch_role_works_correctly(self):
"""
Scenario: Graded LTI component in LMS role's masquerading correctly works
Given the course has correct LTI credentials with registered Instructor
the course has an LTI component with correct fields:
switch role from instructor to learner and verify that it works correctly
"""
metadata_advance_settings = "correct_lti_id:test_client_key:test_client_secret"
metadata_lti_xblock = {
'lti_id': 'correct_lti_id',
'launch_url': 'http://{}:{}/{}'.format(self.host, '8765', 'correct_lti_endpoint'),
'open_in_a_new_page': False,
'has_score': True
}
self.set_advance_settings(metadata_advance_settings)
self.create_lti_xblock(metadata_lti_xblock)
auto_auth(self.browser, self.USERNAME, self.EMAIL, True, self.course_id)
self.courseware_page.visit()
self.assertTrue(self.courseware_page.is_iframe_present())
self.assertFalse(self.courseware_page.is_launch_url_present())
self.assertFalse(self.courseware_page.is_error_message_present())
self.courseware_page.go_to_lti_container()
self.assertEqual("This is LTI tool. Success.", self.lti_iframe.lti_content)
self.assertEqual("Role: Instructor", self.lti_iframe.get_user_role)
self.lti_iframe.switch_to_default()
select_option_by_text(self.courseware_page.get_role_selector, 'Learner')
self.courseware_page.wait_for_ajax()
self.assertTrue(self.courseware_page.is_iframe_present())