Beispiel #1
0
        public void SearchTicketsWithoutPassengers()
        {
            string message = new MainPage(driver).InputCity(SearchFormCreator.WithAllParameters())
                             .SetPassengers(SearchFormCreator.WithoutPassengers())
                             .InputDateDefaultValues()
                             .Submit()
                             .GetAlertErrorMessage();

            Assert.AreEqual("Please enter at least 1 adult, senior or junior(youth) passenger.", message);
        }
Beispiel #2
0
 public void SearchTicketWithNonExistingStations()
 {
     new MainPage(driver).InputCity(SearchFormCreator.WithAllParameters())
     .SetPassengers(SearchFormCreator.WithAllParameters())
     .InputDateDefaultValues()
     .Submit();
     Assert.AreEqual("I'm sorry we don't appear to be able " +
                     "to do that journey online at the moment," +
                     " the chances are we're able to do it offline though." +
                     " Please complete the form below and we'll get back to you with a quote.", new ErrorPage(driver).GetErrorMessage());
 }
Beispiel #3
0
 public void SearchTicketWithEqualDepartureAndReturnDate()
 {
     new MainPage(driver).InputCity(SearchFormCreator.WithAllParameters())
     .ReturnSearchClick()
     .InputDateDefaultValuesForReturn()
     .SetEqualsReturnDateAndDepartureDate()
     .SubmitReturnDate();
     Assert.AreEqual("I'm sorry we don't appear to be able " +
                     "to do that journey online at the moment," +
                     " the chances are we're able to do it offline though." +
                     " Please complete the form below and we'll get back to you with a quote.", new ErrorPage(driver).GetErrorMessage());
 }
Beispiel #4
0
        public void SetEmptyUserInfo()
        {
            SelectTheTicketPage selectTheTicketPage = new MainPage(driver).InputCity(SearchFormCreator.WithAllParameters())
                                                      .SetPassengers(SearchFormCreator.WithAllParameters())
                                                      .InputDateDefaultValues()
                                                      .SubmitValidValue();
            string className = selectTheTicketPage.SelectClass()
                               .Submit()
                               .WaitModalWindow()
                               .InputUserInfo(UserInfoCreator.WithEmptyName())
                               .Continue()
                               .IsInvalidValue();

            Assert.AreEqual("starail-Form-input starail-Form-error", className);
        }
Beispiel #5
0
        public void CheckResult()
        {
            SelectTheTicketPage selectTheTicketPage = new MainPage(driver).InputCity(SearchFormCreator.WithAllParameters())
                                                      .SetPassengers(SearchFormCreator.WithAllParameters())
                                                      .InputDateDefaultValues()
                                                      .SubmitValidValue();
            SelectSeatsPage selectSeatsPage = selectTheTicketPage.SelectClass()
                                              .Submit()
                                              .WaitModalWindow()
                                              .InputUserInfo(UserInfoCreator.WithDefaultParameters())
                                              .ContinueWithValidParameters();
            TicketLocationPage ticketLocationPage = selectSeatsPage.Submit();
            UserInfoPage       userInfoPage       = ticketLocationPage.Submit();
            PayPage            payPage            = userInfoPage.InputUserInfo(UserInfoCreator.WithDefaultParameters());

            Assert.AreEqual("10:46 | 27 Dec 2019", payPage.GetResult());
        }