public BaseElement WaitForElementToBeClickable() { var wait = new WebDriverWait(WebdriverFactory.GetCurrentDriver(), TimeSpan.FromSeconds(Timeout)); wait.Until(SeleniumExtras.WaitHelpers.ExpectedConditions.ElementToBeClickable(Locator)); return(this); }
public BaseElement AssertAbsent() { IList <IWebElement> list = WebdriverFactory.GetCurrentDriver().FindElements(Locator); if (list.Count > 0) { Assert.IsFalse(list[0].Displayed); } return(this); }
public void verifyLoginWithWrongToken() { string wrongToken = "wrong"; WebdriverFactory.GetCurrentDriver().Url = WebdriverFactory.ApplicationUrl; new MainPage().GetLoginButton().Click(); LoginPage loginPage = new LoginPage(); loginPage.GetLoginSubmitButton().WaitForElementToBePresent().AssertDisabled(); loginPage.GetTokenTextField().SetValue(wrongToken); loginPage.GetLoginSubmitButton().Click(); loginPage.GetInvalidTokenMessage().WaitForElementToBePresent().AssertExists(); }
public void VerifyCreationAndDeletionOfCategory() { string categoryName = DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss.fff"); LoginHelper.Login(); new MainPage().GetCategoriesButton().Click(); CategoriesPage categoriesPage = new CategoriesPage(); categoriesPage.GetCreateNewCategoryButton().Click(); CreateCategoryPage createCategoryPage = new CreateCategoryPage(); createCategoryPage.GetCategotyNameTextField().SetValue(categoryName); createCategoryPage.GetSubmitButton().Click(); categoriesPage = new CategoriesPage(); categoriesPage.GetCategoryRowByName(categoryName).WaitForElementToBePresent().AssertExists(); categoriesPage.GetDeleteButtonByCategoryName(categoryName).Click(); WebdriverFactory.GetCurrentDriver().SwitchTo().Alert().Accept(); categoriesPage.GetCategoryRowByName(categoryName).WaitForElementToBeAbsent().AssertAbsent(); }
public IWebElement GetWebElement() { return(WebdriverFactory.GetCurrentDriver().FindElement(Locator)); }
public void startBrowser() { WebdriverFactory.OpenNewBrowser(); WebdriverFactory.GetCurrentDriver().Manage().Window.Maximize(); }
public void closeBrowser() { WebdriverFactory.GetCurrentDriver().Close(); WebdriverFactory.ClearUpDriver(); }