public void GetTicketsForAviacompanyTest() { TestWrapper(() => { SearchRequestModel requestModel = SearchRequestCreator.CreateSearchRequestModel(); var aviacompanyTitle = new MainPage(_webDriver, LoggerConfiguration.Log) .OpenPage().ClickToAviacompanyButton().AviaCompanyTitle.Text; Assert.IsTrue(aviacompanyTitle.Equals("Купить авиабилеты Победа")); }, nameof(GetTicketsForAviacompanyTest)); }
public void MaxPassengersCountTest() { TestWrapper(() => { SearchRequestModel requestModel = SearchRequestCreator.CreateSearchRequestModel(); var passengersCountTest = new MainPage(_webDriver, LoggerConfiguration.Log) .OpenPage() .WriteIntoFromField(requestModel.From) .WriteIntoDestinationField(requestModel.To) .OpenDepartCalendar().SelectDepartDate(1) .OpenReturnCalendar().SelectReturnDate(7) .OpenPassengersControl().AddElderPassengers(10).ApplyPassengers().GetPassengersCount(); Assert.AreNotEqual("10 пассажиров", passengersCountTest); }, nameof(MaxPassengersCountTest)); }
public void SearchTicketsWithOutReturnDateTest() { TestWrapper(() => { SearchRequestModel requestModel = SearchRequestCreator.CreateSearchRequestModel(); var searchResultPage = new MainPage(_webDriver, LoggerConfiguration.Log) .OpenPage() .WriteIntoFromField(requestModel.From) .WriteIntoDestinationField(requestModel.To) .OpenDepartCalendar().SelectDepartDate(1) .OpenPassengersControl().AddElderPassengers(2).ApplyPassengers() .ClickToSearchButton(); Assert.IsTrue(requestModel.From.Contains(searchResultPage.FromPlace.Text)); Assert.IsTrue(requestModel.To.Contains(searchResultPage.DestinationPlace.Text)); }, nameof(SearchTicketsWithOutReturnDateTest)); }
public void SearchWithoutDestinationTest() { TestWrapper(() => { SearchRequestModel requestModel = SearchRequestCreator.CreateSearchRequestModel(); MainPage mainPage = new MainPage(_webDriver, LoggerConfiguration.Log); var searchPage = mainPage .OpenPage() .WriteIntoFromField(requestModel.From) .WriteIntoDestinationField("123") .ClickToSearchButton(); Assert.AreEqual("", searchPage.DestinationField.Text); }, nameof(SearchWithEqualDepartureAndDestinationPlaceTest)); }
public void SearchWithEqualDepartureAndDestinationPlace() { TestWrapper(() => { SearchRequestModel requestModel = SearchRequestCreator.CreateSearchRequestModelWithEqualFromAndDestinationProps(); MainPage mainPage = new MainPage(_webDriver, LoggerConfiguration.Log); var searchResultPage = mainPage .OpenPage() .WriteIntoFromField(requestModel.From) .WriteIntoDestinationField(requestModel.To) .ClickToSearchButton(); Assert.AreEqual(ExpectedErrorText, searchResultPage.ErrorMessage.Text); }, nameof(SearchWithEqualDepartureAndDestinationPlace)); }
public void GetTicketsWithOutDepartDateTest() { TestWrapper(() => { SearchRequestModel requestModel = SearchRequestCreator.CreateSearchRequestModel(); var searchResultPage = new MainPage(_webDriver, LoggerConfiguration.Log) .OpenPage() .WriteIntoFromField(requestModel.From) .WriteIntoDestinationField(requestModel.To) .OpenDepartCalendar().SelectDepartDate(1) .OpenReturnCalendar().CancelDepartDate() .OpenPassengersControl().SelectBusinessClassTicketType().ApplyPassengers() .ClickToSearchButton(); Assert.IsTrue(searchResultPage.AllTicketsWithoutDepartPart()); }, nameof(GetTicketsWithOutDepartDateTest)); }
public void SearchTicketsWithWrongFromAndToPlacesTest() { TestWrapper(() => { SearchRequestModel requestModel = SearchRequestCreator.CreateSearchRequestModel(); var searchResultPage = new MainPage(_webDriver, LoggerConfiguration.Log) .OpenPage() .WriteIntoFromField("123") .WriteIntoDestinationField("789") .OpenDepartCalendar().SelectDepartDate(1) .OpenReturnCalendar().SelectReturnDate(5) .OpenPassengersControl().AddElderPassengers(1).ApplyPassengers() .ClickToSearchButton(); Assert.IsTrue(searchResultPage.DestinationPlace.Text.Equals(String.Empty)); }, nameof(SearchTicketsWithWrongFromAndToPlacesTest)); }
public void SearchTicketsOnPassedDayTest() { TestWrapper(() => { SearchRequestModel requestModel = SearchRequestCreator.CreateSearchRequestModel(); Assert.Throws <InvalidOperationException>(() => { var searchResultPage = new MainPage(_webDriver, LoggerConfiguration.Log) .OpenPage() .WriteIntoFromField(requestModel.From) .WriteIntoDestinationField(requestModel.To) .OpenDepartCalendar().SelectDepartDate(-1) .OpenReturnCalendar().SelectReturnDate(7) .OpenPassengersControl().AddElderPassengers(1).ApplyPassengers() .ClickToSearchButton(); }); }, nameof(SearchTicketsOnPassedDayTest)); }
public void SortResultsByTimeTest() { TestWrapper(() => { SearchRequestModel requestModel = SearchRequestCreator.CreateSearchRequestModel(); var searchResultPage = new MainPage(_webDriver, LoggerConfiguration.Log) .OpenPage() .WriteIntoFromField(requestModel.From) .WriteIntoDestinationField(requestModel.To) .OpenDepartCalendar().SelectDepartDate(1) .OpenReturnCalendar().SelectReturnDate(7) .OpenPassengersControl().SelectBusinessClassTicketType().ApplyPassengers() .ClickToSearchButton().OpenSortOptionList().SelectSortByTimeOption(); var firstTicketTime = searchResultPage.GetFirstTicketTime(); var secondTicketTime = searchResultPage.GetSecondTicketTime(); Assert.IsTrue(firstTicketTime > secondTicketTime || firstTicketTime == secondTicketTime); }, nameof(SortResultsByTimeTest)); }