public static SearchingPage Search(this JournalPage page, string word) { page.Wait.Until(ExpectedConditions.ElementToBeClickable(By.XPath(@"//button[@id='btnGlobalSearchMagnifier']"))); page.SearchBox.Clear(); page.SearchBox.SendKeys(word); page.SearchButton.Click(); return(new SearchingPage(page.driver)); }
public static JournalPage GoToJournal(this LoginPage page, string name) { page.Wait.Until(ExpectedConditions.ElementExists(By.XPath(validLoginXpath))); page.GetJournalByName(name).Click(); page.driver.SwitchTo().Window(page.driver.WindowHandles.Last()); JournalPage journalPage = new JournalPage(page.driver); return(journalPage); }
public static MyFoldersPage AddFirstArticleToFavoritesFromList(this JournalPage page, string articleName, string folderName) { page.GetAddToFavoritesLinkFromListByArticleName(articleName).Click(); page.WindowAddToFolder = new WindowAddToFolder(page.driver); CreateNewFolder(page.WindowAddToFolder, folderName); page.WindowAddToFolder.AddItemButton.Click(); page.Wait.Until(ExpectedConditions.ElementExists(By.XPath("//input[@value='Go to My Favorites']"))); page.WindowOperationStatus = new WindowOperationStatus(page.driver); page.WindowOperationStatus.GoToFavoritesButton.Click(); return(new MyFoldersPage(page.driver)); }
private static IWebElement GetArticleLinkByName(this JournalPage page, string articleName) { return(page.driver.FindElement(By.XPath(string.Concat("//a[@title='", articleName, "']")))); }
private static IWebElement GetAddToFavoritesLinkFromListByArticleName(this JournalPage page, string articleName) { return(page.driver.FindElement(By.XPath(string.Concat("//a[@title='", articleName, "']//ancestor::div[1]//a[contains(@onclick,'addToMyCollectionsLinkClicked')]")))); }