当前位置: 首页>>代码示例>>Python>>正文


Python InstructorDashboardPage.select_student_admin方法代码示例

本文整理汇总了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())
开发者ID:jolyonb,项目名称:edx-platform,代码行数:70,代码来源:test_lms_lti.py


注:本文中的common.test.acceptance.pages.lms.instructor_dashboard.InstructorDashboardPage.select_student_admin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。