diff --git a/.github/workflows/e2e_ios.yml b/.github/workflows/e2e_ios.yml index bd6d4029e05..d87150e46e8 100644 --- a/.github/workflows/e2e_ios.yml +++ b/.github/workflows/e2e_ios.yml @@ -192,11 +192,11 @@ jobs: id: run_e2e_tests run: | if [[ "${{needs.output_detox_tests_to_run.outputs.output2}}" == "" ]]; then - yarn e2e:ios-test /e2e/tests/${{matrix.testsuite}} --updateSnapshot + yarn e2e:ios-test /e2e/tests/${{matrix.testsuite}} --updateSnapshot --debug-synchronization 15000 echo "NAV_AF_TEST_RUN=" >> "$GITHUB_OUTPUT" else echo "NAV_AF_TEST_RUN=true" >> "$GITHUB_OUTPUT" - yarn e2e:ios-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot + yarn e2e:ios-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot --debug-synchronization 15000 fi continue-on-error: true @@ -206,9 +206,9 @@ jobs: run: | yarn jest:clear; if [[ "${{ steps.run_e2e_tests.outputs.NAV_AF_TEST_RUN}}" != "" ]]; then - yarn e2e:ios-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot + yarn e2e:ios-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot --debug-synchronization 15000 else - yarn e2e:ios-test /e2e/tests/${{matrix.testsuite}} --updateSnapshot + yarn e2e:ios-test /e2e/tests/${{matrix.testsuite}} --updateSnapshot --debug-synchronization 15000 fi - name: Upload e2e-junit diff --git a/VAMobile/e2e/tests/Appeals.e2e.ts b/VAMobile/e2e/tests/Appeals.e2e.ts index e28247e64d0..047591a25f1 100644 --- a/VAMobile/e2e/tests/Appeals.e2e.ts +++ b/VAMobile/e2e/tests/Appeals.e2e.ts @@ -95,6 +95,7 @@ describe('Appeals', () => { await device.launchApp({ newInstance: false }) await device.disableSynchronization() await element(by.id(CommonE2eIdConstants.GO_TO_VA_GOV_LINK_ID)).tap() + await setTimeout(2000) await element(by.text(CommonE2eIdConstants.LEAVING_APP_LEAVE_TEXT)).tap() await setTimeout(5000) await device.takeScreenshot('AppealsNeedHelpGoToVAScreen') diff --git a/VAMobile/e2e/tests/LoginScreen.e2e.ts b/VAMobile/e2e/tests/LoginScreen.e2e.ts index 529a378e345..bb9d37e6a5c 100644 --- a/VAMobile/e2e/tests/LoginScreen.e2e.ts +++ b/VAMobile/e2e/tests/LoginScreen.e2e.ts @@ -10,6 +10,18 @@ export const LoginE2eIdConstants = { describe('Login Screen', () => { it('should show login page content', async () => { + try { + await waitFor(element(by.id(CommonE2eIdConstants.VA_LOGO_ICON_ID))) + .toExist() + .withTimeout(120000) + } catch (ex) { + await device.uninstallApp() + await device.installApp() + await device.launchApp({ newInstance: true, permissions: { notifications: 'YES' } }) + await waitFor(element(by.id(CommonE2eIdConstants.VA_LOGO_ICON_ID))) + .toExist() + .withTimeout(60000) + } await waitFor(element(by.id(LoginE2eIdConstants.LOGIN_PAGE_ID))) .toExist() .withTimeout(60000) diff --git a/VAMobile/e2e/tests/Messages.e2e.ts b/VAMobile/e2e/tests/Messages.e2e.ts index 4c5969e24ae..41b6209dd3c 100644 --- a/VAMobile/e2e/tests/Messages.e2e.ts +++ b/VAMobile/e2e/tests/Messages.e2e.ts @@ -67,9 +67,15 @@ export const MessagesE2eIdConstants = { } const tapItems = async (items: string, type: string) => { - if (type === 'url' || type === 'map' || type === 'email') { - await element(by.id(MessagesE2eIdConstants.VIEW_MESSAGE_ID)).scrollTo('bottom') - } + // if (type === 'url' || type === 'map' || type === 'email') { + // if (items != 'https://www.va.gov/') { + // await element(by.id(MessagesE2eIdConstants.VIEW_MESSAGE_ID)).scrollTo('bottom') + // } + // } + await waitFor(element(by.text(items))) + .toBeVisible() + .whileElement(by.id(MessagesE2eIdConstants.VIEW_MESSAGE_ID)) + .scroll(50, 'down') await device.disableSynchronization() await element(by.text(items)).tap() if (type === 'url' || type === 'map') { @@ -156,6 +162,7 @@ describe('Messages Screen', () => { await tapItems('+18006982411', 'phone') await tapItems('1-800-698-2411.', 'phone') }) + //Currently broken on iOS. Will be fixed with ticket 7679 it(':android: verify url links open', async () => { await tapItems('https://www.va.gov/', 'url') diff --git a/VAMobile/e2e/tests/PushNotifications.e2e.ts b/VAMobile/e2e/tests/PushNotifications.e2e.ts index 59b3d3ea733..ec3984364f6 100644 --- a/VAMobile/e2e/tests/PushNotifications.e2e.ts +++ b/VAMobile/e2e/tests/PushNotifications.e2e.ts @@ -27,7 +27,7 @@ describe(':ios: Push Notifications', () => { newInstance: true, userNotification: mockNotification, }) - await loginToDemoMode() + await loginToDemoMode(true, true) await waitFor(element(by.text(PushNotificationsConstants.REVIEW_MESSAGE_SCREEN_TITLE))) .toExist() .withTimeout(8000) diff --git a/VAMobile/e2e/tests/SignIn.e2e.ts b/VAMobile/e2e/tests/SignIn.e2e.ts index 38249fda11a..fb374333207 100644 --- a/VAMobile/e2e/tests/SignIn.e2e.ts +++ b/VAMobile/e2e/tests/SignIn.e2e.ts @@ -17,9 +17,18 @@ export const SignE2eIdConstants = { describe('Sign In', () => { it('should show sign in page content', async () => { - await waitFor(element(by.id(SignE2eIdConstants.LOGIN_PAGE_ID))) - .toExist() - .withTimeout(20000) + try { + await waitFor(element(by.id(CommonE2eIdConstants.VA_LOGO_ICON_ID))) + .toExist() + .withTimeout(120000) + } catch (ex) { + await device.uninstallApp() + await device.installApp() + await device.launchApp({ newInstance: true, permissions: { notifications: 'YES' } }) + await waitFor(element(by.id(CommonE2eIdConstants.VA_LOGO_ICON_ID))) + .toExist() + .withTimeout(60000) + } await element(by.id(CommonE2eIdConstants.SIGN_IN_BTN_ID)).tap() await expect(element(by.text(CommonE2eIdConstants.VETERAN_CRISIS_LINE_BTN_TEXT))).toExist() diff --git a/VAMobile/e2e/tests/utils.ts b/VAMobile/e2e/tests/utils.ts index 760e58ec147..50fbd567693 100644 --- a/VAMobile/e2e/tests/utils.ts +++ b/VAMobile/e2e/tests/utils.ts @@ -11,6 +11,16 @@ const fs = require('fs') jestExpect.extend({ toMatchImageSnapshot }) const { DEMO_PASSWORD } = getEnv() +const mockNotification = { + trigger: { + type: 'push', + }, + title: 'New Secure Message', + body: 'Review your messages in the health care section of the VA app', + payload: { + url: 'vamobile://messages/2092809', + }, +} export const CommonE2eIdConstants = { VA_LOGO_ICON_ID: 'va-icon', @@ -70,18 +80,28 @@ export const CommonE2eIdConstants = { /** Log the automation into demo mode * */ -export async function loginToDemoMode(skipOnboarding = true) { - await waitFor(element(by.id(CommonE2eIdConstants.VA_LOGO_ICON_ID))) - .toExist() - .withTimeout(60000) +export async function loginToDemoMode(skipOnboarding = true, pushNotifications?: boolean) { try { - await element( - by.text( - "[react-native-gesture-handler] Seems like you're using an old API with gesture components, check out new Gestures system!", - ), - ).tap() - await element(by.text('Dismiss')).tap() - } catch (e) {} + await waitFor(element(by.id(CommonE2eIdConstants.VA_LOGO_ICON_ID))) + .toExist() + .withTimeout(120000) + } catch (ex) { + await device.uninstallApp() + await device.installApp() + if (pushNotifications) { + await device.launchApp({ + delete: true, + permissions: { notifications: 'YES' }, + newInstance: true, + userNotification: mockNotification, + }) + } else { + await device.launchApp({ newInstance: true, permissions: { notifications: 'YES' } }) + } + await waitFor(element(by.id(CommonE2eIdConstants.VA_LOGO_ICON_ID))) + .toExist() + .withTimeout(60000) + } await element(by.id(CommonE2eIdConstants.VA_LOGO_ICON_ID)).multiTap(7) if (DEMO_PASSWORD !== undefined) {