qe-fe-automation
Version:
FE test automation framework using cypress
60 lines (57 loc) • 2.23 kB
text/typescript
import { LoginPage } from '@admin-lib/index';
import {
Hotels,
HotelCheckout,
HotelSearchResults,
HotelItinerary,
HotelInterceptApis,
bookHotel
} from '@hotel-lib/index';
import { User_Type } from '@support-onboard/index';
import { Utility } from '@utility-lib/index';
import { RentalCar } from '@rentalCar-lib/search';
import { RentalCarSearchResults } from '@rentalCar-lib/search_results';
import { RentalCarCheckout } from '@rentalCar-lib/checkout';
import { RentalCarInterceptApis } from '@rentalCar-lib/api-intercept';
import { Random } from '@utility-lib/random';
import { Trips } from '@rentalCar-lib/trips';
const tripTileType = 'Business';
describe('Personal Travel: Add to trip - Bleisure', () => {
beforeEach(() => {
LoginPage.createNewCompanyAndLoginWithUserByType({ users: [User_Type.ADMIN] });
HotelInterceptApis.interceptHotelApis();
RentalCarInterceptApis.interceptRentalCarApis();
});
it(
'C8107996: Verify personal trips are associated with personal profiles',
{ tags: ['@tier2'] },
() => {
bookHotel(tripTileType);
HotelItinerary.visitItinerary();
HotelItinerary.viewAndManageItinerary();
HotelItinerary.addNewTripInCurrentItinerary('Rental car');
Utility.selectTripTileType('Personal');
RentalCar.searchRentalCar();
RentalCarSearchResults.selectCar();
RentalCarCheckout.setTripInfo();
RentalCarCheckout.updateEmailDetails(
'personal-' + Random.randomString(12) + '@staging-prime.tripactions.xyz'
);
RentalCarCheckout.setAcknowledgement();
RentalCarCheckout.checkOutCar();
RentalCarCheckout.expectRentalCarBookingSuccessfully('Car confirmed!');
HotelItinerary.visitItinerary();
HotelItinerary.viewAndManageItinerary();
HotelItinerary.addNewTripInCurrentItinerary('Hotel');
Utility.selectTripTileType(tripTileType);
Hotels.searchHotel();
HotelSearchResults.selectHotel(0);
HotelSearchResults.selectRoomOption();
HotelCheckout.checkoutFLow(tripTileType);
HotelCheckout.expectHotelBookedSuccessfully('Hotel confirmed!');
Trips.visitTripsPage();
Trips.selectTrip();
Trips.expectDriverNameIsCorrect();
}
);
});