public void CreateCustomer(CustomerUiViewInfo viewInfo) { _driver.SelectOptionByTextWhenVisible(Title, viewInfo.Title); _driver.SendKeysWhenVisible(Name, viewInfo.Name); _driver.SendKeysWhenVisible(AddressLine1, viewInfo.AddressLine1); _driver.SendKeysWhenVisible(AddressLine2, viewInfo.AddressLine2); _driver.SendKeysWhenVisible(AddressLine3, viewInfo.AddressLine3); _driver.SendKeysWhenVisible(Postcode, viewInfo.Postcode); _driver.SendKeysWhenVisible(HomePhone, viewInfo.HomePhone); _driver.SendKeysWhenVisible(Mobile, viewInfo.Mobile); _driver.ClickElementWhenClickable(Save); }
public void ThenIShouldSeeTheFollowingCustomerDetails(Table table) { var expectedValues = table.Rows.Single(); CustomerUiViewInfo uiViewInfo = _customerMaintenancePage.GetViewInfo(); uiViewInfo.Title.Should().Be(expectedValues["Title"]); uiViewInfo.Name.Should().Be(expectedValues["Name"]); uiViewInfo.AddressLine1.Should().Be(expectedValues["Address Line 1"]); uiViewInfo.AddressLine2.Should().Be(expectedValues["Address Line 2"]); uiViewInfo.AddressLine3.Should().Be(expectedValues["Address Line 3"]); uiViewInfo.Postcode.Should().Be(expectedValues["Postcode"]); uiViewInfo.HomePhone.Should().Be(expectedValues["Home Phone"]); uiViewInfo.Mobile.Should().Be(expectedValues["Mobile"]); }
public void CreateCustomer(CustomerUiViewInfo viewInfo) { var titleSelectElement = new SelectElement(Driver.WaitForElement(Title)); titleSelectElement.SelectByText(viewInfo.Title); Driver.FindElement(Name).SendKeys(viewInfo.Name); Driver.FindElement(AddressLine1).SendKeys(viewInfo.AddressLine1); Driver.FindElement(AddressLine2).SendKeys(viewInfo.AddressLine2); Driver.FindElement(AddressLine3).SendKeys(viewInfo.AddressLine3); Driver.FindElement(Postcode).SendKeys(viewInfo.Postcode); Driver.FindElement(HomePhone).SendKeys(viewInfo.HomePhone); Driver.FindElement(Mobile).SendKeys(viewInfo.Mobile); Driver.FindElement(Save).Click(); }
public void WhenICreateANewCustomerWithTheFollowingDetails(Table table) { var values = table.Rows.Single(); _uiViewInfo = new CustomerUiViewInfo( values["Title"], values["Name"], values["Address Line 1"], values["Address Line 2"], values["Address Line 3"], values["Postcode"], values["Home Phone"], values["Mobile"]); _customerMaintenancePage.Open(); _customerMaintenancePage.CreateCustomer(_uiViewInfo); }