qe-fe-automation
Version:
FE test automation framework using cypress
30 lines (27 loc) • 1.24 kB
text/typescript
import { User_Type } from '@support-onboard/data_model/user_type';
import { HelpCenter } from '@helpcenter-lib/helpcenter';
import { ChatApiIntercept, ChatBooking, ChatBox } from '@chat-lib/index';
import { LocationUtility } from '@utility-lib/location';
import { LoginPage } from '@admin-lib/index';
import { HotelInterceptApis } from '@hotel-lib/index';
describe('Chat: ML supported flows', () => {
xit('C9454024: Use chat to book hotel via ML flow', { tags: ['@tier2'] }, () => {
const daysToMove = { daysToMove: 8, daysAfterMovedDays: 2 };
ChatApiIntercept.interceptChatApis();
HotelInterceptApis.interceptHotelApis();
LoginPage.createNewCompanyAndLoginWithUserByType({
users: [User_Type.ADMIN],
companySuffix: '-avamltest'
});
HelpCenter.visitPage();
ChatBox.openChatWithAva();
ChatBox.typeMsgToAva(`I want to book a hotel in ${LocationUtility.getCityUS()}`);
ChatBox.expectMsgReceivedFromAva(`provide`);
ChatBooking.enterShiftedDates(daysToMove);
ChatBox.readAvaMsgAndTypeReply('confirm', 'Yes');
ChatBox.readAvaMsgAndTypeReply('specify', 'any hotel');
ChatBox.getHotelLocationText();
ChatBooking.hotelCheckout();
ChatBooking.checkIsChatMinimized();
});
});