Skip to content

Commit

Permalink
CU/9788-rachael-detox-onboarding-replace-by-text (#9789)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbontrager authored Oct 7, 2024
1 parent 3362651 commit 08b03a1
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions VAMobile/e2e/tests/Onboarding.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 () => {
Expand All @@ -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()
})

Expand All @@ -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()
})
})

0 comments on commit 08b03a1

Please sign in to comment.