Exemplo n.º 1
0
    def test_create_library(self):
        """
        From the home page:
            Click "New Library"
            Fill out the form
            Submit the form
            We should be redirected to the edit view for the library
            Return to the home page
            The newly created library should now appear in the list of libraries
        """
        unique_suffix = uuid4().hex[:4]
        name = "New Library Name " + unique_suffix
        org = "TestOrgX" + unique_suffix
        number = "TESTLIB_" + unique_suffix

        self.auth_page.visit()
        self.dashboard_page.visit()
        self.assertFalse(
            self.dashboard_page.has_library(name=name, org=org, number=number))
        self.assertTrue(self.dashboard_page.has_new_library_button())

        self.dashboard_page.click_new_library()
        self.assertTrue(self.dashboard_page.is_new_library_form_visible())
        self.dashboard_page.fill_new_library_form(name, org, number)
        self.assertTrue(self.dashboard_page.is_new_library_form_valid())
        self.dashboard_page.submit_new_library_form()

        # The next page is the library edit view; make sure it loads:
        lib_page = LibraryEditPage(self.browser, LibraryLocator(org, number))
        lib_page.wait_for_page()

        # Then go back to the home page and make sure the new library is listed there:
        self.dashboard_page.visit()
        self.assertTrue(
            self.dashboard_page.has_library(name=name, org=org, number=number))
Exemplo n.º 2
0
 def setUp(self):
     """
     Ensure a library exists and navigate to the library edit page.
     """
     super(LibraryEditPageTest, self).setUp()
     self.lib_page = LibraryEditPage(self.browser, self.library_key)
     self.lib_page.visit()
     self.lib_page.wait_until_ready()
Exemplo n.º 3
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()
Exemplo n.º 4
0
    def test_lib_edit_page_a11y(self):
        """
        Check accessibility of LibraryEditPage.
        """
        lib_page = LibraryEditPage(self.browser, self.library_key)
        lib_page.visit()
        lib_page.wait_until_ready()

        lib_page.a11y_audit.config.set_rules({
            "ignore": [
                'link-href',  # TODO: AC-590
            ],
        })

        lib_page.a11y_audit.check_for_accessibility_errors()
Exemplo n.º 5
0
    def test_lib_edit_page_a11y(self):
        """
        Check accessibility of LibraryEditPage.
        """
        lib_page = LibraryEditPage(self.browser, self.library_key)
        lib_page.visit()
        lib_page.wait_until_ready()

        # There are several existing color contrast errors on this page,
        # we will ignore this error in the test until we fix them.
        lib_page.a11y_audit.config.set_rules({
            "ignore": [
                'link-href',  # TODO: AC-226
                'icon-aria-hidden',  # TODO: AC-229
            ],
        })

        lib_page.a11y_audit.check_for_accessibility_errors()
Exemplo n.º 6
0
    def test_lib_edit_page_a11y(self):
        """
        Check accessibility of LibraryEditPage.
        """
        lib_page = LibraryEditPage(self.browser, self.library_key)
        lib_page.visit()
        lib_page.wait_until_ready()

        lib_page.a11y_audit.config.set_rules({
            "ignore": [
                'link-href',  # TODO: AC-590
                'duplicate-id-aria',  # TODO: AC-940
                'heading-order',  # TODO: AC-933
                'landmark-complementary-is-top-level',  # TODO: AC-939
                'region'  # TODO: AC-932
            ],
        })

        lib_page.a11y_audit.check_for_accessibility_errors()