UNPKG

qe-fe-automation

Version:
86 lines (77 loc) 2.88 kB
import { GrowthInterceptApis } from '@growth-lib/api-intercept'; import { AmplitudeEvents } from '@growth-lib/amplitude-events'; import { PolicyWizardPages, PolicyWizardState } from '@growth-lib/policy-wizard-pages'; import { LoginPage } from '@admin-lib/login'; import { stagingUsers } from '@fixtures/staging-users'; import { loginRequest } from 'cypress/artifacts'; const growthUserPolicyWizard = stagingUsers.growth_policy_wizard; const authUserPassword = Cypress.env('newUser').NEW_USER_PASSWORD; describe('Affiliate: policy wizard', () => { let token: string; beforeEach(() => { GrowthInterceptApis.interceptApis(); LoginPage.clearExistingLoginSession(); loginRequest( growthUserPolicyWizard.emailPolicyWizardFromNoCreationFlow, authUserPassword ).then((token) => { PolicyWizardPages.patchPolicyState(PolicyWizardState.NOT_STARTED, token); PolicyWizardPages.goToPolicyWizardPage(); PolicyWizardPages.clickOnStartedPolicyWizard(); }); }); it( 'C12230925: new policy wizard flight and hotel flow with save and close', { tags: ['@tier1'] }, () => { PolicyWizardPages.setBookNotificationAll(); PolicyWizardPages.clickNextButton(); PolicyWizardPages.setBookingPolicyYes(); PolicyWizardPages.fillFlightAndHotelFlow(); PolicyWizardPages.clickSummaryStageSaveAndClose(); AmplitudeEvents.expectAmplitudeEventsToBeSent(); } ); it( 'C12450528: new policy wizard full flow with save and close', { tags: ['@tier1'] }, () => { PolicyWizardPages.fillEntireWizardFlow(); PolicyWizardPages.clickSaveAndCloseEndOfWizard(); PolicyWizardPages.PolicyWizardCheckPageDataValidation(); AmplitudeEvents.expectAmplitudeEventsToBeSent(); } ); it( 'C12230926: new policy wizard - not right now flow - with save and close', { tags: ['@tier1'] }, () => { PolicyWizardPages.setNotificationsNotRightNowFlow(); PolicyWizardPages.verifyFirstSaveAndCloseNotRightNowFlow(); AmplitudeEvents.expectAmplitudeEventsToBeSent(); } ); it( 'C12450527: new policy wizard flight and hotel flow with out-of-policy notifications - without save and close', { tags: ['@tier1'] }, () => { PolicyWizardPages.fillFlowWithOutOfPolicyAnswer(); AmplitudeEvents.expectAmplitudeEventsToBeSent(); } ); it( 'C12450529: new policy wizard full flow with skip from car to train policy - without save and close', { tags: ['@tier1'] }, () => { PolicyWizardPages.fillFlowWithSkipFromCarToTrainPolicy(); AmplitudeEvents.expectAmplitudeEventsToBeSent(); } ); it( 'C12450530: new policy wizard full flow with navigations (back and forth) all across wizard', { tags: ['@tier1'] }, () => { PolicyWizardPages.policyWizardFlowWithBackNavigations(); } ); });