public void RouteHaveSeats() { #region TestData string numSeat = "45"; bool hasSeats; #endregion Route route = RouteCreator.WithAllProperties(); GdTicketsHomePage gdTicketsHomePage = new GdTicketsHomePage(); SearchResultsPage searchResultsPage = gdTicketsHomePage .FillFieldDeparture(route) .FillFieldArrive(route) .OpenDepartCalendar() .ChoiceDepartureDate(route) .GoToSearchResult(); searchResultsPage.ChoiceFirstTrain(); string strNumber = searchResultsPage.GetNumberFreeSeats(); int number = int.Parse(strNumber); if (number > 0) { hasSeats = true; } else { hasSeats = false; } Assert.IsTrue(hasSeats); }
public void FindTicketWithEmptyFieldDepartureDate() { #region TestData const string expectedErrorMessage = "This field is mandatory"; #endregion Route route = RouteCreator.WithAllProperties(); GdTicketsHomePage page = new GdTicketsHomePage(webDriver); page .FillFieldDeparture(route) .FillFieldArrive(route) .SearchClick(); Assert.AreEqual(expectedErrorMessage, page.getErrorMessage()); }
public void CheckCorrectnessRoute() { Route route = RouteCreator.WithAllProperties(); GdTicketsHomePage gdTicketsHomePage = new GdTicketsHomePage(); SearchResultsPage searchResultsPage = gdTicketsHomePage .FillFieldDeparture(route) .FillFieldArrive(route) .OpenDepartCalendar() .ChoiceDepartureDate(route) .GoToSearchResult(); string trip = route.DepartureCity + "-" + route.ArrivalCity; bool pageIsResultsPage = searchResultsPage.GetTrip().Contains(trip); Assert.IsTrue(pageIsResultsPage); }
public void OpenSearchResultPage() { #region TestData string searchResultsPageUrl = "https://gd.tickets.ua/en/search/results"; #endregion Route route = RouteCreator.WithAllProperties(); GdTicketsHomePage page = new GdTicketsHomePage(); SearchResultsPage searchResultsPage = page .FillFieldDeparture(route) .FillFieldArrive(route) .OpenDepartCalendar() .ChoiceDepartureDate(route) .GoToSearchResult(); bool pageIsResultsPage = searchResultsPage.GetUrl().Contains(searchResultsPageUrl); Assert.IsTrue(pageIsResultsPage); }
public void BuyChildrenTicketIfAdult() { #region TestData string error = "Please specify a valid date in the format DD/MM/YYYY"; Route route = RouteCreator.WithAllProperties(); User user = UserCreator.WithAllProperties(); #endregion GdTicketsHomePage gdTicketsHomePage = new GdTicketsHomePage(); SearchResultsPage searchResultsPage = gdTicketsHomePage .FillFieldDeparture(route) .FillFieldArrive(route) .OpenDepartCalendar() .ChoiceDepartureDate(route) .GoToSearchResult() .ChoiceFirstTrain() .ChoiceChildTo14YearsAndWriteData(user); Assert.AreEqual(error, searchResultsPage.GetDateError()); }