def test_redirectToStationSiteAccordingToZipCode(self): homePage = HomePageSS(self.driver, self.wait) loginPage = homePage.clickLoginButton() loginPage.login("*****@*****.**", "Aetnaetn") time.sleep(3) redirectUrl = self.getAddressWithSubdomain("aetn") self.assertEquals(redirectUrl, self.driver.current_url, "URL not redirected when switching to station site")
def test_footer_links_point_to_correct_pages(self): homePage = HomePageSS(self.driver, self.wait) homePage.clickOnLink("Terms of Use") terms_of_use_link = self.driver.current_url homePage.clickOnLink("Privacy Policy") privacy_policy_link = self.driver.current_url self.assertEqual(terms_of_use_link, ServerRelated().serverToBeTested()+"help/terms-of-use/", "Terms of Use link doesn't point to correct page") self.assertEqual(privacy_policy_link, ServerRelated().serverToBeTested()+"help/privacy-policy/", "Privacy Policy link doesn't point to correct page")
def test_feature_well_plays_carousel(self): homePage = HomePageSS(self.driver, self.wait) activeSlide1 = homePage.getFeatureWellSlides()[0].get_attribute("class") inactiveSlide1 = homePage.getFeatureWellSlides()[1].get_attribute("class") time.sleep(9) #wait for carousel to switch slides inactiveSlide2 = homePage.getFeatureWellSlides()[0].get_attribute("class") activeSlide2 = homePage.getFeatureWellSlides()[1].get_attribute("class") self.assertEqual(activeSlide1, activeSlide2, "Slide not switched") self.assertEqual(inactiveSlide1, inactiveSlide2, "Slide not switched")
def test_display_of_station_module(self): moduleTitle = test_station_module_cms.title subhead = test_station_module_cms.subhead link = test_station_module_cms.link imageLink = test_station_module_cms.imageLink homePage = HomePageSS(self.driver, self.wait) self.assertTrue(homePage.station_module_exists_by_title(moduleTitle), "Module title is not the one set in CMS") self.assertEqual(homePage.get_stat_mod_subhead().text, subhead, "Subhead text is not the one set in CMS") self.assertTrue(link in homePage.get_stat_mod_subhead().get_attribute("href"), "Link is not the one set in CMS") self.assertEqual(homePage.get_stat_mod_image(), imageLink, "Displayed image is not the one defined in CMS")
def test_moveFavoritesToFolders(self): homePage = HomePageSS(self.driver, self.wait) homePage.searchByKeyword("test") searchResults = SearchResultsPageSS(self.driver, self.wait) searchResults.clickFavoriteStarForResult(1) searchResults.clickFavoriteStarForResult(2) searchResults.clickFavoriteStarForResult(3) searchResults.clickFavoriteStarForResult(4) favorited = MyFoldersPageView(self.driver, self.wait) favorited.clickToSelectAllButton() favorited.clickAddToFolderButton() favorited.selectFolder(folderNameClass) self.assertTrue(favorited.getFavoritesFromFolders(), "No Favorites saved to folder")
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_favoriteInSearchResults(self): homePage = HomePageSS(self.driver, self.wait) homePage.searchByKeyword("abc") resultsPage = SearchResultsPageSS(self.driver, self.wait) resultsPage.clickFavoriteStarForResult(1) time.sleep(2) self.driver.refresh() resultsPage = SearchResultsPageSS(self.driver, self.wait) self.assertTrue(resultsPage.isFavorited(1), "Favorite status (fav-ed) not recorded") resultsPage.clickFavoriteStarForResult(1) time.sleep(2) self.driver.refresh() resultsPage = SearchResultsPageSS(self.driver, self.wait) self.assertFalse(resultsPage.isFavorited(1), "Resource is marked as favorite, although it was removed from Favorites")
def test_userSeesLocalAndNationalContentFragments(self): homePage = HomePageSS(self.driver, self.wait) mainSiteContFragments = homePage.getContentFragmentsTitle() homePage.clickLoginButton().login("*****@*****.**", "Aetnaetn") stationSitePage = HomePageSS(self.driver, self.wait) stationSiteContFragments = stationSitePage.getContentFragmentsTitle() self.assertTrue(stationSitePage.sublistExistsInList(mainSiteContFragments, stationSiteContFragments), "Main site content fragments not included in Station Site visible content fragments")
def test_futureContentFragmentNotDisplayedInStationSite(self): self.driver.get(ServerRelated().serverToBeTested()) ssHomePage = HomePageSS(self.driver, self.wait) self.assertFalse(ssHomePage.contentFragmentExistsByTitle(self.fragmentTitle))
def test_user_admin_navigates_from_af_site_to_cms(self): homePage = HomePageSS(self.driver, self.wait) homePage.clickAdminLinkInNavigationBar() self.assertEqual(self.driver.current_url, ServerRelated().serverToBeTested()+"admin/", "Could not navigate from AF site to CMS via Admin link")
def test_clicking_signup_for_free_link_dispalyes_login_popup(self): homePage = HomePageSS(self.driver, self.wait) homePage.clickOnLink("Sign up for FREE") uuaLoginPage = UuaLoginPage(self.driver, self.wait) self.assertTrue(uuaLoginPage.uua_login_page_is_displayed(), "Login pop-up not displayed!")
def test_featureWellDisplaysCorrectly(self): homePage = HomePageSS(self.driver, self.wait) self.assertTrue(homePage.getFeatureWellTitle()!=None, "Feature well not present") self.assertTrue(len(homePage.getFeatureWellSlides()) > 0, "Feature well contains no slides")
def test_search_with_no_keyword_doesnt_crash(self): homePage = HomePageSS(self.driver, self.wait) homePage.searchByKeyword("") self.assertTrue(BasePageSS(self.driver, self.wait).isHeaderImageDisplayed(), "Crash when searching for a void keyword")
def initiateSearch(self, key): homePage = HomePageSS(self.driver, self.wait) homePage.searchByKeyword(key) resultsPage = SearchResultsPageSS(self.driver, self.wait) return resultsPage
def test_clicking_login_button_dispalyes_login_page(self): uuaLoginPage = HomePageSS(self.driver, self.wait).clickLoginButton() self.assertTrue(uuaLoginPage.uua_login_page_is_displayed(), "Login pop-up not displayed!")