예제 #1
0
    def testShouldCheckLibraryLabel(self, mozwebqa):
        #This test is to check the labels of a library on the dashboard
        #Create page objects
        homepage_obj = HomePage(mozwebqa)
        loginpage_obj = LoginPage(mozwebqa)
        dashboardpage_obj = DashboardPage(mozwebqa)
        libpage_obj = LibraryEditorPage(mozwebqa)

        loginpage_obj.login()

        #Create a library. Then go to dashboard and assert that the label is present.
        homepage_obj.go_to_home_page()
        homepage_obj.click_create_lib_btn()
        library_name = libpage_obj.library_name

        libpage_obj.header.click_dashboard()
        Assert.true(dashboardpage_obj.is_the_current_page)
        Assert.true(dashboardpage_obj.library(library_name).is_displayed, "Library %s not found" % library_name)

        #Click on the edit button of the library.Then create a copy of that library and assert that the label is 'copy'
        dashboardpage_obj.library(library_name).click_edit()
        libpage_obj.click_copy()
        copy_library_name = libpage_obj.library_name

        try:
            Assert.not_equal(library_name, copy_library_name)
        except:
            print 'A copy of the library could not be created'
        libpage_obj.header.click_dashboard()

        Assert.true(dashboardpage_obj.library(copy_library_name).is_displayed, "Library %s not found" % copy_library_name)
        
        dashboardpage_obj.delete_test_data()
예제 #2
0
    def test_search_by_library_name_returns_library(self, mozwebqa):
        homepage_obj = HomePage(mozwebqa)
        loginpage_obj = LoginPage(mozwebqa)
        dashboard_obj = DashboardPage(mozwebqa)
        librarypage_obj = LibraryEditorPage(mozwebqa)
        searchpage_obj = SearchPage(mozwebqa)

        homepage_obj.go_to_home_page()
        homepage_obj.header.click_signin()
        loginpage_obj.login()

        #create a new library with the valid criteria (version not initial)
        dashboard_obj.header.click_home_logo()
        homepage_obj.click_create_lib_btn()
        librarypage_obj.type_library_version('searchable')
        librarypage_obj.click_save()
        searchterm = librarypage_obj.library_name

        librarypage_obj.header.click_home_logo()
        homepage_obj.header.click_search()

        searchpage_obj.search_until_package_exists(searchterm, searchpage_obj.library(searchterm))
        Assert.true(searchpage_obj.library(searchterm).is_displayed, '%s not found before timeout' % searchterm)

        searchpage_obj.delete_test_data()
예제 #3
0
    def test_view_source_library(self, mozwebqa):
        #This test is to check viewing the source of a library while not logged in
        homepage_obj = HomePage(mozwebqa)
        searchpage_obj = SearchPage(mozwebqa)
        libraryeditor_obj = LibraryEditorPage(mozwebqa)

        #Go to search page and click view source on the first library listed
        homepage_obj.go_to_home_page()
        homepage_obj.header.click_search()
        
        searchpage_obj.library(1).click()
        
        Assert.true(libraryeditor_obj.tab(1).selected)
        Assert.not_none(libraryeditor_obj.tab(1).content)