qe-fe-automation
Version:
FE test automation framework using cypress
37 lines (33 loc) • 1.5 kB
text/typescript
import { SplitUtility } from '@split-lib/index';
import { SharedIntercepts } from '@intercepts-lib/index';
export class AdminInterceptsApis {
static interceptAdminsApis() {
SharedIntercepts.intercepts();
//################# intercept Impersonation Apis #################
cy.intercept('GET', '/api/liquid/admin/transactions?**').as('waitForVisitAdminPage');
cy.intercept('GET', 'api/liquid/user/me').as('waitForImpersonatedUser');
//################# intercept Super Admin Apis #################
cy.intercept('GET', /api\/superAdmin\/agencies/).as('waitForAgencies');
cy.intercept('GET', /api\/superAdmin\/companies/).as('waitForLoadCompanies');
cy.intercept(
'POST',
/api\/superAdmin\/tools\/transactions\/AMEX_BTA_INVOICE_EU\/xml/
).as('waitForAMEXBTAEUXL');
}
//################# guest Invite Popup Model #################
static guestInvitePopupModel() {
cy.updateSplits();
SplitUtility.isSplitOn('GROUP_TRAVEL_REFACTOR').then((refactored) => {
const paymentMethodsEndpoint = refactored
? '/api/user/paymentMethods'
: '/api/user/paymentMethods/directbill';
const travelEventsFormEndpoint = refactored
? '/api/v1/user/travel-events/form'
: '/api/user/company/userFields';
cy.intercept('GET', new RegExp(paymentMethodsEndpoint)).as(
'waitForGuestInviteModal'
);
cy.intercept('GET', new RegExp(travelEventsFormEndpoint)).as('waitForPopUpModel');
});
}
}