public MS_RegisterAccountPage CreateAccount(RegisterAccountBO registerAccountBO) { // Customer details wait.Until(ExpectedConditions.ElementIsVisible(customerFirstName)); LstTitle[registerAccountBO.Title].Click(); TxtCustomerFirstName.SendKeys(registerAccountBO.customerFirstName); TxtCustomerLastName.SendKeys(registerAccountBO.customerLastName); // TxtEmail.SendKeys(registerAccountBO.email); // AUTOFILLED FROM REGISTER TxtEmail.Click(); // just click is needed for enabling the implicit value TxtPassword.SendKeys(registerAccountBO.password); DdlDays.SendKeys(registerAccountBO.days); // PART OF BIRTH DATE DdlMonths.SendKeys(registerAccountBO.months); // PART OF BIRTH DATE DdlYears.SendKeys(registerAccountBO.years); // PART OF BIRTH DATE // Address details TxtFirstName.SendKeys(registerAccountBO.firstName); TxtLastName.SendKeys(registerAccountBO.lastName); TxtAddress.SendKeys(registerAccountBO.address); TxtCity.SendKeys(registerAccountBO.city); DdlState.SendKeys(registerAccountBO.state); TxtPostCode.SendKeys(registerAccountBO.postCode); DdlCountry.SendKeys(registerAccountBO.country); TxtMobilePhone.SendKeys(registerAccountBO.mobilePhone); TxtAliasAddress.Clear(); // has "My Address" string by default already inserted TxtAliasAddress.SendKeys(registerAccountBO.aliasAddress); BtnRegisterAccount.Click(); return(new MS_RegisterAccountPage(driver)); }
public void Register_CorrectEmail() { loginPage.RegisterApplication(RandomDataProvider.getRandomEmail()); wait.Until(ExpectedConditions.ElementIsVisible(By.Id("id_gender1"))); driver.FindElement(By.Id("id_gender1")); var registerAccountBO = new RegisterAccountBO(); var addressDetailsPage = registerPage.CreateAccount(registerAccountBO); var expectedResult = (registerAccountBO.firstName + " " + registerAccountBO.lastName); wait.Until(ExpectedConditions.ElementIsVisible(By.CssSelector(".account > span:nth-child(1)"))); var actualResult = driver.FindElement(By.CssSelector(".account > span:nth-child(1)")).Text; Assert.AreEqual(expectedResult, actualResult); }
public MS_RegisterAccountPage CreateAddress(RegisterAccountBO registerAccountBO) { LstTitle[registerAccountBO.Title].Click(); return(new MS_RegisterAccountPage(driver)); }