Skip to content

Commit

Permalink
Merge branch 'develop' into jw-ds-publish-checkbox
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicawoodin authored Oct 7, 2024
2 parents b6fccd4 + a712c95 commit 557a017
Show file tree
Hide file tree
Showing 9 changed files with 104 additions and 30 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/e2e_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions VAMobile/e2e/tests/Appeals.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
12 changes: 12 additions & 0 deletions VAMobile/e2e/tests/LoginScreen.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
13 changes: 10 additions & 3 deletions VAMobile/e2e/tests/Messages.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down Expand Up @@ -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')
Expand Down
2 changes: 1 addition & 1 deletion VAMobile/e2e/tests/PushNotifications.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
15 changes: 12 additions & 3 deletions VAMobile/e2e/tests/SignIn.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
42 changes: 31 additions & 11 deletions VAMobile/e2e/tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion VAMobile/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"dependencies": {
"@department-of-veterans-affairs/mobile-assets": "0.13.0",
"@department-of-veterans-affairs/mobile-component-library": "0.21.0",
"@department-of-veterans-affairs/mobile-tokens": "0.16.0",
"@department-of-veterans-affairs/mobile-tokens": "0.17.1",
"@expo/react-native-action-sheet": "^4.1.0",
"@react-native-async-storage/async-storage": "^1.23.1",
"@react-native-firebase/analytics": "^18.9.0",
Expand Down
39 changes: 32 additions & 7 deletions VAMobile/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1478,10 +1478,10 @@
react-native-toast-notifications "^3.4.0"
styled-components "^6.1.12"

"@department-of-veterans-affairs/mobile-tokens@0.16.0":
version "0.16.0"
resolved "https://registry.yarnpkg.com/@department-of-veterans-affairs/mobile-tokens/-/mobile-tokens-0.16.0.tgz#d2f19480a42f41a2c020b0dd0a29b88f8a11fa4d"
integrity sha512-Ek/ZyYxFfpGMz4WriUuRLcGLgSXbCyBLRGakgXyZ3DViX6RIymX3WX4EQT7a7m/YgP3IZ0Y4Aptxhqi+c12Vsg==
"@department-of-veterans-affairs/mobile-tokens@0.17.1":
version "0.17.1"
resolved "https://registry.yarnpkg.com/@department-of-veterans-affairs/mobile-tokens/-/mobile-tokens-0.17.1.tgz#d817f118d7e24e463bfd6f04b120ea48c27e58f1"
integrity sha512-tsT5OgRvDJ8yR2nzyWoCnwb6aluR0OVr7ZQvgCdRTHDPup3mQgrvtfGIhft2VM0WqkEcvr3hwYzMLmycWEMOMg==

"@egjs/hammerjs@^2.0.17":
version "2.0.17"
Expand Down Expand Up @@ -10330,7 +10330,7 @@ string-natural-compare@^3.0.1:
resolved "https://registry.yarnpkg.com/string-natural-compare/-/string-natural-compare-3.0.1.tgz#7a42d58474454963759e8e8b7ae63d71c1e7fdf4"
integrity sha512-n3sPwynL1nwKi3WJ6AIsClwBMa0zTi54fn2oLU6ndfTSIO05xaznjSf15PcBZU6FNWbmN5Q6cxT4V5hGvB4taw==

"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand All @@ -10347,6 +10347,15 @@ string-width@^2.0.0, string-width@^2.1.1:
is-fullwidth-code-point "^2.0.0"
strip-ansi "^4.0.0"

string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

string-width@^5.0.1, string-width@^5.1.2:
version "5.1.2"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-5.1.2.tgz#14f8daec6d81e7221d2a357e668cab73bdbca794"
Expand Down Expand Up @@ -10476,7 +10485,7 @@ string_decoder@~1.1.1:
dependencies:
safe-buffer "~5.1.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand All @@ -10497,6 +10506,13 @@ strip-ansi@^5.0.0, strip-ansi@^5.2.0:
dependencies:
ansi-regex "^4.1.0"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^7.0.1, strip-ansi@^7.1.0:
version "7.1.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45"
Expand Down Expand Up @@ -11365,7 +11381,7 @@ word-wrap@~1.2.3:
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.4.tgz#cb4b50ec9aca570abd1f52f33cd45b6c61739a9f"
integrity sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand All @@ -11383,6 +11399,15 @@ wrap-ansi@^6.2.0:
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"
Expand Down

0 comments on commit 557a017

Please sign in to comment.