UNPKG

qe-fe-automation

Version:
64 lines (60 loc) 2.66 kB
import { FlightBookingUtility } from '@flight-modal/index'; import { FlightTripType } from '@flight-lib/search'; import { LocationUtility } from '@utility-lib/location'; import { Directions, FlightBookingData } from '@chat-lib/booking'; import { HelpCenter } from '@helpcenter-lib/helpcenter'; import { ChatApiIntercept, ChatBooking, ChatBox } from '@chat-lib/index'; import { LoginPage } from '@admin-lib/index'; import { FlightInterceptApis } from '@flight-lib/index'; import { Timeouts } from '@utility-lib/index'; import { Provider_Type, User_Type } from '@support-onboard/index'; describe('Chat: ML supported flows', () => { it.skip( 'C9566197: Use chat to change flight booking via ML supported flow', { tags: ['@tier2'] }, () => { const flightBookingParams = FlightBookingUtility.initFlightBookingParams({ locations: LocationUtility.getPairOfOriginAndDestinationAirportsUSWithShortName(), flightTripType: FlightTripType.ROUNDTRIP, tripTileType: 'Business' }); const flightBookingData: FlightBookingData = { flightBookingParams: flightBookingParams, departingFrom: Directions.FROM, arrivingAt: Directions.TO, isChangeFlight: true }; const daysToMove = { daysToMove: 8, daysAfterMovedDays: 2 }; ChatApiIntercept.interceptChatApis(); FlightInterceptApis.interceptFlightsApis(); LoginPage.createNewCompanyAndLoginWithUserByType({ users: [User_Type.ADMIN], providers: [Provider_Type.SABRE_FLIGHT], companySuffix: '-avamltest' }); HelpCenter.visitPage(); ChatBox.openChatWithAva(); ChatBox.typeMsgToAva(`I want to book a flight to ${flightBookingParams.locations}`); ChatBox.expectMsgReceivedFromAva(`provide`); ChatBooking.enterShiftedDates(daysToMove); ChatBox.readAvaMsgAndTypeReply('confirm', 'Yes'); ChatBooking.continueBookTripFlight(flightBookingData); ChatBooking.checkIsChatMinimized(); ChatBox.openChat(); ChatBox.closeChat(); ChatBox.confirmCloseChat(); ChatBox.startNewChatWithAva(); ChatBox.typeMsgToAva( `I want to change my upcoming flight by shift dates 5 days further` ); ChatBox.readAvaMsgAndTypeReply('confirm', 'Yes'); ChatBox.waitUntilAvaStopTyping(); cy.wait(Timeouts.MEDIUM_TIMEOUT_30_SEC.timeout); ChatBooking.changeFlightOptions('Search'); ChatBox.expectMsgReceivedFromAva( `All set! I've changed this booking. If you refresh your trip page you will see the updated booking.` ); ChatBox.selectMsgYouWannaSendBackToAva('done'); } ); });