public static MyFoldersPage GoToSavedSearchesResultsPage(this SearchingPage page) { page.Wait.Until(ExpectedConditions.ElementToBeClickable(By.XPath(@"//span[contains(@id,'UserActionsToolbar_lblAccount')]"))); page.UserActionToolBar.Click(); page.Wait.Until(ExpectedConditions.ElementIsVisible(By.XPath(@"//a[contains(@id,'ucUserActionsToolbar_lnkSavedSearches')]"))); page.SaveFolderToolBarButton.Click(); return(new MyFoldersPage(page.driver)); }
public static bool IsSearchSuccessful(this MyFoldersPage page, string nameSearch, string wordSearch) { SearchingPage searchingPage = page.GoToSearchpage(nameSearch); searchingPage.Wait.Until(ExpectedConditions.ElementIsVisible(By.XPath(@"//div[@id='main-container-content']"))); bool result = searchingPage.driver.FindElement(By.XPath(@"//div[@class='searchUserKeywords']")).Text.Contains(wordSearch); MyFoldersPage folderPage = searchingPage.GoToSavedSearchesResultsPage(); folderPage.DeleteSearch(nameSearch); return(result); }
public static SearchingPage Save(this SearchingPage page, string nameOfSave) { page.Wait.Until(ExpectedConditions.ElementIsVisible(By.XPath(@"//div[@class='searchFacets']"))); page.SaveButton.Click(); page.Wait.Until(ExpectedConditions.ElementIsVisible(By.XPath(@"(//div[@class='wk-modal-body'])[1]"))); WindowSaveSearch window = new WindowSaveSearch(page.driver); window.SearchNameTextBox.SendKeys(nameOfSave); window.SaveSearchButton.Click(); page.Wait.Until(ExpectedConditions.ElementIsVisible(By.XPath(@"//span[contains(text(),'has been successfully saved')]"))); window.CloseWindowButton.Click(); return(page); }
private static IWebElement GetNumberPageOfSearch(this SearchingPage page, string number) { return(page.driver.FindElement(By.XPath(string.Concat("//div[@class='pagenumbers']/a[text()='", number, "']")))); }
//WAIT loading the second page!!!! public static SearchingPage ChooseNumberOfPage(this SearchingPage page, string pageNumber) { page.Wait.Until(ExpectedConditions.ElementExists(By.XPath(@"//section[@id='wpPagingControl']"))); page.GetNumberPageOfSearch(pageNumber).Click(); return(page); }
public static bool IsArticleInSearchResults(this SearchingPage page, string articleName) { page.Wait.Until(ExpectedConditions.ElementIsVisible(By.XPath(@"//div[@class='searchContent']"))); return(page.driver.FindElements(By.XPath(string.Concat("//article//a[text()='", articleName, "']"))).Count > 0); }
public static bool IsResultsCountOnPageSixty(this SearchingPage page) { return(page.SearchingResults.Count == 60); }
public static bool IsResultsCountMoreThanHundred(this SearchingPage page) { page.Wait.Until(ExpectedConditions.ElementExists(By.XPath("//div[@class='resultCount']"))); return(int.Parse(page.SearchingResultsCount.Text.Replace("results", string.Empty)) > 100); }