public static IWebElement WaitForMap(Func <IWebElement> mapProp, int timeout = 30) { var driver = WebDriverContext.GetInstance().Driver; driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5); return(mapProp()); }
public static void WaitUntilHidden(Func <IWebElement> mapProp, int timeout = 30) { var driver = WebDriverContext.GetInstance().Driver; var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(timeout)); wait.Until((webDriver) => !(mapProp()?.Displayed).GetValueOrDefault()); }
public void AfterFeature() { if (WebDriverContext.HasInstance) { var instance = WebDriverContext.GetInstance(); instance.Dispose(); } }
public static IWebElement WaitFor <TPage>(Expression <Func <TPage, IWebElement> > expression, int timeout = 10) { var driver = WebDriverContext.GetInstance().Driver; var compiledExp = expression.Compile(); var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(timeout)); return(wait.Until((webDriver) => { var p = PageFactory.InitElements <TPage>(webDriver); return compiledExp.Invoke(p); })); }
public PageBase() { Driver = WebDriverContext.GetInstance().Driver; PageFactory.InitElements(Driver, this); Driver.Manage().Window.Maximize(); }