Exemple #1
0
        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);
        }
Exemple #2
0
        public void CreateCar(CarUiViewInfo viewInfo)
        {
            _driver.SendKeysWhenVisible(Registration, viewInfo.Registration);
            _driver.SendKeysWhenVisible(Make, viewInfo.Make);
            _driver.SendKeysWhenVisible(Model, viewInfo.Model);
            _driver.SendKeysWhenVisible(Year, viewInfo.Year);

            _driver.ClickElementWhenClickable(Save);
        }
Exemple #3
0
        public void ChangeRegistration(string currentRegistration, string newRegistration)
        {
            _driver.SendKeysWhenVisible(CurrentRegistration, currentRegistration);
            _driver.SendKeysWhenVisible(NewRegistration, newRegistration);

            _driver.ClickElementWhenClickable(UpdateRegistration);

            _driver.SwitchTo().Alert().Accept();
        }
Exemple #4
0
        public void CreateJob(JobUiViewInfo viewInfo)
        {
            _driver.SendKeysWhenVisible(Description, viewInfo.Description);

            CalendarDatePicker datePicker = new CalendarDatePicker(_driver, _driver.FindElement(Start));

            datePicker.SetValue(viewInfo.Date);

            _driver.SendKeysWhenVisible(Hours, viewInfo.Hours.ToString("0.##"));
            _driver.SendKeysWhenVisible(Mileage, viewInfo.Mileage.ToString());

            _driver.ClickElementWhenClickable(Save);

            IAlert alert = _driver.GetAlertWhenPresent();

            if (alert != null && alert.Text.StartsWith("Have you checked MOT"))
            {
                alert.Accept();
            }
        }