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 Summary
FieldsFields inherited from class tests.BaseTest
logger, readProperties, SECRET_KEY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionObject[][]
Data provider for invalid airline queries.getQueryParams
(String originLocationCode, String destinationLocationCode, String departureDate, String returnDate, Integer adults) Builds a map of query parameters for flight search.Object[][]
Data provider for valid airline queries.void
testInvalidSearchFlightOffers
(String originLocationCode, String destinationLocationCode, String departureDate, String returnDate, Integer adults, String errorTtile, String errorDetail) Tests searching for flight offers with invalid parameters.void
testValidSearchFlightOffers
(String originLocationCode, String destinationLocationCode, String departureDate, String returnDate, Integer adults) Tests searching for flight offers with valid parameters.Methods inherited from class tests.BaseTest
getOauth2Token, setUpSuite
-
Field Details
-
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 airportdestinationLocationCode
- IATA code of the arrival airportdepartureDate
- departure date in YYYY-MM-DD formatreturnDate
- 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 airportdestinationLocationCode
- IATA code of the arrival airportdepartureDate
- departure date in YYYY-MM-DD formatreturnDate
- return date in YYYY-MM-DD formatadults
- number of adult passengers
-
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 airportdestinationLocationCode
- IATA code of the arrival airportdepartureDate
- 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 responseerrorDetail
- expected error detail in the response
-
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
-