Package tests.flights

Class FlightOffersTest

java.lang.Object
tests.BaseTest
tests.flights.FlightOffersTest

@Epic("Fligts Offer Search and Booking") @Feature("Fligths Offer Search") @Severity(CRITICAL) public class FlightOffersTest extends BaseTest
Test class for Flight Offers API endpoints. Tests functionality for searching available flights with various parameters.
  • Field Details

    • FLIGHT_OFFERS

      public static final String FLIGHT_OFFERS
  • Constructor Details

    • FlightOffersTest

      public FlightOffersTest()
  • Method Details

    • getQueryParams

      public Map<String,Object> getQueryParams(String originLocationCode, String destinationLocationCode, String departureDate, String returnDate, Integer adults)
      Builds a map of query parameters for flight search.
      Parameters:
      originLocationCode - IATA code of the departure airport
      destinationLocationCode - IATA code of the arrival airport
      departureDate - departure date in YYYY-MM-DD format
      returnDate - return date in YYYY-MM-DD format (optional)
      adults - number of adult passengers (optional)
      Returns:
      a map of query parameters for the API request
    • testValidSearchFlightOffers

      public void testValidSearchFlightOffers(String originLocationCode, String destinationLocationCode, String departureDate, String returnDate, Integer adults)
      Tests searching for flight offers with valid parameters. Verifies the response contains valid flight offers matching the search criteria.
      Parameters:
      originLocationCode - IATA code of the departure airport
      destinationLocationCode - IATA code of the arrival airport
      departureDate - departure date in YYYY-MM-DD format
      returnDate - return date in YYYY-MM-DD format
      adults - number of adult passengers
    • getvalidAirLineQuery

      @DataProvider(name="Valid AirLine Query") public Object[][] getvalidAirLineQuery()
      Data provider for valid airline queries. Supplies test cases with valid parameters to verify successful flight offer searches.
      Returns:
      an array of test data containing valid query parameters
    • testInvalidSearchFlightOffers

      public void testInvalidSearchFlightOffers(String originLocationCode, String destinationLocationCode, String departureDate, String returnDate, Integer adults, String errorTtile, String errorDetail)
      Tests searching for flight offers with invalid parameters. Verifies the API returns appropriate error messages and status codes for invalid input.
      Parameters:
      originLocationCode - IATA code of the departure airport
      destinationLocationCode - IATA code of the arrival airport
      departureDate - departure date in YYYY-MM-DD format (may be invalid or null)
      returnDate - return date in YYYY-MM-DD format (may be invalid or null)
      adults - number of adult passengers (may be invalid or null)
      errorTtile - expected error title in the response
      errorDetail - expected error detail in the response
    • getInvalidAirLineQuery

      @DataProvider(name="Invalid AirLine Query") public Object[][] getInvalidAirLineQuery()
      Data provider for invalid airline queries. Supplies test cases with invalid or missing parameters to validate error handling in the API.
      Returns:
      an array of test data containing invalid query parameters and expected error messages