Skip to content

Commit

Permalink
CU/9946-rachael-detox-add-comments-to-personalInformationScreen (#10308)
Browse files Browse the repository at this point in the history
  • Loading branch information
rbontrager authored Dec 4, 2024
1 parent bc416c7 commit 792e0c7
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions VAMobile/e2e/tests/PersonalInformationScreen.e2e.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/*
Description:
Detox script that follows the Personal Information, Personal Info - Gender Identity, and Personal Info - Preferred Name test cases found in testRail (VA Mobile App > RC Regression Test > Manual > Profile Page - Elements)
When to update:
This script should be updated whenever new things are added/changed in personal information, gender identity, or preferred name or if anything is changed in src/store/api/demo/mocks/personalInformation.json or src/store/api/demo/mocks/demographics.json.
*/
import { by, device, element, expect, waitFor } from 'detox'
import { setTimeout } from 'timers/promises'

Expand Down Expand Up @@ -32,6 +38,11 @@ export const PersonalInfoConstants = {
PERSONAL_INFO_SCROLL_ID: 'PersonalInformationTestID',
}

/** This function will scroll to and tap the link.
* @param text: String text of either the text of the link (if id is false) or the testID of the link (if id is true)
* @param scrollID: String text of the testID of the page with the scrollView
* @param id: Boolean value for whether the link is searching by.text or by.id
* */
const scrollToThenTap = async (text: string, scrollID?: string, id?: boolean) => {
if (scrollID != undefined) {
await element(by.id(scrollID)).atIndex(0).scrollTo('bottom')
Expand All @@ -47,6 +58,9 @@ const scrollToThenTap = async (text: string, scrollID?: string, id?: boolean) =>
}
}

/** This function will check the nearest VA center and call links. This script is only run on the Android simulator because the iOS simulator does not have phone capabilities
* @param scrollID: String text of the testID of the page with the scrollView
* */
const checkLocatorAndContactLinks = async (scrollID?: string) => {
await device.disableSynchronization()
await scrollToThenTap(PersonalInfoConstants.NEAREST_CENTER_LINK_ID, scrollID, true)
Expand All @@ -67,6 +81,9 @@ const checkLocatorAndContactLinks = async (scrollID?: string) => {
await device.enableSynchronization()
}

/** This function will update the gender identity and verify that the new gender identity is displayed.
* @param genderIdentityOption: String text of the gender identity option to verify
* */
export async function updateGenderIdentify(genderIdentityOption) {
it('should update gender identity for ' + genderIdentityOption, async () => {
await element(by.id(PersonalInfoConstants.PERSONAL_INFO_SCROLL_ID)).scrollTo('bottom')
Expand Down

0 comments on commit 792e0c7

Please sign in to comment.