Ejemplo n.º 1
0
    def test_course_rerun(self):
        """
        Scenario: Courses can be rerun
            Given I have a course with a section, subsesction, vertical, and html component with content 'Test Content'
            When I visit the course rerun page
            And I type 'test_rerun' in the course run field
            And I click Create Rerun
            And I visit the course listing page
            And I wait for all courses to finish processing
            And I click on the course with run 'test_rerun'
            Then I see a rerun notification on the course outline page
            And when I click 'Dismiss' on the notification
            Then I do not see a rerun notification
            And when I expand the subsection and click on the unit
            And I click 'View Live Version'
            Then I see one html component with the content 'Test Content'
        """
        course_info = (self.course_info['org'], self.course_info['number'],
                       self.course_info['run'])
        updated_course_info = course_info[0] + "+" + course_info[
            1] + "+" + course_info[2]

        self.dashboard_page.visit()
        self.dashboard_page.scroll_to_course(course_info[1])
        self.dashboard_page.create_rerun(updated_course_info)

        rerun_page = CourseRerunPage(self.browser, *course_info)
        rerun_page.wait_for_page()
        course_run = 'test_rerun_' + str(random.randrange(1000000, 9999999))
        rerun_page.course_run = course_run
        rerun_page.create_rerun()

        def finished_processing():
            self.dashboard_page.visit()
            return not self.dashboard_page.has_processing_courses

        EmptyPromise(finished_processing,
                     "Rerun finished processing",
                     try_interval=5,
                     timeout=60).fulfill()

        assert course_run in self.dashboard_page.course_runs
        self.dashboard_page.click_course_run(course_run)

        outline_page = CourseOutlinePage(self.browser, *course_info)
        outline_page.wait_for_page()
        self.assertTrue(outline_page.has_rerun_notification)

        outline_page.dismiss_rerun_notification()
        EmptyPromise(lambda: not outline_page.has_rerun_notification,
                     "Rerun notification dismissed").fulfill()

        subsection = outline_page.section(self.SECTION_NAME).subsection(
            self.SUBSECITON_NAME)
        subsection.expand_subsection()
        unit_page = subsection.unit(self.UNIT_NAME).go_to()

        unit_page.view_published_version()
        courseware = CoursewarePage(self.browser, self.course_id)
        courseware.wait_for_page()
        self.assertEqual(courseware.num_xblock_components, 1)
        self.assertEqual(courseware.xblock_component_html_content(),
                         self.COMPONENT_CONTENT)
Ejemplo n.º 2
0
    def setUp(self):
        super(ConditionalTest, self).setUp()

        self.courseware_page = CoursewarePage(self.browser, self.course_id)
        AutoAuthPage(self.browser, course_id=self.course_id,
                     staff=False).visit()
