public void PerformAs(IActor actor)
        {
            foreach (var row in _rows)
            {
                switch (row.Label.ToUpper())
                {
                case "URL":
                    actor.AttemptsTo(SendKeys.To(SubmissionPage.UrlInputField, row.Value));
                    break;

                case "TYPE":
                    actor.AttemptsTo(Select.ByText(SubmissionPage.TypeSelect, row.Value));
                    break;

                case "EMAIL":
                    actor.AttemptsTo(SendKeys.To(SubmissionPage.EmailInputField, row.Value));
                    break;

                case "DESCRIPTION":
                    actor.AttemptsTo(SendKeys.To(SubmissionPage.DescriptionInputField, row.Value));
                    break;

                case "NAME":
                    actor.AttemptsTo(SendKeys.To(SubmissionPage.NameField, row.Value));
                    break;

                default:
                    throw new NotImplementedException();
                }
            }
        }
        public void PerformAs(IActor actor)
        {
            actor.AttemptsTo(Click.On(FlightBookingPage.FromButton));
            actor.AttemptsTo(Click.On(FlightBookingPage.FromButton));
            actor.AttemptsTo(SendKeys.To(FlightBookingPage.FromInput, FromCity));
            Thread.Sleep(2000);
            actor.AttemptsTo(Click.On(FlightBookingPage.GoaCity));
            actor.AttemptsTo(Click.On(FlightBookingPage.ToButton));
            actor.AttemptsTo(Click.On(FlightBookingPage.ToButton));
            actor.AttemptsTo(SendKeys.To(FlightBookingPage.ToInput, ToCity));
            Thread.Sleep(2000);
            actor.AttemptsTo(Click.On(FlightBookingPage.MumbaiCity));

            actor.AttemptsTo(Click.On(L("DEPARTURE Date",
                                        By.XPath("//div[@aria-label='" + DepatureDate + "']//div[@class='dateInnerCell']"))));
            actor.AttemptsTo(Click.On(FlightBookingPage.Return));
            actor.AttemptsTo(Click.On(L("Return Date",
                                        By.XPath("//div[@aria-label='" + ReturnDate + "']//div[@class='dateInnerCell']"))));
            actor.AttemptsTo(Click.On(FlightBookingPage.NoOfTravellerAndClass));

            actor.AttemptsTo(Click.On(L("Number OF Adults",
                                        By.XPath("//li[@data-cy='adults-" + Convert.ToString(NoOfAdults) + "']"))));
            actor.AttemptsTo(Click.On(L("Number OF Children",
                                        By.XPath("//li[@data-cy='children-" + Convert.ToString(NoOfChild) + "']"))));
            if (string.Equals(ClassType, "Economy"))
            {
                actor.AttemptsTo(Click.On(FlightBookingPage.EconomyClass));
            }
            actor.AttemptsTo(Click.On(FlightBookingPage.ApplyButton));
        }
        public void WhenIUpdateTheCustomerWithANewMobileNumberOf(string newMobileNumber)
        {
            _storedCustomer.Should().NotBeNull();

            int customerId = _actor.AsksFor(StoredCustomerId.ForName(_storedCustomer.Name));

            _actor.AttemptsTo(
                ViewCustomer.WithId(customerId),
                SendKeys.To(CustomerMaintenancePage.Mobile, newMobileNumber),
                Click.On(CustomerMaintenancePage.Save));
        }
Ejemplo n.º 4
0
 public void PerformAs(IActor actor)
 {
     try
     {
         Wait.Until(Appearance.Of(LoginPage.LoginOrCreateAccuntButton), IsEqualTo.True());
         actor.AttemptsTo(Click.On(LoginPage.LoginOrCreateAccuntButton));
     }
     catch (Exception e)
     {
         actor.AttemptsTo(Click.On(LoginPage.LoginOrCreateAccuntButton2));
     }
     actor.AttemptsTo(SendKeys.To(LoginPage.EmailInput, Email));
     actor.AttemptsTo(Click.On(LoginPage.ContinueButton));
     actor.AttemptsTo(SendKeys.To(LoginPage.PasswordInput, Password));
     actor.AttemptsTo(Click.On(LoginPage.LoginButton));
 }
Ejemplo n.º 5
0
 public void TestWithInValidEmailAddress()
 {
     try
     {
         Wait.Until(Appearance.Of(LoginPage.LoginOrCreateAccuntButton), IsEqualTo.True());
         actor.AttemptsTo(Click.On(LoginPage.LoginOrCreateAccuntButton));
     }
     catch (Exception e)
     {
         actor.AttemptsTo(Click.On(LoginPage.LoginOrCreateAccuntButton2));
     }
     actor.AttemptsTo(SendKeys.To(LoginPage.EmailInput, "testiih123"));
     actor.AttemptsTo(Click.On(LoginPage.ContinueButton));
     actor.WaitsUntil(Appearance.Of(LoginPage.ErrorMessageInvalidUserNamePasswordText), IsEqualTo.True());
     actor.AskingFor(Text.Of(LoginPage.ErrorMessageInvalidUserNamePasswordText)).Should().Be("Please enter a valid Email Id or Mobile Number.");
 }
 public void WhenISearchFor(string searchText)
 {
     _actor.AttemptsTo(
         Navigate.To(CustomerMaintenancePage.Path),
         SendKeys.To(CustomerMaintenancePage.Name, searchText).OneKeyAtATime());
 }
Ejemplo n.º 7
0
 public void WhenTheNameStaysEmpty()
 {
     _actor.AttemptsTo(SendKeys.To(SubmissionPage.NameField, string.Empty));
 }
Ejemplo n.º 8
0
 public void WhenTheNameIsProvided(string name)
 {
     _actor.AttemptsTo(SendKeys.To(SubmissionPage.NameField, name));
 }