Skip to content

Commit

Permalink
profile screen row ids
Browse files Browse the repository at this point in the history
  • Loading branch information
TKDickson committed Nov 14, 2024
1 parent 93076c3 commit 20007a9
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 21 deletions.
10 changes: 5 additions & 5 deletions VAMobile/e2e/tests/HomeScreen.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ describe('Home Screen', () => {

it('profile tab tap: verify the profile screen tab items', async () => {
await element(by.text(CommonE2eIdConstants.PROFILE_TAB_BUTTON_TEXT)).tap()
await expect(element(by.text(CommonE2eIdConstants.PERSONAL_INFORMATION_ROW_TEXT))).toExist()
await expect(element(by.text(CommonE2eIdConstants.CONTACT_INFORMATION_TEXT))).toExist()
await expect(element(by.text(CommonE2eIdConstants.MILITARY_INFORMATION_ROW_TEXT))).toExist()
await expect(element(by.text(CommonE2eIdConstants.SETTINGS_ROW_TEXT))).toExist()
await expect(element(by.id(CommonE2eIdConstants.PERSONAL_INFO_BUTTON_ID))).toExist()
await expect(element(by.id(CommonE2eIdConstants.CONTACT_INFO_BUTTON_ID))).toExist()
await expect(element(by.id(CommonE2eIdConstants.MILITARY_HISTORY_BUTTON_ID))).toExist()
await expect(element(by.id(CommonE2eIdConstants.SETTINGS_BUTTON_ID))).toExist()
})

it('home tab tap: verify the home screen tab items', async () => {
Expand Down Expand Up @@ -135,7 +135,7 @@ describe('Home Screen', () => {
.whileElement(by.id(HomeE2eIdConstants.HOME_SCREEN_SCROLL_ID))
.scroll(200, 'down')
await element(by.text(HomeE2eIdConstants.CLAIMS_BUTTON_SUBTEXT_TEXT)).tap()
await expect(element(by.text(CommonE2eIdConstants.CLAIMS_HISTORY_BUTTON_TEXT))).toExist()
await expect(element(by.id(CommonE2eIdConstants.CLAIMS_HISTORY_BUTTON_ID))).toExist()
})

it('taps home then jumps to messages from messages button', async () => {
Expand Down
8 changes: 4 additions & 4 deletions VAMobile/e2e/tests/ProfileScreen.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ describe('Profile Screen', () => {
.toExist()
.withTimeout(6000)

await expect(element(by.text(ProfileE2eIdConstants.PERSONAL_INFO_ROW_TEXT))).toExist()
await expect(element(by.text(ProfileE2eIdConstants.MILITARY_INFO_ROW_TEXT))).toExist()
await expect(element(by.text(ProfileE2eIdConstants.CONTACT_INFO_ROW_TEXT))).toExist()
await expect(element(by.text(CommonE2eIdConstants.SETTINGS_ROW_TEXT))).toExist()
await expect(element(by.id(CommonE2eIdConstants.PERSONAL_INFO_BUTTON_ID))).toExist()
await expect(element(by.id(CommonE2eIdConstants.MILITARY_HISTORY_BUTTON_ID))).toExist()
await expect(element(by.id(CommonE2eIdConstants.CONTACT_INFO_BUTTON_ID))).toExist()
await expect(element(by.id(CommonE2eIdConstants.SETTINGS_BUTTON_ID))).toExist()
})

it('should show profile banner elements', async () => {
Expand Down
20 changes: 11 additions & 9 deletions VAMobile/e2e/tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@ export const CommonE2eIdConstants = {
DIRECT_DEPOSIT_ROW_TEXT: 'Direct deposit information',
BENEFITS_TAB_BUTTON_TEXT: 'Benefits',
HOME_TAB_BUTTON_TEXT: 'Home',
PERSONAL_INFORMATION_ROW_TEXT: 'Personal information',
LETTERS_ROW_TEXT: 'VA letters and documents',
DISABILITY_RATING_ROW_TEXT: 'Disability rating',
SETTINGS_ROW_TEXT: 'Settings',
MILITARY_INFORMATION_ROW_TEXT: 'Military information',
VACCINE_RECORDS_BUTTON_TEXT: 'V\ufeffA vaccine records',
MESSAGES_ROW_TEXT: 'Messages',
BACK_BTN_LABEL: 'Back',
Expand All @@ -52,7 +50,6 @@ export const CommonE2eIdConstants = {
CANCEL_UNIVERSAL_TEXT: 'Cancel',
PRESCRIPTIONS_BUTTON_TEXT: 'Prescriptions',
OK_UNIVERSAL_TEXT: 'OK',
CONTACT_INFORMATION_TEXT: 'Contact information',
VA_PAYMENT_HISTORY_BUTTON_TEXT: 'VA payment history',
CLAIMS_BUTTON_TEXT: 'Claims',
CLAIMS_HISTORY_BUTTON_ID: 'toClaimsHistoryID',
Expand Down Expand Up @@ -97,6 +94,11 @@ export const CommonE2eIdConstants = {
CLAIMS_DETAILS_SCREEN_ID: 'ClaimDetailsScreen',
ALERT_FILE_REQUEST_BUTTON_ID: 'Review file requests',
PRESCRIPTION_HISTORY_SCROLL_ID: 'PrescriptionHistory',
PERSONAL_INFO_BUTTON_ID: 'toPersonalInfoID',
CONTACT_INFO_BUTTON_ID: 'toContactInfoID',
MILITARY_HISTORY_BUTTON_ID: 'toMilitaryHistoryID',
SETTINGS_BUTTON_ID: 'toSettingsID',
PROFILE_SCROLL_ID: 'profileID',
}

/** Log the automation into demo mode
Expand Down Expand Up @@ -317,19 +319,19 @@ export async function openProfile() {
}

export async function openSettings() {
await waitFor(element(by.text(CommonE2eIdConstants.SETTINGS_ROW_TEXT)))
await waitFor(element(by.id(CommonE2eIdConstants.SETTINGS_BUTTON_ID)))
.toBeVisible()
.whileElement(by.id('profileID'))
.whileElement(by.id(CommonE2eIdConstants.PROFILE_SCROLL_ID))
.scroll(50, 'down')
await element(by.text(CommonE2eIdConstants.SETTINGS_ROW_TEXT)).tap()
await element(by.id(CommonE2eIdConstants.SETTINGS_BUTTON_ID)).tap()
}

export async function openPersonalInformation() {
await element(by.text(CommonE2eIdConstants.PERSONAL_INFORMATION_ROW_TEXT)).tap()
await element(by.id(CommonE2eIdConstants.PERSONAL_INFO_BUTTON_ID)).tap()
}

export async function openMilitaryInformation() {
await element(by.text(CommonE2eIdConstants.MILITARY_INFORMATION_ROW_TEXT)).tap()
await element(by.id(CommonE2eIdConstants.MILITARY_HISTORY_BUTTON_ID)).tap()
}

export async function openHealth() {
Expand All @@ -353,7 +355,7 @@ export async function openPrescriptions() {
}

export async function openContactInfo() {
await element(by.text(CommonE2eIdConstants.CONTACT_INFORMATION_TEXT)).tap()
await element(by.id(CommonE2eIdConstants.CONTACT_INFO_BUTTON_ID)).tap()
}

export async function openVAPaymentHistory() {
Expand Down
15 changes: 12 additions & 3 deletions VAMobile/src/screens/HomeScreen/ProfileScreen/ProfileScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,21 @@ function ProfileScreen({ navigation }: ProfileScreenProps) {
<LargeNavButton
title={t('personalInformation.title')}
onPress={() => navigateTo('PersonalInformation')}
testID="toPersonalInfoID"
/>
<LargeNavButton
title={t('contactInformation.title')}
onPress={() => navigateTo('ContactInformation')}
testID="toContactInfoID"
/>
<LargeNavButton title={t('contactInformation.title')} onPress={() => navigateTo('ContactInformation')} />
</>
)}
<LargeNavButton title={t('militaryInformation.title')} onPress={() => navigateTo('MilitaryInformation')} />
<LargeNavButton title={t('settings.title')} onPress={() => navigateTo('Settings')} />
<LargeNavButton
title={t('militaryInformation.title')}
onPress={() => navigateTo('MilitaryInformation')}
testID="toMilitaryHistoryID"
/>
<LargeNavButton title={t('settings.title')} onPress={() => navigateTo('Settings')} testID="toSettingsID" />
{(serviceHistoryError || serviceHistoryInDowntime) && (
<Box mx={theme.dimensions.condensedMarginBetween}>
<CategoryLandingAlert text={t('aboutYou.error.cantShowAllInfo')} isError={serviceHistoryError} />
Expand Down

0 comments on commit 20007a9

Please sign in to comment.