Ejemplo n.º 3
0
    def setUp(self):
        super(CoursewareMultipleVerticalsTest, self).setUp()

        self.courseware_page = CoursewarePage(self.browser, self.course_id)

        self.course_outline = CourseOutlinePage(self.browser,
                                                self.course_info['org'],
                                                self.course_info['number'],
                                                self.course_info['run'])

        # Install a course with sections/problems, tabs, updates, and handouts
        course_fix = CourseFixture(self.course_info['org'],
                                   self.course_info['number'],
                                   self.course_info['run'],
                                   self.course_info['display_name'])

        course_fix.add_children(
            XBlockFixtureDesc('chapter', 'Test Section 1').add_children(
                XBlockFixtureDesc(
                    'sequential', 'Test Subsection 1,1').add_children(
                        XBlockFixtureDesc(
                            'problem',
                            'Test Problem 1',
                            data='<problem>problem 1 dummy body</problem>'),
                        XBlockFixtureDesc(
                            'html',
                            'html 1',
                            data="<html>html 1 dummy body</html>"),
                        XBlockFixtureDesc(
                            'problem',
                            'Test Problem 2',
                            data="<problem>problem 2 dummy body</problem>"),
                        XBlockFixtureDesc(
                            'html',
                            'html 2',
                            data="<html>html 2 dummy body</html>"),
                    ),
                XBlockFixtureDesc(
                    'sequential', 'Test Subsection 1,2').add_children(
                        XBlockFixtureDesc(
                            'problem',
                            'Test Problem 3',
                            data='<problem>problem 3 dummy body</problem>'), ),
                XBlockFixtureDesc(
                    'sequential',
                    'Test HIDDEN Subsection',
                    metadata={
                        'visible_to_staff_only': True
                    }).add_children(
                        XBlockFixtureDesc(
                            'problem',
                            'Test HIDDEN Problem',
                            data='<problem>hidden problem</problem>'), ),
            ),
            XBlockFixtureDesc('chapter', 'Test Section 2').add_children(
                XBlockFixtureDesc(
                    'sequential', 'Test Subsection 2,1').add_children(
                        XBlockFixtureDesc(
                            'problem',
                            'Test Problem 4',
                            data='<problem>problem 4 dummy body</problem>'), ),
            ),
            XBlockFixtureDesc(
                'chapter',
                'Test HIDDEN Section',
                metadata={
                    'visible_to_staff_only': True
                }).add_children(
                    XBlockFixtureDesc('sequential',
                                      'Test HIDDEN Subsection'), ),
        ).install()

        # Auto-auth register for the course.
        AutoAuthPage(self.browser,
                     username=self.USERNAME,
                     email=self.EMAIL,
                     course_id=self.course_id,
                     staff=False).visit()
        self.courseware_page.visit()
        self.course_nav = CourseNavPage(self.browser)
    def setUp(self):
        super(CertificateProgressPageTest, self).setUp()

        # set same course number as we have in fixture json
        self.course_info['number'] = "3355358979513794782079645765720179311111"

        test_certificate_config = {
            'id': 1,
            'name': 'Certificate name',
            'description': 'Certificate description',
            'course_title': 'Course title override',
            'signatories': [],
            'version': 1,
            'is_active': True
        }
        course_settings = {'certificates': test_certificate_config}

        self.course_fixture = CourseFixture(self.course_info["org"],
                                            self.course_info["number"],
                                            self.course_info["run"],
                                            self.course_info["display_name"],
                                            settings=course_settings)

        self.course_fixture.add_advanced_settings({
            "cert_html_view_enabled": {
                "value": "true"
            },
            "certificates_show_before_end": {
                "value": "true"
            }
        })

        self.course_fixture.add_update(
            CourseUpdateDesc(date='January 29, 2014',
                             content='Test course update1'))

        self.course_fixture.add_children(
            XBlockFixtureDesc('static_tab', 'Test Static Tab'),
            XBlockFixtureDesc('chapter', 'Test Section').add_children(
                XBlockFixtureDesc(
                    'sequential', 'Test Subsection',
                    grader_type='Final Exam').add_children(
                        XBlockFixtureDesc(
                            'problem',
                            'Test Problem 1',
                            data=load_data_str('multiple_choice.xml')),
                        XBlockFixtureDesc('html', 'Test HTML'),
                    )),
            XBlockFixtureDesc('chapter', 'Test Section 2').add_children(
                XBlockFixtureDesc(
                    'sequential',
                    'Test Subsection 2',
                    grader_type='Midterm Exam').add_children(
                        XBlockFixtureDesc(
                            'problem',
                            'Test Problem 2',
                            data=load_data_str('formula_problem.xml')), )))

        self.course_fixture.install()
        self.user_id = "99"  # we have created a user with this id in fixture
        self.cert_fixture = CertificateConfigFixture(self.course_id,
                                                     test_certificate_config)

        self.progress_page = ProgressPage(self.browser, self.course_id)
        self.courseware_page = CoursewarePage(self.browser, self.course_id)
        self.course_home_page = CourseHomePage(self.browser, self.course_id)
        self.tab_nav = TabNavPage(self.browser)
 def setup_thread_page(self, thread_id):
     CoursewarePage(self.browser, self.course_id).visit()
     self.show_thread(thread_id)
 def test_visit_coursware(self):
     """
     Produce a HAR for loading the Coursware page.
     """
     courseware_page = CoursewarePage(self.browser, self.course_id)
     self._make_har_file(courseware_page)
Ejemplo n.º 7
0
 def __init__(self, browser, parent_page):
     super(CourseOutlinePage, self).__init__(browser)
     self.parent_page = parent_page
     self.courseware_page = CoursewarePage(self.browser,
                                           self.parent_page.course_id)