UNPKG

qe-fe-automation

Version:
65 lines (59 loc) 2.4 kB
import { AdminClaim, GrowthInterceptApis, LoginSelfSell, ONBOARDING_GUIDE_SELECTORS, OnboardingGuide } from '@growth-lib/index'; import { GrowthRegistrationUrls } from '@growth-lib/model'; import { OnboardByApi } from '@growth-lib/onboard-by-api'; import { Random } from 'cypress/artifacts'; describe('Affiliate: USER onboarding guide', () => { let randomId: string; beforeEach(() => { randomId = Random.randomString(12); GrowthInterceptApis.interceptApis(); }); it.skip( 'C11536369: onboard as self sell user, should not have user onboarding guide for existing company', { tags: ['@tier1', '@onboardingGuideIndependent'] }, () => { const existingCompany = 'dlg7.com'; LoginSelfSell.createNewSelfSellLead({ tag: `user-onboarding-guide-${randomId}`, companyDomain: existingCompany, registrationUrl: GrowthRegistrationUrls.travel }).then((login) => { OnboardByApi.onboardSelfSellRouge(login.token, 'MARKETING_PAGE'); OnboardByApi.loginWithOnboardedUser(); OnboardingGuide.verify(ONBOARDING_GUIDE_SELECTORS.onBoardingGuideButton, 'not.exist'); }); } ); it( 'C11453551: create new Travel company, onboard as self sell user, complete travel tasks and terminate', { tags: ['@tier1', '@onboardingGuideIndependent'] }, () => { LoginSelfSell.createNewSelfSellLead({ tag: `user-onboarding-guide-${randomId}`, registrationUrl: GrowthRegistrationUrls.travel }).then((adminLogin) => { OnboardByApi.onboardSelfSellAdmin(adminLogin.token, 'MARKETING_PAGE'); LoginSelfSell.createNewSelfSellLead({ tag: `user-onboarding-guide-${randomId}-user`, registrationUrl: GrowthRegistrationUrls.travel, companyDomain: adminLogin.companyDomain }).then((userLogin) => { AdminClaim.interceptedToken = ''; OnboardByApi.onboardSelfSellRouge(userLogin.token, 'MARKETING_PAGE'); OnboardByApi.loginWithOnboardedUser(); OnboardingGuide.verifyOnboardingGuideOpen(); OnboardingGuide.verifyUserOnboardingTasks(); OnboardingGuide.cyGetElement(ONBOARDING_GUIDE_SELECTORS.managerName).should('contain', 'test test'); OnboardingGuide.fillAllUserOnboardingTasks(); OnboardingGuide.terminateOnboardingGuide(); }); }); } ); });