def test_loggedinAsOrganizationAdminDefineOrganizationUser(self): self.login_to_cms_via_uua(orgAdminEmail, orgPass) dashboard = DashboardPageCMS(self.driver, self.wait) orgUsersPage = dashboard.selectCreateUser() fillUserForm(orgUsersPage, orgUserEmail) orgUsersPage.clickContentEditorRadio() orgUsersPage = orgUsersPage.clickSaveButtonAddUserForm() self.assertTrue(orgUsersPage.userExists(orgUserEmail), "User not added")
def test_organizationAdminCanRemoveOrganizationUser(self): self.login_to_cms_via_uua(orgAdminEmail, orgPass) dashboard = DashboardPageCMS(self.driver, self.wait) usersPage = dashboard.clickUsersLink() usersPage.clickCheckboxForItem(orgUserEmail, "noSearch") deletePage = usersPage.selectDeleteAction() deletePage.clickConfirmationButton() usersPage = OrganizationUsersPageCMS(self.driver, self.wait) usersPage = usersPage.showDeletedUsers() self.assertTrue(usersPage.userExists(orgUserEmail), "Organization user not deleted")
def test_stationAdminCanModifyStationModule(self): new_subhead = RandomGenerators().generateRandomString(10) self.login_to_cms_via_uua(email, password) dashboard = DashboardPageCMS(self.driver, self.wait) module = dashboard.clickModifyStationModule() module.clickEndOnTodayLink() module.typeSubhead(0, new_subhead) module.clickSave() self.driver.get(self.getAddressWithSubdomain("aetn")) ssHomePage = HomePageSS(self.driver, self.wait) ssHomePage.getContentFragmentContent() self.assertTrue(new_subhead in ssHomePage.getContentFragmentContent(), "Content fragment body not updated")
def test_uploadMediaFromDashboard(self): dashboard = DashboardPageCMS(self.driver, self.wait) dashboard.selectUploadMediaByText("Audio") self.assertTrue(self.wait.until(lambda driver : driver.find_element_by_xpath("//h1[text()='Add audio media']"))!=None, "Audio upload form not opened") dashboard = DashboardPageCMS(self.driver, self.wait) dashboard.selectUploadMediaByText("Video") self.assertTrue(self.wait.until(lambda driver : driver.find_element_by_xpath("//h1[text()='Add video media']"))!=None, "Video upload form not opened") dashboard = DashboardPageCMS(self.driver, self.wait) dashboard.selectUploadMediaByText("Image") self.assertTrue(self.wait.until(lambda driver : driver.find_element_by_xpath("//h1[text()='Add image media']"))!=None, "Image upload form not opened") dashboard = DashboardPageCMS(self.driver, self.wait) dashboard.selectUploadMediaByText("Document") self.assertTrue(self.wait.until(lambda driver : driver.find_element_by_xpath("//h1[text()='Add document media']"))!=None, "Document upload form not opened")
def test_loggedinAsOrganizationUserSeeOnlyOrganizationContentProjects(self): self.login_to_cms_via_uua(orgUserEmail, orgPass) dashboard = DashboardPageCMS(self.driver, self.wait) self.assertEquals(dashboard.getNumberOfVisibleContentProjects(), 2, "User doesn't see only 2 content projects, as he is supposed to.")
def test_stationAdminSeesStationSiteMenuAndNoContentProjects(self): self.login_to_cms_via_uua(email, password) dashboard = DashboardPageCMS(self.driver, self.wait) self.assertTrue(dashboard.elementExistsByLinkText("Modify Site Design"), "Modify Site Design link not displayed") self.assertTrue(dashboard.elementExistsByLinkText("Modify Station Module"), "Modify Station Module link not displayed") self.assertFalse(dashboard.elementExistsByXpath("//li[contains(text(), 'Content Projects')]"), "Content Projects section is displayed and should not be")
def test_items_imported_from_csv(self): dashboard = DashboardPageCMS(self.driver, self.wait) self.assertTrue("HeatherBrooke_2012G" in dashboard.getTitlesFromDashboard(), "Media not uploaded from CSV") self.assertTrue("TED: Heather Brooke: My Battle to expose government corruption." in dashboard.getTitlesFromDashboard(), "Asset not uploaded from CSV")