qe-fe-automation
Version:
FE test automation framework using cypress
44 lines (40 loc) • 1.68 kB
text/typescript
import { LoginPage } from '@admin-lib/index';
import { GuestTravelInfo, UserModal } from '@profile-lib/index';
import { createGuestDetails, GuestDetails } from '@user-lib/index';
import { Provider_Type, User_Type } from '@support-onboard/index';
import { Profile } from '../../../lib/profile';
import { PersonalHomeScreen } from '../../../lib/personal_homescreen';
import { HotelInterceptApis } from '@hotel-lib/api-intercept';
describe('Personal Travel: Guest Profile Page', () => {
beforeEach(() => {
GuestTravelInfo.interceptApis();
UserModal.interceptApis();
LoginPage.createNewCompanyAndLoginWithUserByType({
providers: [Provider_Type.EXPEDIA_FLIGHT, Provider_Type.ALL_CAR],
users: [User_Type.TRAVELER],
companySuffix: 'rewardspt'
});
GuestTravelInfo.visitPage();
GuestTravelInfo.waitToBeLoaded();
HotelInterceptApis.interceptHotelApis();
});
it('C11082435: Create new trip for personal guest', { tags: ['@tier1'] }, () => {
const guestDetails = createGuestDetails(30, 'MALE', 'Personal');
Profile.openNewGuestModal();
createPersonalUserTrip(guestDetails);
});
const createPersonalUserTrip = (guestDetails: GuestDetails) => {
const { givenName = '', familyName = '', email = '', age = 30 } = guestDetails;
UserModal.fillTravelerName(givenName, familyName);
UserModal.fillBirthday(age);
UserModal.fillEmail(email);
Profile.saveGuestProfile();
GuestTravelInfo.expectGuestToExists({
email,
firstName: givenName,
lastName: familyName
});
Profile.personalGuestTrip(givenName, familyName);
PersonalHomeScreen.verifyPersonalHomeEducationShown();
};
});