Exemplo n.º 1
0
    def test_word_cloud_advanced_component(self):
        """
        Verifies that user can add Word Cloud component on Studio and LMS
        """
        section_name = 'Section :{}'.format(uuid4().hex)
        self.studio_course_outline.add_section_with_name(section_name)
        self.assertIn(
            section_name,
            self.studio_course_outline.q(css='.incontext-editor-value').text)

        subsection_name = 'Subsection :{}'.format(uuid4().hex)
        self.studio_course_outline.add_subsection_with_name(subsection_name)
        self.assertIn(
            subsection_name,
            self.studio_course_outline.q(css='.incontext-editor-value').text)

        self.studio_course_outline.click_add_unit_button()
        self.unit_container_page.wait_for_page()

        self.unit_container_page.add_word_cloud_component(True)
        word_cloud_data_locator = get_data_locator(self.unit_container_page)

        # Publish Unit
        self.studio_course_outline.publish()

        # View Live
        self.unit_container_page.view_live_version()
        self.lms_courseware.wait_for_page()
        self.assertEqual(word_cloud_data_locator,
                         get_data_locator(self.lms_courseware))
        # Remove the added section
        self.studio_course_outline.visit()
        self.studio_course_outline.delete_section()
Exemplo n.º 2
0
 def test_unit_studio_view(self):
     """
     Scenario: To test studio view of component from LMS
     Given that I am at the LMS side of the edX.
     And I open a component
     And I click on the 'View unit in Studio' button
     Then correct component should open.
     """
     section_name = 'Section :{}'.format(uuid4().hex)
     subsection_name = 'Subsection :{}'.format(uuid4().hex)
     # Add a section.
     self.studio_course_outline.add_section_with_name(section_name)
     # Add a subsection.
     self.studio_course_outline.add_subsection_with_name(subsection_name)
     # Add a unit ( In this case Word Cloud Advance component) and publish.
     self.studio_course_outline.click_add_unit_button()
     self.unit_container_page.wait_for_page()
     self.unit_container_page.add_word_cloud_component(True)
     # Get unique data locator id of the unit added).
     data_locator = get_data_locator(self.unit_container_page)
     self.lms_courseware.visit()
     self.lms_courseware.go_to_section(section_name, subsection_name)
     # View unit in the studio
     self.lms_courseware.view_unit_in_studio()
     self.unit_container_page.wait_for_page()
     # Correct unit component should open.
     self.assertEqual(
         get_data_locator(self.unit_container_page),
         data_locator, 'Correct component is opened'
     )
     # Remove the added section
     self.studio_course_outline.visit()
     self.studio_course_outline.delete_section()
Exemplo n.º 3
0
 def test_unit_studio_view(self):
     """
     Scenario: To test studio view of component from LMS
     Given that I am at the LMS side of the edX.
     And I open a component
     And I click on the 'View unit in Studio' button
     Then correct component should open.
     """
     section_name = 'Section :{}'.format(uuid4().hex)
     subsection_name = 'Subsection :{}'.format(uuid4().hex)
     # Add a section.
     self.studio_course_outline.add_section_with_name(section_name)
     # Add a subsection.
     self.studio_course_outline.add_subsection_with_name(subsection_name)
     # Add a unit ( In this case Word Cloud Advance component) and publish.
     self.studio_course_outline.click_add_unit_button()
     self.unit_container_page.wait_for_page()
     self.unit_container_page.add_word_cloud_component(True)
     # Get unique data locator id of the unit added).
     data_locator = get_data_locator(self.unit_container_page)
     self.lms_courseware.visit()
     self.lms_courseware.go_to_section(section_name, subsection_name)
     # View unit in the studio
     self.lms_courseware.view_unit_in_studio()
     self.unit_container_page.wait_for_page()
     # Correct unit component should open.
     self.assertEqual(get_data_locator(self.unit_container_page),
                      data_locator, 'Correct component is opened')
     # Remove the added section
     self.studio_course_outline.visit()
     self.studio_course_outline.delete_section()
Exemplo n.º 4
0
    def test_word_cloud_advanced_component(self):
        """
        Verifies that user can add Word Cloud component on Studio and LMS
        """
        section_name = 'Section :{}'.format(uuid4().hex)
        self.studio_course_outline.add_section_with_name(section_name)
        self.assertIn(
            section_name,
            self.studio_course_outline.q(
                css='.incontext-editor-value'
            ).text
        )

        subsection_name = 'Subsection :{}'.format(uuid4().hex)
        self.studio_course_outline.add_subsection_with_name(
            subsection_name
        )
        self.assertIn(
            subsection_name,
            self.studio_course_outline.q(
                css='.incontext-editor-value'
            ).text
        )

        self.studio_course_outline.click_add_unit_button()
        self.unit_container_page.wait_for_page()

        self.unit_container_page.add_word_cloud_component(True)
        word_cloud_data_locator = get_data_locator(
            self.unit_container_page
        )

        # View Live
        self.unit_container_page.view_live_version()
        self.lms_courseware.wait_for_page()
        self.assertEqual(
            word_cloud_data_locator,
            get_data_locator(self.lms_courseware)
        )
        # Remove the added section
        self.studio_course_outline.visit()
        self.studio_course_outline.delete_section()