def testShouldCheckAddonLabel(self, mozwebqa):
        #This test is to check the labels of an add-on on the dashboard
        #Create page objects
        homepage_obj = HomePage(mozwebqa)
        loginpage_obj = LoginPage(mozwebqa)
        dashboardpage_obj = DashboardPage(mozwebqa)
        addonpage_obj = AddonEditorPage(mozwebqa)

        loginpage_obj.login()

        #Create an addon. Then go to dashboard and assert that the label is 'initial'.
        homepage_obj.go_to_home_page()
        homepage_obj.click_create_addon_btn()
        addon_name = addonpage_obj.addon_name

        homepage_obj.header.click_dashboard()
        Assert.true(dashboardpage_obj.is_the_current_page)
        Assert.true(dashboardpage_obj.addon(addon_name).is_displayed, "Addon %s not found" % addon_name)

        #Click on the edit button of the addon.Then create a copy of that addon and assert that the label is 'copy'
        dashboardpage_obj.addon(addon_name).click_edit()
        addonpage_obj.click_copy()
        copy_addon_name = addonpage_obj.addon_name

        try:
            Assert.not_equal(addon_name, copy_addon_name)
        except:
            print 'A copy of the addon could not be created'
        homepage_obj.header.click_dashboard()
        Assert.true(dashboardpage_obj.addon(copy_addon_name).is_displayed, "Addon %s not found" % copy_addon_name)

        dashboardpage_obj.delete_test_data()
    def testShouldCheckAddonDeactivateAndActivate(self, mozwebqa):
        homepage_obj = HomePage(mozwebqa)
        loginpage_obj = LoginPage(mozwebqa)
        dashboardpage_obj = DashboardPage(mozwebqa)
        addonpage_obj = AddonEditorPage(mozwebqa)

        homepage_obj.go_to_home_page()
        homepage_obj.header.click_signin()
        loginpage_obj.login()
        Assert.true(dashboardpage_obj.is_the_current_page)

        # Go back to homepage and create a new addon to work with.
        dashboardpage_obj.header.click_home_logo()
        homepage_obj.click_create_addon_btn()
        addon_name = addonpage_obj.addon_name
        addonpage_obj.header.click_dashboard()

        #Click on the private button to make it private and then check that the addon is not in the list anymore
        dashboardpage_obj.addon(addon_name).click_private()
        Assert.false(dashboardpage_obj.addon(addon_name).is_displayed, "Addon %s found" % addon_name)

        #Go to the private addons page and check that the addon that you just made private is present there.
        #Click on public to make it public and check on the dashboard that the addon is present there.
        dashboardpage_obj.click_private_addons_link()
        Assert.true(dashboardpage_obj.addon(addon_name).is_displayed, "Addon %s not found" % addon_name)

        # Switch it back to public now, addon should disappear
        dashboardpage_obj.addon(addon_name).click_public()
        Assert.false(dashboardpage_obj.addon(addon_name).is_displayed, "Addon %s found" % addon_name)

        # Should be on main dashboard page
        dashboardpage_obj.header.click_dashboard()
        Assert.true(dashboardpage_obj.addon(addon_name).is_displayed, "Addon %s not found" % addon_name)

        dashboardpage_obj.delete_test_data()
    def testShouldCheckLibDeactivateAndActivate(self, mozwebqa):
        homepage_obj = HomePage(mozwebqa)
        loginpage_obj = LoginPage(mozwebqa)
        dashboardpage_obj = DashboardPage(mozwebqa)
        librarypage_obj = LibraryEditorPage(mozwebqa)

        homepage_obj.go_to_home_page()
        homepage_obj.header.click_signin()
        loginpage_obj.login()
        Assert.true(dashboardpage_obj.is_the_current_page)

        # go back to homepage, create a new library to work with
        dashboardpage_obj.header.click_home_logo()
        homepage_obj.click_create_lib_btn()
        library_name = librarypage_obj.library_name
        librarypage_obj.header.click_dashboard()

        #Click on the private button to make it private and then check that the library is not in the list anymore
        dashboardpage_obj.library(library_name).click_private()
        Assert.false(dashboardpage_obj.library(library_name).is_displayed, "Library %s found" % library_name)

        #Go to the private libraries page and check that the library that you just made private is present there.
        #Click on public to make it public and check on the dashboard that the library is present there.
        dashboardpage_obj.click_private_libraries_link()
        Assert.true(dashboardpage_obj.library(library_name).is_displayed, "Library %s not found" % library_name)

        # Switch it back to public - it should disappaer
        dashboardpage_obj.library(library_name).click_public()
        Assert.false(dashboardpage_obj.library(library_name).is_displayed, "Library %s found" % library_name)

        # Go to main dashboard, should be present
        dashboardpage_obj.header.click_dashboard()
        Assert.true(dashboardpage_obj.library(library_name).is_displayed, "Library %s not found" % library_name)

        dashboardpage_obj.delete_test_data()
    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()