diff --git a/VAMobile/e2e/tests/Onboarding.e2e.ts b/VAMobile/e2e/tests/Onboarding.e2e.ts index 9339a38b768..e0bada940ec 100644 --- a/VAMobile/e2e/tests/Onboarding.e2e.ts +++ b/VAMobile/e2e/tests/Onboarding.e2e.ts @@ -4,6 +4,8 @@ import { CommonE2eIdConstants, checkImages, loginToDemoMode } from './utils' export const OnboardingE2eIdConstants = { VA_ICON_ID: 'VAIconOnboardingLogo', + DONE_NEXT_BUTTON_ID: 'onboardingDoneNextButtonID', + SKIP_BACK_BUTTON_ID: 'onboardingSkipBackButtonID', } beforeAll(async () => { @@ -24,56 +26,56 @@ describe('Onboarding Screen', () => { ), ), ).toExist() - await expect(element(by.text('Skip'))).toExist() - await expect(element(by.text('Next'))).toExist() + await expect(element(by.id(OnboardingE2eIdConstants.SKIP_BACK_BUTTON_ID))).toExist() + await expect(element(by.id(OnboardingE2eIdConstants.DONE_NEXT_BUTTON_ID))).toExist() }) it('should tap next and show the manage your health care content', async () => { - await element(by.text('Next')).tap() + await element(by.id(OnboardingE2eIdConstants.DONE_NEXT_BUTTON_ID)).tap() await expect(element(by.text('Manage your health care'))) await expect(element(by.text('Use our health care tools to manage tasks like these:'))).toExist() await expect(element(by.text('Refill your prescriptions'))).toExist() await expect(element(by.text('Communicate with your health care team'))).toExist() await expect(element(by.text('Review your appointments'))).toExist() - await expect(element(by.text('Back'))).toExist() - await expect(element(by.text('Next'))).toExist() + await expect(element(by.id(OnboardingE2eIdConstants.SKIP_BACK_BUTTON_ID))).toExist() + await expect(element(by.id(OnboardingE2eIdConstants.DONE_NEXT_BUTTON_ID))).toExist() }) it('should tap next and show the manage your benefits content', async () => { - await element(by.text('Next')).tap() + await element(by.id(OnboardingE2eIdConstants.DONE_NEXT_BUTTON_ID)).tap() await expect(element(by.text('Manage your benefits'))).toExist() await expect(element(by.text('Use our benefits tools to manage tasks like these:'))).toExist() await expect(element(by.text('Review your disability rating'))).toExist() await expect(element(by.text('Check the status of your claims and appeals'))).toExist() await expect(element(by.label('Download common V-A letters'))).toExist() - await expect(element(by.text('Back'))).toExist() - await expect(element(by.text('Next'))).toExist() + await expect(element(by.id(OnboardingE2eIdConstants.SKIP_BACK_BUTTON_ID))).toExist() + await expect(element(by.id(OnboardingE2eIdConstants.DONE_NEXT_BUTTON_ID))).toExist() }) it('should tap next and show the manage your payments content', async () => { - await element(by.text('Next')).tap() + await element(by.id(OnboardingE2eIdConstants.DONE_NEXT_BUTTON_ID)).tap() await expect(element(by.text('Manage your payments'))).toExist() await expect(element(by.text('Use our payments tools to manage tasks like these:'))).toExist() await expect(element(by.text('Update your direct deposit information'))).toExist() await expect(element(by.text('Review the history of payments we’ve sent to you'))).toExist() - await expect(element(by.text('Back'))).toExist() - await expect(element(by.text('Done'))).toExist() + await expect(element(by.id(OnboardingE2eIdConstants.SKIP_BACK_BUTTON_ID))).toExist() + await expect(element(by.id(OnboardingE2eIdConstants.DONE_NEXT_BUTTON_ID))).toExist() }) it('should tap back and verify the previous page is displayed', async () => { - await element(by.text('Back')).tap() + await element(by.id(OnboardingE2eIdConstants.SKIP_BACK_BUTTON_ID)).tap() await expect(element(by.text('Manage your benefits'))).toExist() - await element(by.text('Back')).tap() + await element(by.id(OnboardingE2eIdConstants.SKIP_BACK_BUTTON_ID)).tap() await expect(element(by.text('Manage your health care'))).toExist() - await element(by.text('Back')).tap() + await element(by.id(OnboardingE2eIdConstants.SKIP_BACK_BUTTON_ID)).tap() await expect(element(by.text('Welcome, Kimberly'))).toExist() }) it('verify the home page is displayed after tapping done', async () => { - await element(by.text('Next')).tap() - await element(by.text('Next')).tap() - await element(by.text('Next')).tap() - await element(by.text('Done')).tap() + await element(by.id(OnboardingE2eIdConstants.DONE_NEXT_BUTTON_ID)).tap() + await element(by.id(OnboardingE2eIdConstants.DONE_NEXT_BUTTON_ID)).tap() + await element(by.id(OnboardingE2eIdConstants.DONE_NEXT_BUTTON_ID)).tap() + await element(by.id(OnboardingE2eIdConstants.DONE_NEXT_BUTTON_ID)).tap() await expect(element(by.text(CommonE2eIdConstants.HOME_ACTIVITY_HEADER_TEXT))).toExist() }) @@ -82,7 +84,7 @@ describe('Onboarding Screen', () => { await device.installApp() await device.launchApp({ newInstance: true, permissions: { notifications: 'YES' } }) await loginToDemoMode(false) - await element(by.text('Skip')).tap() + await element(by.id(OnboardingE2eIdConstants.SKIP_BACK_BUTTON_ID)).tap() await expect(element(by.text(CommonE2eIdConstants.HOME_ACTIVITY_HEADER_TEXT))).toExist() }) })