def setUp(self):
     """
     Ensure a library exists and navigate to the library edit page.
     """
     super(TestLibraryExport, self).setUp()
     self.export_page = ExportLibraryPage(self.browser, self.library_key)
     self.export_page.visit()
示例#2
0
 def setUp(self):
     """
     Set up the pages and start the tests.
     """
     super(TestLibraryBadExport, self).setUp()
     self.export_page = ExportLibraryPage(self.browser, self.library_key)
     self.edit_page = LibraryEditPage(self.browser, self.library_key)
     self.export_page.visit()
class LibraryExportHelpTest(StudioLibraryTest):
    """
    Test help links on a Library export pages.
    """
    def setUp(self):
        super(LibraryExportHelpTest, self).setUp()
        self.library_export_page = ExportLibraryPage(self.browser,
                                                     self.library_key)
        self.library_export_page.visit()

    @skip(
        "Disabled as edx.org help links are now different than Open edX (@catong can advise)"
    )
    def test_library_export_nav_help(self):
        """
        Scenario: Help link in navigation bar is working on Library export page.
        Given that I am on the Library export page.
        And I want help about the process
        And I click the 'Help' in the navigation bar
        Then Help link should open.
        And help url should be correct
        """
        expected_url = _get_expected_documentation_url(
            '/course_components/libraries.html#export-a-library')

        # Assert that help link is correct.
        assert_nav_help_link(test=self,
                             page=self.library_export_page,
                             href=expected_url)

    @skip(
        "Disabled as edx.org help links are now different than Open edX (@catong can advise)"
    )
    def test_library_export_side_bar_help(self):
        """
        Scenario: Help link in sidebar links is working on Library export page.
        Given that I am on the Library export page.
        And I want help about the process
        And I click the 'Learn more about exporting a library' in the sidebar links
        Then Help link should open.
        And help url should be correct
        """
        expected_url = _get_expected_documentation_url(
            '/course_components/libraries.html#export-a-library')

        # Assert that help link is correct.
        assert_side_bar_help_link(
            test=self,
            page=self.library_export_page,
            href=expected_url,
            help_text='Learn more about exporting a library')
class LibraryExportHelpTest(StudioLibraryTest):
    """
    Test help links on a Library export pages.
    """
    def setUp(self):
        super(LibraryExportHelpTest, self).setUp()
        self.library_export_page = ExportLibraryPage(self.browser, self.library_key)
        self.library_export_page.visit()

    def test_library_export_nav_help(self):
        """
        Scenario: Help link in navigation bar is working on Library export page.
        Given that I am on the Library export page.
        And I want help about the process
        And I click the 'Help' in the navigation bar
        Then Help link should open.
        And help url should end with 'creating_content/libraries.html#export-a-library'
        """
        # The href we want to see in anchor help element.
        href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' \
               'open-release-ficus.master/course_components/libraries.html#export-a-library'

        # Assert that help link is correct.
        assert_nav_help_link(
            test=self,
            page=self.library_export_page,
            href=href
        )

    def test_library_export_side_bar_help(self):
        """
        Scenario: Help link in sidebar links is working on Library export page.
        Given that I am on the Library export page.
        And I want help about the process
        And I click the 'Learn more about exporting a library' in the sidebar links
        Then Help link should open.
        And help url should end with 'creating_content/libraries.html#export-a-library'
        """
        # The href we want to see in anchor help element.
        href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' \
               'open-release-ficus.master/course_components/libraries.html#export-a-library'

        # Assert that help link is correct.
        assert_side_bar_help_link(
            test=self,
            page=self.library_export_page,
            href=href,
            help_text='Learn more about exporting a library'
        )
 def setUp(self):
     """
     Ensure a library exists and navigate to the library edit page.
     """
     super(TestLibraryExport, self).setUp()
     self.export_page = ExportLibraryPage(self.browser, self.library_key)
     self.export_page.visit()
示例#6
0
class LibraryExportHelpTest(StudioLibraryTest):
    """
    Test help links on a Library export pages.
    """
    def setUp(self):
        super(LibraryExportHelpTest, self).setUp()
        self.library_export_page = ExportLibraryPage(self.browser,
                                                     self.library_key)
        self.library_export_page.visit()

    def test_library_export_nav_help(self):
        """
        Scenario: Help link in navigation bar is working on Library export page.
        Given that I am on the Library export page.
        And I want help about the process
        And I click the 'Help' in the navigation bar
        Then Help link should open.
        And help url should end with 'creating_content/libraries.html#export-a-library'
        """
        # The href we want to see in anchor help element.
        href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' \
               'latest/course_components/libraries.html#export-a-library'

        # Assert that help link is correct.
        assert_nav_help_link(test=self,
                             page=self.library_export_page,
                             href=href)

    def test_library_export_side_bar_help(self):
        """
        Scenario: Help link in sidebar links is working on Library export page.
        Given that I am on the Library export page.
        And I want help about the process
        And I click the 'Learn more about exporting a library' in the sidebar links
        Then Help link should open.
        And help url should end with 'creating_content/libraries.html#export-a-library'
        """
        # The href we want to see in anchor help element.
        href = 'http://edx.readthedocs.io/projects/open-edx-building-and-running-a-course/en/' \
               'latest/course_components/libraries.html#export-a-library'

        # Assert that help link is correct.
        assert_side_bar_help_link(
            test=self,
            page=self.library_export_page,
            href=href,
            help_text='Learn more about exporting a library')
