public void RegisterUser(UserModel user) { GoToUrl(ConfigurationManager.AppSettings["SiteUrl"] + "Account/Registration"); CustomConditionals.SendedToField(Driver, By.Id("UserName"), user.Username); CustomConditionals.SendedToField(Driver, By.Id("Email"), user.Email); CustomConditionals.SendedToField(Driver, By.Id("Password"), user.Password); CustomConditionals.SendedToField(Driver, By.Id("ConfirmPassword"), user.Password); var registerButton = FindByCss(".register-button"); registerButton.Click(); CustomConditionals.WaitForLoggedIn(Driver); SignOut(); }
public void SignIn(string username, string password) { FindById("SignIn").Click(); var usernameInputXpath = "//*[contains(@class,'login-form')]//*[@id='username']"; CustomConditionals.SendedToField(Driver, By.XPath(usernameInputXpath), username); var passwordInputXPath = "//*[contains(@class,'login-form')]//*[@id='password']"; CustomConditionals.SendedToField(Driver, By.XPath(passwordInputXPath), password); var loginButton = FindByXPath("//*[contains(@class, 'login-button')]"); loginButton.Click(); try { CustomConditionals.WaitForLoggedIn(Driver); } catch (WebDriverTimeoutException) { } }