//[TestCaseSource("WebBrowser")] public static void SetUpDriver() { BrowserFactory.InitBrowser(browser); log.WriteMessagesInFile($"Browser {browser} was initiated successfuly"); BrowserFactory.GoToUrl(ConfigurationManager.AppSettings["URL"]); // BrowserFactory.GoToUrl(url); BrowserFactory.MaximizeWindow(); }
public bool IsLogOut() { BrowserFactory.GoToUrl(ConfigurationManager.AppSettings["Url"]); if (ConfigurationManager.AppSettings["Url"] == BrowserFactory.Driver.Url) { return(true); } log.WriteMessagesInFile("User was NOT signed out.Smth went wrong"); return(false); }
public bool IsCorrectLink(string message, string item) { OpenLastTweet(); string url = linkTweet.GetAttribute("title"); BrowserFactory.OpenNewTab(); BrowserFactory.GoToUrl(url); log.WriteMessagesInFile($"New tab is opened with url {url}"); switch (item) { case "correct link": if (url == BrowserFactory.Driver.Url) { if (BasePageObject.FacebookHome.HomePageIsOpened()) { BrowserFactory.CloseTab(); log.WriteMessagesInFile($"New tab is closed with url {url}"); return(true); } else { return(false); } } else { return(false); } default: string path = "//div[@id='suggestions-list']//following-sibling::div[@class='error-code']"; log.WriteMessagesInFile($"The link {url} was incorrect"); Extensions.WaitedForElementPresent(BrowserFactory.Driver, By.XPath(path), 10); BrowserFactory.CloseTab(); return(false); } }
public void ReopenBrowser() { BrowserFactory.ReopenTab(); BrowserFactory.GoToUrl(ConfigurationManager.AppSettings["URL"]); //BrowserFactory.GoToUrl(TestBases.TestBase.Url); }