示例#7
0
class LibraryExportHelpTest(StudioLibraryTest):
    """
    Test help links on a Library export pages.
    """
    def setUp(self):
        super(LibraryExportHelpTest, self).setUp()
        self.library_export_page = ExportLibraryPage(self.browser, self.library_key)
        self.library_export_page.visit()

    def test_library_export_nav_help(self):
        """
        Scenario: Help link in navigation bar is working on Library export page.
        Given that I am on the Library export page.
        And I want help about the process
        And I click the 'Help' in the navigation bar
        Then Help link should open.
        And help url should be correct
        """
        expected_url = _get_expected_documentation_url('/course_components/libraries.html#export-a-library')

        # Assert that help link is correct.
        assert_nav_help_link(
            test=self,
            page=self.library_export_page,
            href=expected_url
        )

    def test_library_export_side_bar_help(self):
        """
        Scenario: Help link in sidebar links is working on Library export page.
        Given that I am on the Library export page.
        And I want help about the process
        And I click the 'Learn more about exporting a library' in the sidebar links
        Then Help link should open.
        And help url should be correct
        """
        expected_url = _get_expected_documentation_url('/course_components/libraries.html#export-a-library')

        # Assert that help link is correct.
        assert_side_bar_help_link(
            test=self,
            page=self.library_export_page,
            href=expected_url,
            help_text='Learn more about exporting a library'
        )
示例#8
0
class TestLibraryBadExport(BadExportMixin, StudioLibraryTest):
    """
    Verify exporting a bad library causes an error.
    """

    def setUp(self):
        """
        Set up the pages and start the tests.
        """
        super(TestLibraryBadExport, self).setUp()
        self.export_page = ExportLibraryPage(self.browser, self.library_key)
        self.edit_page = LibraryEditPage(self.browser, self.library_key)
        self.export_page.visit()

    def populate_library_fixture(self, library_fixture):
        """
        Create a library with a bad component.
        """
        library_fixture.add_children(XBlockFixtureDesc("problem", "Bad Problem", data="<"))
示例#9
0
class TestLibraryBadExport(BadExportMixin, StudioLibraryTest):
    """
    Verify exporting a bad library causes an error.
    """
    def setUp(self):
        """
        Set up the pages and start the tests.
        """
        super(TestLibraryBadExport, self).setUp()
        self.export_page = ExportLibraryPage(self.browser, self.library_key)
        self.edit_page = LibraryEditPage(self.browser, self.library_key)
        self.export_page.visit()

    def populate_library_fixture(self, library_fixture):
        """
        Create a library with a bad component.
        """
        library_fixture.add_children(
            XBlockFixtureDesc("problem", "Bad Problem", data='<'), )
示例#10
0
class TestLibraryExport(ExportTestMixin, StudioLibraryTest):
    """
    Export tests for libraries.
    """
    def setUp(self):
        """
        Ensure a library exists and navigate to the library edit page.
        """
        super(TestLibraryExport, self).setUp()
        self.export_page = ExportLibraryPage(self.browser, self.library_key)
        self.export_page.visit()

    def test_header(self):
        """
        Scenario: I should see the correct text when exporting a library.
            Given that I have a library to export from
            When I visit the export page
            The correct header should be shown
        """
        self.assertEqual(self.export_page.header_text, 'Library Export')
class TestLibraryExport(ExportTestMixin, StudioLibraryTest):
    """
    Export tests for libraries.
    """
    def setUp(self):
        """
        Ensure a library exists and navigate to the library edit page.
        """
        super(TestLibraryExport, self).setUp()
        self.export_page = ExportLibraryPage(self.browser, self.library_key)
        self.export_page.visit()

    def test_header(self):
        """
        Scenario: I should see the correct text when exporting a library.
            Given that I have a library to export from
            When I visit the export page
            The correct header should be shown
        """
        self.assertEqual(self.export_page.header_text, 'Library Export')
示例#12
0
 def setUp(self):
     super(LibraryExportHelpTest, self).setUp()
     self.library_export_page = ExportLibraryPage(self.browser,
                                                  self.library_key)
     self.library_export_page.visit()
示例#13
0
 def setUp(self):
     super(LibraryExportHelpTest, self).setUp()
     self.library_export_page = ExportLibraryPage(self.browser, self.library_key)
     self.library_export_page.visit()