public void TC005_VerifyViewAdFunctionality(String Bname) { TestFixtureSetUp(Bname, "TC005-Verify View Ad Functionality."); try { loginPage.navigateToLoginPage().VerifyLoginPageScreenInDetail(); loginPage.loginUsingValidEmailIdAndPassword(); homePage.newVerifyHomePage(); homePage.VerifyAccountOrSwitchIfRequired("QA Testing - Brand"); carousels.VerifyCarousels(); carousels.clickButtonOnCarousel("View Ad"); carousels.VerifyViewAdFunctionality(); } catch (Exception e) { Logging.LogStop(this.driver, test, e, MethodBase.GetCurrentMethod(), Bname + "_TestSuite03_Reskin_Carousels_TC005"); throw; } driver.Quit(); }
///<summary> ///Verify Occurrences Functionality ///</summary> ///<param name="popupVisible">Popup should be visible or not</param> ///<returns></returns> public ViewAdPopup VerifyOccurrencesFunctionality(bool popupVisible = true) { if (popupVisible) { carousels.clickButtonOnCarousel("Occurrences"); string tabs = "View Ad,Occurrences,More Details"; Assert.IsTrue(driver._waitForElement("xpath", "//div[@class='modal-content']"), "Creative Details Popup not present"); Assert.IsTrue(driver._isElementPresent("xpath", "//div[@class='modal-body pb-0']//h4"), "Creative Details Popup header not present"); Assert.IsTrue(driver._getText("xpath", "//div[@class='modal-body pb-0']//h4").Contains("Creative Details for "), "Creative Details Popup header text does not match"); Assert.IsTrue(driver._waitForElement("xpath", "//div[@class='modal-body pb-0']//cft-table"), "Table not present"); Assert.IsTrue(driver._waitForElement("xpath", "//div[@class='modal-body pb-0']//div[@class='ag-header-row']/div"), "Row headers not present in Table"); Assert.IsTrue(driver._waitForElement("xpath", "//div[@class='modal-body pb-0']//div[@class='ag-body-container']/div"), "Row Values not present in Table"); Assert.IsTrue(driver._isElementPresent("xpath", "//cft-domain-item-modal-footer//button[text()=' Download Asset ']"), "'Download Asset' button not present on Creative Details Popup"); Assert.IsTrue(driver._isElementPresent("xpath", "//cft-domain-item-modal-footer//button[text()='Close']"), "'Close' button not present on Creative Details Popup"); Assert.IsTrue(driver._isElementPresent("xpath", "//div[@class='modal-body pb-0']//a[not(contains(@class, 'ng-hide'))]"), "'Tabs' not present on Creative Details Popup"); IList <IWebElement> tabCollection = driver._findElements("xpath", "//div[@class='modal-body pb-0']//a[not(contains(@class, 'ng-hide'))]"); string[] tabNames = tabs.Split(','); foreach (string tabName in tabNames) { bool avail = false; foreach (IWebElement tab in tabCollection) { if (tab.Text.ToLower().Contains(tabName.ToLower())) { avail = true; break; } } Assert.IsTrue(avail, "'" + tabName + "' not found on Creative Details Popup"); } } else { Assert.IsTrue(driver._waitForElementToBeHidden("xpath", "//div[@class='modal-content']"), "Creative Details Popup is still present"); } Results.WriteStatus(test, "Pass", "Verified, Occurrences Functionality"); return(new ViewAdPopup(driver, test)); }
public void TC002_VerifyOnClickingTheViewAd_OccurrencesOrDetailsButtonInAgGridDetailAndThumbnailViewShouldOpenAModalWindowWithViewAd_Occurrences_MoreDetailsDownloadTab(String Bname) { TestFixtureSetUp(Bname, "TC002-Verify on clicking the View Ad , Occurrences or Details button in AgGrid's detail and thumbnail view should open a modal window with View ad, Occurrences , More details Download tab."); try { loginPage.navigateToLoginPage().VerifyLoginPageScreenInDetail(); loginPage.loginUsingValidEmailIdAndPassword(); homePage.newVerifyHomePage(); homePage.VerifyAccountOrSwitchIfRequired("QA Testing - Brand Canada"); homePage.newVerifyHomePage(); homePage.selectOptionFromSideNavigationBar("Print Dynamics Dashboard (Occurrence)"); homePage.newVerifyHomePage(); carousels.VerifyCarousels(true); carousels.clickButtonOnCarousel("View Ad"); carousels.VerifyViewAdFunctionality(true, true, true); viewAdPopup.clickOnButtonOfViewAdPopup("Close"); carousels.VerifyViewAdFunctionality(false); viewAdPopup.VerifyOccurrencesFunctionality(); viewAdPopup.clickOnButtonOfViewAdPopup("Close"); viewAdPopup.VerifyOccurrencesFunctionality(false); homePage.selectViewForResultsDisplay("Details"); homePage.VerifyDetailsViewOfAgGrid(true); viewAdPopup.clickOnButtonOfResultsCard("Details"); carousels.VerifyDetailsFunctionality(true, false); } catch (Exception e) { Logging.LogStop(this.driver, test, e, MethodBase.GetCurrentMethod(), Bname + "_TestSuite06_Reskin_ViewAdPopup_TC002"); throw; } driver.Quit(); }