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); }
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()); }
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()); }
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); }
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()); }