From 7d2571933c271f07aa239471d1c2750fb515af2a Mon Sep 17 00:00:00 2001 From: rbontrager Date: Tue, 29 Oct 2024 13:57:58 -0500 Subject: [PATCH 01/74] CU/10055-rachael-detox-add-failed-outside-detox-test-to-testRail --- .github/workflows/e2e_android.yml | 533 +++++++++++++++--------------- 1 file changed, 268 insertions(+), 265 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index c7b675e39a0..99aff2b0f46 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -72,300 +72,300 @@ env: SLACK_API_TOKEN: ${{ secrets.SLACK_API_TOKEN }} jobs: - start_slack_thread: - if: github.event_name == 'schedule' - name: Start Slack thread - uses: ./.github/workflows/start_slack_thread.yml - secrets: inherit - with: - channel_name: va-mobile-build-alerts - message: 'Starting E2E Android tests. Please see :thread: for results. This process may take a while.' + # start_slack_thread: + # if: github.event_name == 'schedule' + # name: Start Slack thread + # uses: ./.github/workflows/start_slack_thread.yml + # secrets: inherit + # with: + # channel_name: va-mobile-build-alerts + # message: 'Starting E2E Android tests. Please see :thread: for results. This process may take a while.' - find_detox_tests_to_run: - if: github.event_name == 'pull_request' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' - uses: ./.github/workflows/e2e_detox_mapping.yml + # find_detox_tests_to_run: + # if: github.event_name == 'pull_request' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' + # uses: ./.github/workflows/e2e_detox_mapping.yml - output_detox_tests_to_run: - runs-on: macos-latest-xl - needs: find_detox_tests_to_run - outputs: - output1: ${{ steps.matrix_value.outputs.matrix }} - output2: ${{ steps.matrix_value.outputs.individual_matrix}} - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - ref: ${{ github.ref }} - - name: 'Get Matrix Value' - id: matrix_value - run: | - if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]] || [[ "${{ inputs.tests_to_run}}" != "" ]]; then - if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]]; then - e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]') - echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT" - echo "individual_matrix=" >> "$GITHUB_OUTPUT" - else - if [[ "${{ inputs.tests_to_run}}" != "" ]]; then - echo "matrix=${{ toJson(inputs.tests_to_run)}}" >> "$GITHUB_OUTPUT" - echo "individual_matrix=true" >> "$GITHUB_OUTPUT" - else - echo "matrix=" >> "$GITHUB_OUTPUT" - fi - fi - else - if [[ "${{ needs.find_detox_tests_to_run.outputs.test_run }}" != "" ]]; then - echo "${{needs.find_detox_tests_to_run.outputs.test_matrix}}" - if [[ "${{needs.find_detox_tests_to_run.outputs.test_matrix}}" == "[]" ]]; then - if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]]; then - e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]') - echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT" - echo "individual_matrix=" >> "$GITHUB_OUTPUT" - else - if [[ "${{ inputs.tests_to_run}}" != "" ]]; then - echo "matrix=${{ toJson(inputs.tests_to_run)}}" >> "$GITHUB_OUTPUT" - echo "individual_matrix=true" >> "$GITHUB_OUTPUT" - else - echo "matrix=" >> "$GITHUB_OUTPUT" - fi - fi - else - resp=${{toJson(needs.find_detox_tests_to_run.outputs.test_matrix)}} - echo "matrix=$resp" >> "$GITHUB_OUTPUT" - fi - fi - fi - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # output_detox_tests_to_run: + # runs-on: macos-latest-xl + # needs: find_detox_tests_to_run + # outputs: + # output1: ${{ steps.matrix_value.outputs.matrix }} + # output2: ${{ steps.matrix_value.outputs.individual_matrix}} + # steps: + # - name: Checkout + # uses: actions/checkout@v3 + # with: + # ref: ${{ github.ref }} + # - name: 'Get Matrix Value' + # id: matrix_value + # run: | + # if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]] || [[ "${{ inputs.tests_to_run}}" != "" ]]; then + # if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]]; then + # e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]') + # echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT" + # echo "individual_matrix=" >> "$GITHUB_OUTPUT" + # else + # if [[ "${{ inputs.tests_to_run}}" != "" ]]; then + # echo "matrix=${{ toJson(inputs.tests_to_run)}}" >> "$GITHUB_OUTPUT" + # echo "individual_matrix=true" >> "$GITHUB_OUTPUT" + # else + # echo "matrix=" >> "$GITHUB_OUTPUT" + # fi + # fi + # else + # if [[ "${{ needs.find_detox_tests_to_run.outputs.test_run }}" != "" ]]; then + # echo "${{needs.find_detox_tests_to_run.outputs.test_matrix}}" + # if [[ "${{needs.find_detox_tests_to_run.outputs.test_matrix}}" == "[]" ]]; then + # if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]]; then + # e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]') + # echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT" + # echo "individual_matrix=" >> "$GITHUB_OUTPUT" + # else + # if [[ "${{ inputs.tests_to_run}}" != "" ]]; then + # echo "matrix=${{ toJson(inputs.tests_to_run)}}" >> "$GITHUB_OUTPUT" + # echo "individual_matrix=true" >> "$GITHUB_OUTPUT" + # else + # echo "matrix=" >> "$GITHUB_OUTPUT" + # fi + # fi + # else + # resp=${{toJson(needs.find_detox_tests_to_run.outputs.test_matrix)}} + # echo "matrix=$resp" >> "$GITHUB_OUTPUT" + # fi + # fi + # fi + # env: + # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - matrix-e2e-android: - if: (!cancelled()) && needs.output_detox_tests_to_run.outputs.output1 != '' - runs-on: macos-latest-xl - needs: [start_slack_thread, output_detox_tests_to_run] - strategy: - fail-fast: false - matrix: - testsuite: ${{fromJson(needs.output_detox_tests_to_run.outputs.output1)}} + # matrix-e2e-android: + # if: (!cancelled()) && needs.output_detox_tests_to_run.outputs.output1 != '' + # runs-on: macos-latest-xl + # needs: [start_slack_thread, output_detox_tests_to_run] + # strategy: + # fail-fast: false + # matrix: + # testsuite: ${{fromJson(needs.output_detox_tests_to_run.outputs.output1)}} - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ github.ref }} + # steps: + # - uses: actions/checkout@v3 + # with: + # ref: ${{ github.ref }} - - name: Set git config - run: | - git config --global user.name 'VA Automation Bot' - git config --global user.email 'va-mobileapp@adhocteam.us' + # - name: Set git config + # run: | + # git config --global user.name 'VA Automation Bot' + # git config --global user.email 'va-mobileapp@adhocteam.us' - - name: Decode base64 encoded keys - working-directory: VAMobile/android - run: | - mkdir keys - cd keys - echo "${{ secrets.GOOGLE_KS }}" | base64 --decode > vamobile - echo "${{ secrets.GOOGLE_SA_JSON }}" | base64 --decode > service-account.json - echo "${{ secrets.FIREBASE_DIST_FILE_BASE64 }}" | base64 --decode > firebase-dist.json - cd ../app - echo "${{ secrets.GOOGLE_SERVICES_JSON }}" | base64 --decode > google-services.json + # - name: Decode base64 encoded keys + # working-directory: VAMobile/android + # run: | + # mkdir keys + # cd keys + # echo "${{ secrets.GOOGLE_KS }}" | base64 --decode > vamobile + # echo "${{ secrets.GOOGLE_SA_JSON }}" | base64 --decode > service-account.json + # echo "${{ secrets.FIREBASE_DIST_FILE_BASE64 }}" | base64 --decode > firebase-dist.json + # cd ../app + # echo "${{ secrets.GOOGLE_SERVICES_JSON }}" | base64 --decode > google-services.json - - name: Setup ruby and restore bundler cache - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.0.2' - bundler-cache: true - working-directory: VAMobile/android + # - name: Setup ruby and restore bundler cache + # uses: ruby/setup-ruby@v1 + # with: + # ruby-version: '3.0.2' + # bundler-cache: true + # working-directory: VAMobile/android - - name: Set up JDK - uses: actions/setup-java@v3 - with: - java-version: 17 - distribution: 'microsoft' + # - name: Set up JDK + # uses: actions/setup-java@v3 + # with: + # java-version: 17 + # distribution: 'microsoft' - - name: Setup node and restore yarn cache - uses: actions/setup-node@v3 - with: - node-version-file: 'VAMobile/.nvmrc' - cache: 'yarn' - cache-dependency-path: './VAMobile/yarn.lock' + # - name: Setup node and restore yarn cache + # uses: actions/setup-node@v3 + # with: + # node-version-file: 'VAMobile/.nvmrc' + # cache: 'yarn' + # cache-dependency-path: './VAMobile/yarn.lock' - - name: Install npm dependencies - run: yarn install --frozen-lockfile --non-interactive + # - name: Install npm dependencies + # run: yarn install --frozen-lockfile --non-interactive - - name: Set app environment variables - run: yarn env:staging + # - name: Set app environment variables + # run: yarn env:staging - - name: Bundle Android app - run: yarn e2e:android-build + # - name: Bundle Android app + # run: yarn e2e:android-build - - name: Run e2e tests for Android - Full Test - id: run_e2e_tests - if: ${{needs.output_detox_tests_to_run.outputs.output2 == ''}} - uses: reactivecircus/android-emulator-runner@v2 - with: - working-directory: VAMobile - api-level: 28 - profile: pixel_6_pro - force-avd-creation: false - disable-animations: true - arch: x86_64 - avd-name: Pixel_4_XL_API_28 - script: yarn e2e:android-test /e2e/tests/${{matrix.testsuite}} --updateSnapshot - continue-on-error: true + # - name: Run e2e tests for Android - Full Test + # id: run_e2e_tests + # if: ${{needs.output_detox_tests_to_run.outputs.output2 == ''}} + # uses: reactivecircus/android-emulator-runner@v2 + # with: + # working-directory: VAMobile + # api-level: 28 + # profile: pixel_6_pro + # force-avd-creation: false + # disable-animations: true + # arch: x86_64 + # avd-name: Pixel_4_XL_API_28 + # script: yarn e2e:android-test /e2e/tests/${{matrix.testsuite}} --updateSnapshot + # continue-on-error: true - - name: Run e2e tests for Android - id: run_e2e_tests_nav_AF - if: ${{needs.output_detox_tests_to_run.outputs.output2 != ''}} - uses: reactivecircus/android-emulator-runner@v2 - with: - working-directory: VAMobile - api-level: 28 - profile: pixel_6_pro - force-avd-creation: false - disable-animations: true - arch: x86_64 - avd-name: Pixel_4_XL_API_28 - script: yarn e2e:android-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot + # - name: Run e2e tests for Android + # id: run_e2e_tests_nav_AF + # if: ${{needs.output_detox_tests_to_run.outputs.output2 != ''}} + # uses: reactivecircus/android-emulator-runner@v2 + # with: + # working-directory: VAMobile + # api-level: 28 + # profile: pixel_6_pro + # force-avd-creation: false + # disable-animations: true + # arch: x86_64 + # avd-name: Pixel_4_XL_API_28 + # script: yarn e2e:android-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot - - name: Run e2e tests for Android on failure - if: failure() && steps.run_e2e_tests_nav_AF.outcome == 'failure' - uses: reactivecircus/android-emulator-runner@v2 - with: - working-directory: VAMobile - api-level: 28 - profile: pixel_6_pro - force-avd-creation: false - disable-animations: true - arch: x86_64 - avd-name: Pixel_4_XL_API_28 - script: yarn e2e:android-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot + # - name: Run e2e tests for Android on failure + # if: failure() && steps.run_e2e_tests_nav_AF.outcome == 'failure' + # uses: reactivecircus/android-emulator-runner@v2 + # with: + # working-directory: VAMobile + # api-level: 28 + # profile: pixel_6_pro + # force-avd-creation: false + # disable-animations: true + # arch: x86_64 + # avd-name: Pixel_4_XL_API_28 + # script: yarn e2e:android-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot - - name: Upload e2e-junit - if: failure() || success() - uses: actions/upload-artifact@v4 - with: - name: ${{matrix.testsuite}}-e2e-junit - path: VAMobile/e2e/test_reports/e2e-junit.xml + # - name: Upload e2e-junit + # if: failure() || success() + # uses: actions/upload-artifact@v4 + # with: + # name: ${{matrix.testsuite}}-e2e-junit + # path: VAMobile/e2e/test_reports/e2e-junit.xml - - name: Upload artifacts on failure - if: failure() || steps.run_e2e_tests.outcome == 'failure' - uses: actions/upload-artifact@v4 - with: - name: detox-artifacts-${{ runner.os }}-${{ github.run_id }}-${{matrix.testsuite}} - path: VAMobile/artifacts - retention-days: 1 + # - name: Upload artifacts on failure + # if: failure() || steps.run_e2e_tests.outcome == 'failure' + # uses: actions/upload-artifact@v4 + # with: + # name: detox-artifacts-${{ runner.os }}-${{ github.run_id }}-${{matrix.testsuite}} + # path: VAMobile/artifacts + # retention-days: 1 - - name: Fail workflow if needed(View e2e step for details) - if: steps.run_e2e_tests.outcome == 'failure' - run: exit 1 + # - name: Fail workflow if needed(View e2e step for details) + # if: steps.run_e2e_tests.outcome == 'failure' + # run: exit 1 - output-slack-results-and-update-detox-failure-ticket: - if: (!cancelled()) && github.event_name == 'schedule' - needs: [matrix-e2e-android, start_slack_thread] - runs-on: macos-latest-xl - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ github.ref }} + # output-slack-results-and-update-detox-failure-ticket: + # if: (!cancelled()) && github.event_name == 'schedule' + # needs: [matrix-e2e-android, start_slack_thread] + # runs-on: macos-latest-xl + # steps: + # - uses: actions/checkout@v3 + # with: + # ref: ${{ github.ref }} - - name: Download results - uses: actions/download-artifact@v4 - with: - path: VAMobile/e2e/test_reports + # - name: Download results + # uses: actions/download-artifact@v4 + # with: + # path: VAMobile/e2e/test_reports - - name: Inform Slack - id: inform_slack - shell: bash - run: | - if grep -rq "" .; then - echo SLACK_THREAD_TS=${ts} >> $GITHUB_OUTPUT - ts=$(curl -X POST -H 'Authorization: Bearer '"$SLACK_API_TOKEN"' ' \ - -H 'Content-type: application/json' \ - --data '{"channel":"'${{needs.start_slack_thread.outputs.channel_id}}'","thread_ts":"'${{needs.start_slack_thread.outputs.thread_ts}}'","text":"Failed! Please check workflow for results: https://github.com/department-of-veterans-affairs/va-mobile-app/actions"}' \ - https://slack.com/api/chat.postMessage| - jq -r '.ts') - echo SLACK_THREAD_TS=${ts} >> $GITHUB_OUTPUT - echo "TEST_FAILURE=true" >> "$GITHUB_OUTPUT" - else - ts=$(curl -X POST -H 'Authorization: Bearer '"$SLACK_API_TOKEN"' ' \ - -H 'Content-type: application/json' \ - --data '{"channel":"'${{needs.start_slack_thread.outputs.channel_id}}'","thread_ts":"'${{needs.start_slack_thread.outputs.thread_ts}}'","text":"Success! All E2E tests have passed"}' \ - https://slack.com/api/chat.postMessage| - jq -r '.ts') - fi + # - name: Inform Slack + # id: inform_slack + # shell: bash + # run: | + # if grep -rq "" .; then + # echo SLACK_THREAD_TS=${ts} >> $GITHUB_OUTPUT + # ts=$(curl -X POST -H 'Authorization: Bearer '"$SLACK_API_TOKEN"' ' \ + # -H 'Content-type: application/json' \ + # --data '{"channel":"'${{needs.start_slack_thread.outputs.channel_id}}'","thread_ts":"'${{needs.start_slack_thread.outputs.thread_ts}}'","text":"Failed! Please check workflow for results: https://github.com/department-of-veterans-affairs/va-mobile-app/actions"}' \ + # https://slack.com/api/chat.postMessage| + # jq -r '.ts') + # echo SLACK_THREAD_TS=${ts} >> $GITHUB_OUTPUT + # echo "TEST_FAILURE=true" >> "$GITHUB_OUTPUT" + # else + # ts=$(curl -X POST -H 'Authorization: Bearer '"$SLACK_API_TOKEN"' ' \ + # -H 'Content-type: application/json' \ + # --data '{"channel":"'${{needs.start_slack_thread.outputs.channel_id}}'","thread_ts":"'${{needs.start_slack_thread.outputs.thread_ts}}'","text":"Success! All E2E tests have passed"}' \ + # https://slack.com/api/chat.postMessage| + # jq -r '.ts') + # fi - - name: Find failing tests - id: failing_tests - shell: bash - run: | - if grep -rq "" .; then - failing_tests_list=$(grep -rl "") - failing_tests="" - for i in ${failing_tests_list[@]}; do - remove_before=${i%.ts*} - remove_after=${remove_before#*test_reports/} - echo "$remove_after" - if [ -z "${failing_tests}" ]; then - failing_tests=$(echo $failing_tests"$remove_after") - else - failing_tests=$(echo $failing_tests", ""$remove_after") - fi - done - echo "FAILING_TEST=$failing_tests" >> "$GITHUB_OUTPUT" - fi + # - name: Find failing tests + # id: failing_tests + # shell: bash + # run: | + # if grep -rq "" .; then + # failing_tests_list=$(grep -rl "") + # failing_tests="" + # for i in ${failing_tests_list[@]}; do + # remove_before=${i%.ts*} + # remove_after=${remove_before#*test_reports/} + # echo "$remove_after" + # if [ -z "${failing_tests}" ]; then + # failing_tests=$(echo $failing_tests"$remove_after") + # else + # failing_tests=$(echo $failing_tests", ""$remove_after") + # fi + # done + # echo "FAILING_TEST=$failing_tests" >> "$GITHUB_OUTPUT" + # fi - - name: Github CLI Authentication - run: | - echo "${{ secrets.GITHUB_TOKEN }}" >> token.txt - gh auth login --with-token < token.txt + # - name: Github CLI Authentication + # run: | + # echo "${{ secrets.GITHUB_TOKEN }}" >> token.txt + # gh auth login --with-token < token.txt - - name: Update a ticket on failure (if needed) - if: steps.inform_slack.outputs.TEST_FAILURE != '' - id: find_if_ticket_already_exists - run: | - old_body=$(gh issue list --json body --jq '.[] | .body' --state open --search "Bug - Detox - Fix Overnight Failures in:title") - if [[ "$old_body" != "" ]]; then - ticket_number=$(gh issue list --json number --jq '.[] | .number' --state open --search "Bug - Detox - Fix Overnight Failures in:title") - new_body=$(echo "$old_body"$'\n'"- "${{ env.DATE_OF_ISSUE}}" on Android: "${{steps.failing_tests.outputs.FAILING_TEST}}) - echo "$new_body" - echo "TICKET_EXISTS=true" >> "$GITHUB_OUTPUT" - gh issue edit $ticket_number -b "$new_body" - else - echo "TICKET_EXISTS=" >> "$GITHUB_OUTPUT" - fi - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - name: Update a ticket on failure (if needed) + # if: steps.inform_slack.outputs.TEST_FAILURE != '' + # id: find_if_ticket_already_exists + # run: | + # old_body=$(gh issue list --json body --jq '.[] | .body' --state open --search "Bug - Detox - Fix Overnight Failures in:title") + # if [[ "$old_body" != "" ]]; then + # ticket_number=$(gh issue list --json number --jq '.[] | .number' --state open --search "Bug - Detox - Fix Overnight Failures in:title") + # new_body=$(echo "$old_body"$'\n'"- "${{ env.DATE_OF_ISSUE}}" on Android: "${{steps.failing_tests.outputs.FAILING_TEST}}) + # echo "$new_body" + # echo "TICKET_EXISTS=true" >> "$GITHUB_OUTPUT" + # gh issue edit $ticket_number -b "$new_body" + # else + # echo "TICKET_EXISTS=" >> "$GITHUB_OUTPUT" + # fi + # env: + # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Make a ticket on failure (if needed) - if: steps.inform_slack.outputs.TEST_FAILURE != '' && steps.find_if_ticket_already_exists.outputs.TICKET_EXISTS == '' - uses: JasonEtco/create-an-issue@v2 - with: - filename: .github/ISSUE_TEMPLATE/detox_nightly_build_failure.md - search_existing: open - env: - dateOfIssue: ${{ env.DATE_OF_ISSUE }} - OS: "Android" - issues: ${{steps.failing_tests.outputs.FAILING_TEST}} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - id: create-issue + # - name: Make a ticket on failure (if needed) + # if: steps.inform_slack.outputs.TEST_FAILURE != '' && steps.find_if_ticket_already_exists.outputs.TICKET_EXISTS == '' + # uses: JasonEtco/create-an-issue@v2 + # with: + # filename: .github/ISSUE_TEMPLATE/detox_nightly_build_failure.md + # search_existing: open + # env: + # dateOfIssue: ${{ env.DATE_OF_ISSUE }} + # OS: "Android" + # issues: ${{steps.failing_tests.outputs.FAILING_TEST}} + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # id: create-issue - matrix_send_test_results_to_testrail: - if: (!cancelled()) && github.event.inputs.run_testRail == 'true' - needs: [matrix-e2e-android, output_detox_tests_to_run] - strategy: - fail-fast: false - max-parallel: 1 - matrix: - testsuite: ${{ fromJSON(needs.output_detox_tests_to_run.outputs.output1) }} - name: Update testRail Results - uses: ./.github/workflows/update_testrail_results.yml - with: - test_names: "${{matrix.testsuite}}" - testRail_name: ${{ inputs.testRail_name }} - test_OS_name: "Android" - secrets: inherit + # matrix_send_test_results_to_testrail: + # if: (!cancelled()) && github.event.inputs.run_testRail == 'true' + # needs: [matrix-e2e-android, output_detox_tests_to_run] + # strategy: + # fail-fast: false + # max-parallel: 1 + # matrix: + # testsuite: ${{ fromJSON(needs.output_detox_tests_to_run.outputs.output1) }} + # name: Update testRail Results + # uses: ./.github/workflows/update_testrail_results.yml + # with: + # test_names: "${{matrix.testsuite}}" + # testRail_name: ${{ inputs.testRail_name }} + # test_OS_name: "Android" + # secrets: inherit update-test-names: if: (!cancelled()) && github.event.inputs.run_testRail == 'true' - needs: [matrix-e2e-android, output_detox_tests_to_run, matrix_send_test_results_to_testrail] + #needs: [matrix-e2e-android, output_detox_tests_to_run, matrix_send_test_results_to_testrail] continue-on-error: false runs-on: ubuntu-latest steps: @@ -384,6 +384,9 @@ jobs: break fi done + getTest=$(curl -X GET -H 'Content-Type: application/json' \ + -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ + "https://dsvavsp.testrail.io//index.php?/api/v2/get_test/43942") getTestCaseNewName=$(jq --compact-output -s 'add' input.json) groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]') getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]') From b4c30c8d3dfbb1df013846af9ec925633dc34f66 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Tue, 29 Oct 2024 14:03:22 -0500 Subject: [PATCH 02/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 528 +++++++++++++++--------------- 1 file changed, 264 insertions(+), 264 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 99aff2b0f46..1bb15d125fe 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -72,296 +72,296 @@ env: SLACK_API_TOKEN: ${{ secrets.SLACK_API_TOKEN }} jobs: - # start_slack_thread: - # if: github.event_name == 'schedule' - # name: Start Slack thread - # uses: ./.github/workflows/start_slack_thread.yml - # secrets: inherit - # with: - # channel_name: va-mobile-build-alerts - # message: 'Starting E2E Android tests. Please see :thread: for results. This process may take a while.' + start_slack_thread: + if: github.event_name == 'schedule' + name: Start Slack thread + uses: ./.github/workflows/start_slack_thread.yml + secrets: inherit + with: + channel_name: va-mobile-build-alerts + message: 'Starting E2E Android tests. Please see :thread: for results. This process may take a while.' - # find_detox_tests_to_run: - # if: github.event_name == 'pull_request' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' - # uses: ./.github/workflows/e2e_detox_mapping.yml + find_detox_tests_to_run: + if: github.event_name == 'pull_request' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' + uses: ./.github/workflows/e2e_detox_mapping.yml - # output_detox_tests_to_run: - # runs-on: macos-latest-xl - # needs: find_detox_tests_to_run - # outputs: - # output1: ${{ steps.matrix_value.outputs.matrix }} - # output2: ${{ steps.matrix_value.outputs.individual_matrix}} - # steps: - # - name: Checkout - # uses: actions/checkout@v3 - # with: - # ref: ${{ github.ref }} - # - name: 'Get Matrix Value' - # id: matrix_value - # run: | - # if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]] || [[ "${{ inputs.tests_to_run}}" != "" ]]; then - # if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]]; then - # e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]') - # echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT" - # echo "individual_matrix=" >> "$GITHUB_OUTPUT" - # else - # if [[ "${{ inputs.tests_to_run}}" != "" ]]; then - # echo "matrix=${{ toJson(inputs.tests_to_run)}}" >> "$GITHUB_OUTPUT" - # echo "individual_matrix=true" >> "$GITHUB_OUTPUT" - # else - # echo "matrix=" >> "$GITHUB_OUTPUT" - # fi - # fi - # else - # if [[ "${{ needs.find_detox_tests_to_run.outputs.test_run }}" != "" ]]; then - # echo "${{needs.find_detox_tests_to_run.outputs.test_matrix}}" - # if [[ "${{needs.find_detox_tests_to_run.outputs.test_matrix}}" == "[]" ]]; then - # if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]]; then - # e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]') - # echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT" - # echo "individual_matrix=" >> "$GITHUB_OUTPUT" - # else - # if [[ "${{ inputs.tests_to_run}}" != "" ]]; then - # echo "matrix=${{ toJson(inputs.tests_to_run)}}" >> "$GITHUB_OUTPUT" - # echo "individual_matrix=true" >> "$GITHUB_OUTPUT" - # else - # echo "matrix=" >> "$GITHUB_OUTPUT" - # fi - # fi - # else - # resp=${{toJson(needs.find_detox_tests_to_run.outputs.test_matrix)}} - # echo "matrix=$resp" >> "$GITHUB_OUTPUT" - # fi - # fi - # fi - # env: - # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + output_detox_tests_to_run: + runs-on: macos-latest-xl + needs: find_detox_tests_to_run + outputs: + output1: ${{ steps.matrix_value.outputs.matrix }} + output2: ${{ steps.matrix_value.outputs.individual_matrix}} + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ github.ref }} + - name: 'Get Matrix Value' + id: matrix_value + run: | + if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]] || [[ "${{ inputs.tests_to_run}}" != "" ]]; then + if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]]; then + e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]') + echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT" + echo "individual_matrix=" >> "$GITHUB_OUTPUT" + else + if [[ "${{ inputs.tests_to_run}}" != "" ]]; then + echo "matrix=${{ toJson(inputs.tests_to_run)}}" >> "$GITHUB_OUTPUT" + echo "individual_matrix=true" >> "$GITHUB_OUTPUT" + else + echo "matrix=" >> "$GITHUB_OUTPUT" + fi + fi + else + if [[ "${{ needs.find_detox_tests_to_run.outputs.test_run }}" != "" ]]; then + echo "${{needs.find_detox_tests_to_run.outputs.test_matrix}}" + if [[ "${{needs.find_detox_tests_to_run.outputs.test_matrix}}" == "[]" ]]; then + if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]]; then + e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]') + echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT" + echo "individual_matrix=" >> "$GITHUB_OUTPUT" + else + if [[ "${{ inputs.tests_to_run}}" != "" ]]; then + echo "matrix=${{ toJson(inputs.tests_to_run)}}" >> "$GITHUB_OUTPUT" + echo "individual_matrix=true" >> "$GITHUB_OUTPUT" + else + echo "matrix=" >> "$GITHUB_OUTPUT" + fi + fi + else + resp=${{toJson(needs.find_detox_tests_to_run.outputs.test_matrix)}} + echo "matrix=$resp" >> "$GITHUB_OUTPUT" + fi + fi + fi + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # matrix-e2e-android: - # if: (!cancelled()) && needs.output_detox_tests_to_run.outputs.output1 != '' - # runs-on: macos-latest-xl - # needs: [start_slack_thread, output_detox_tests_to_run] - # strategy: - # fail-fast: false - # matrix: - # testsuite: ${{fromJson(needs.output_detox_tests_to_run.outputs.output1)}} + matrix-e2e-android: + if: (!cancelled()) && needs.output_detox_tests_to_run.outputs.output1 != '' + runs-on: macos-latest-xl + needs: [start_slack_thread, output_detox_tests_to_run] + strategy: + fail-fast: false + matrix: + testsuite: ${{fromJson(needs.output_detox_tests_to_run.outputs.output1)}} - # steps: - # - uses: actions/checkout@v3 - # with: - # ref: ${{ github.ref }} + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.ref }} - # - name: Set git config - # run: | - # git config --global user.name 'VA Automation Bot' - # git config --global user.email 'va-mobileapp@adhocteam.us' + - name: Set git config + run: | + git config --global user.name 'VA Automation Bot' + git config --global user.email 'va-mobileapp@adhocteam.us' - # - name: Decode base64 encoded keys - # working-directory: VAMobile/android - # run: | - # mkdir keys - # cd keys - # echo "${{ secrets.GOOGLE_KS }}" | base64 --decode > vamobile - # echo "${{ secrets.GOOGLE_SA_JSON }}" | base64 --decode > service-account.json - # echo "${{ secrets.FIREBASE_DIST_FILE_BASE64 }}" | base64 --decode > firebase-dist.json - # cd ../app - # echo "${{ secrets.GOOGLE_SERVICES_JSON }}" | base64 --decode > google-services.json + - name: Decode base64 encoded keys + working-directory: VAMobile/android + run: | + mkdir keys + cd keys + echo "${{ secrets.GOOGLE_KS }}" | base64 --decode > vamobile + echo "${{ secrets.GOOGLE_SA_JSON }}" | base64 --decode > service-account.json + echo "${{ secrets.FIREBASE_DIST_FILE_BASE64 }}" | base64 --decode > firebase-dist.json + cd ../app + echo "${{ secrets.GOOGLE_SERVICES_JSON }}" | base64 --decode > google-services.json - # - name: Setup ruby and restore bundler cache - # uses: ruby/setup-ruby@v1 - # with: - # ruby-version: '3.0.2' - # bundler-cache: true - # working-directory: VAMobile/android + - name: Setup ruby and restore bundler cache + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.0.2' + bundler-cache: true + working-directory: VAMobile/android - # - name: Set up JDK - # uses: actions/setup-java@v3 - # with: - # java-version: 17 - # distribution: 'microsoft' + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'microsoft' - # - name: Setup node and restore yarn cache - # uses: actions/setup-node@v3 - # with: - # node-version-file: 'VAMobile/.nvmrc' - # cache: 'yarn' - # cache-dependency-path: './VAMobile/yarn.lock' + - name: Setup node and restore yarn cache + uses: actions/setup-node@v3 + with: + node-version-file: 'VAMobile/.nvmrc' + cache: 'yarn' + cache-dependency-path: './VAMobile/yarn.lock' - # - name: Install npm dependencies - # run: yarn install --frozen-lockfile --non-interactive + - name: Install npm dependencies + run: yarn install --frozen-lockfile --non-interactive - # - name: Set app environment variables - # run: yarn env:staging + - name: Set app environment variables + run: yarn env:staging - # - name: Bundle Android app - # run: yarn e2e:android-build + - name: Bundle Android app + run: yarn e2e:android-build - # - name: Run e2e tests for Android - Full Test - # id: run_e2e_tests - # if: ${{needs.output_detox_tests_to_run.outputs.output2 == ''}} - # uses: reactivecircus/android-emulator-runner@v2 - # with: - # working-directory: VAMobile - # api-level: 28 - # profile: pixel_6_pro - # force-avd-creation: false - # disable-animations: true - # arch: x86_64 - # avd-name: Pixel_4_XL_API_28 - # script: yarn e2e:android-test /e2e/tests/${{matrix.testsuite}} --updateSnapshot - # continue-on-error: true + - name: Run e2e tests for Android - Full Test + id: run_e2e_tests + if: ${{needs.output_detox_tests_to_run.outputs.output2 == ''}} + uses: reactivecircus/android-emulator-runner@v2 + with: + working-directory: VAMobile + api-level: 28 + profile: pixel_6_pro + force-avd-creation: false + disable-animations: true + arch: x86_64 + avd-name: Pixel_4_XL_API_28 + script: yarn e2e:android-test /e2e/tests/${{matrix.testsuite}} --updateSnapshot + continue-on-error: true - # - name: Run e2e tests for Android - # id: run_e2e_tests_nav_AF - # if: ${{needs.output_detox_tests_to_run.outputs.output2 != ''}} - # uses: reactivecircus/android-emulator-runner@v2 - # with: - # working-directory: VAMobile - # api-level: 28 - # profile: pixel_6_pro - # force-avd-creation: false - # disable-animations: true - # arch: x86_64 - # avd-name: Pixel_4_XL_API_28 - # script: yarn e2e:android-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot + - name: Run e2e tests for Android + id: run_e2e_tests_nav_AF + if: ${{needs.output_detox_tests_to_run.outputs.output2 != ''}} + uses: reactivecircus/android-emulator-runner@v2 + with: + working-directory: VAMobile + api-level: 28 + profile: pixel_6_pro + force-avd-creation: false + disable-animations: true + arch: x86_64 + avd-name: Pixel_4_XL_API_28 + script: yarn e2e:android-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot - # - name: Run e2e tests for Android on failure - # if: failure() && steps.run_e2e_tests_nav_AF.outcome == 'failure' - # uses: reactivecircus/android-emulator-runner@v2 - # with: - # working-directory: VAMobile - # api-level: 28 - # profile: pixel_6_pro - # force-avd-creation: false - # disable-animations: true - # arch: x86_64 - # avd-name: Pixel_4_XL_API_28 - # script: yarn e2e:android-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot + - name: Run e2e tests for Android on failure + if: failure() && steps.run_e2e_tests_nav_AF.outcome == 'failure' + uses: reactivecircus/android-emulator-runner@v2 + with: + working-directory: VAMobile + api-level: 28 + profile: pixel_6_pro + force-avd-creation: false + disable-animations: true + arch: x86_64 + avd-name: Pixel_4_XL_API_28 + script: yarn e2e:android-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot - # - name: Upload e2e-junit - # if: failure() || success() - # uses: actions/upload-artifact@v4 - # with: - # name: ${{matrix.testsuite}}-e2e-junit - # path: VAMobile/e2e/test_reports/e2e-junit.xml + - name: Upload e2e-junit + if: failure() || success() + uses: actions/upload-artifact@v4 + with: + name: ${{matrix.testsuite}}-e2e-junit + path: VAMobile/e2e/test_reports/e2e-junit.xml - # - name: Upload artifacts on failure - # if: failure() || steps.run_e2e_tests.outcome == 'failure' - # uses: actions/upload-artifact@v4 - # with: - # name: detox-artifacts-${{ runner.os }}-${{ github.run_id }}-${{matrix.testsuite}} - # path: VAMobile/artifacts - # retention-days: 1 + - name: Upload artifacts on failure + if: failure() || steps.run_e2e_tests.outcome == 'failure' + uses: actions/upload-artifact@v4 + with: + name: detox-artifacts-${{ runner.os }}-${{ github.run_id }}-${{matrix.testsuite}} + path: VAMobile/artifacts + retention-days: 1 - # - name: Fail workflow if needed(View e2e step for details) - # if: steps.run_e2e_tests.outcome == 'failure' - # run: exit 1 + - name: Fail workflow if needed(View e2e step for details) + if: steps.run_e2e_tests.outcome == 'failure' + run: exit 1 - # output-slack-results-and-update-detox-failure-ticket: - # if: (!cancelled()) && github.event_name == 'schedule' - # needs: [matrix-e2e-android, start_slack_thread] - # runs-on: macos-latest-xl - # steps: - # - uses: actions/checkout@v3 - # with: - # ref: ${{ github.ref }} + output-slack-results-and-update-detox-failure-ticket: + if: (!cancelled()) && github.event_name == 'schedule' + needs: [matrix-e2e-android, start_slack_thread] + runs-on: macos-latest-xl + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.ref }} - # - name: Download results - # uses: actions/download-artifact@v4 - # with: - # path: VAMobile/e2e/test_reports + - name: Download results + uses: actions/download-artifact@v4 + with: + path: VAMobile/e2e/test_reports - # - name: Inform Slack - # id: inform_slack - # shell: bash - # run: | - # if grep -rq "" .; then - # echo SLACK_THREAD_TS=${ts} >> $GITHUB_OUTPUT - # ts=$(curl -X POST -H 'Authorization: Bearer '"$SLACK_API_TOKEN"' ' \ - # -H 'Content-type: application/json' \ - # --data '{"channel":"'${{needs.start_slack_thread.outputs.channel_id}}'","thread_ts":"'${{needs.start_slack_thread.outputs.thread_ts}}'","text":"Failed! Please check workflow for results: https://github.com/department-of-veterans-affairs/va-mobile-app/actions"}' \ - # https://slack.com/api/chat.postMessage| - # jq -r '.ts') - # echo SLACK_THREAD_TS=${ts} >> $GITHUB_OUTPUT - # echo "TEST_FAILURE=true" >> "$GITHUB_OUTPUT" - # else - # ts=$(curl -X POST -H 'Authorization: Bearer '"$SLACK_API_TOKEN"' ' \ - # -H 'Content-type: application/json' \ - # --data '{"channel":"'${{needs.start_slack_thread.outputs.channel_id}}'","thread_ts":"'${{needs.start_slack_thread.outputs.thread_ts}}'","text":"Success! All E2E tests have passed"}' \ - # https://slack.com/api/chat.postMessage| - # jq -r '.ts') - # fi + - name: Inform Slack + id: inform_slack + shell: bash + run: | + if grep -rq "" .; then + echo SLACK_THREAD_TS=${ts} >> $GITHUB_OUTPUT + ts=$(curl -X POST -H 'Authorization: Bearer '"$SLACK_API_TOKEN"' ' \ + -H 'Content-type: application/json' \ + --data '{"channel":"'${{needs.start_slack_thread.outputs.channel_id}}'","thread_ts":"'${{needs.start_slack_thread.outputs.thread_ts}}'","text":"Failed! Please check workflow for results: https://github.com/department-of-veterans-affairs/va-mobile-app/actions"}' \ + https://slack.com/api/chat.postMessage| + jq -r '.ts') + echo SLACK_THREAD_TS=${ts} >> $GITHUB_OUTPUT + echo "TEST_FAILURE=true" >> "$GITHUB_OUTPUT" + else + ts=$(curl -X POST -H 'Authorization: Bearer '"$SLACK_API_TOKEN"' ' \ + -H 'Content-type: application/json' \ + --data '{"channel":"'${{needs.start_slack_thread.outputs.channel_id}}'","thread_ts":"'${{needs.start_slack_thread.outputs.thread_ts}}'","text":"Success! All E2E tests have passed"}' \ + https://slack.com/api/chat.postMessage| + jq -r '.ts') + fi - # - name: Find failing tests - # id: failing_tests - # shell: bash - # run: | - # if grep -rq "" .; then - # failing_tests_list=$(grep -rl "") - # failing_tests="" - # for i in ${failing_tests_list[@]}; do - # remove_before=${i%.ts*} - # remove_after=${remove_before#*test_reports/} - # echo "$remove_after" - # if [ -z "${failing_tests}" ]; then - # failing_tests=$(echo $failing_tests"$remove_after") - # else - # failing_tests=$(echo $failing_tests", ""$remove_after") - # fi - # done - # echo "FAILING_TEST=$failing_tests" >> "$GITHUB_OUTPUT" - # fi + - name: Find failing tests + id: failing_tests + shell: bash + run: | + if grep -rq "" .; then + failing_tests_list=$(grep -rl "") + failing_tests="" + for i in ${failing_tests_list[@]}; do + remove_before=${i%.ts*} + remove_after=${remove_before#*test_reports/} + echo "$remove_after" + if [ -z "${failing_tests}" ]; then + failing_tests=$(echo $failing_tests"$remove_after") + else + failing_tests=$(echo $failing_tests", ""$remove_after") + fi + done + echo "FAILING_TEST=$failing_tests" >> "$GITHUB_OUTPUT" + fi - # - name: Github CLI Authentication - # run: | - # echo "${{ secrets.GITHUB_TOKEN }}" >> token.txt - # gh auth login --with-token < token.txt + - name: Github CLI Authentication + run: | + echo "${{ secrets.GITHUB_TOKEN }}" >> token.txt + gh auth login --with-token < token.txt - # - name: Update a ticket on failure (if needed) - # if: steps.inform_slack.outputs.TEST_FAILURE != '' - # id: find_if_ticket_already_exists - # run: | - # old_body=$(gh issue list --json body --jq '.[] | .body' --state open --search "Bug - Detox - Fix Overnight Failures in:title") - # if [[ "$old_body" != "" ]]; then - # ticket_number=$(gh issue list --json number --jq '.[] | .number' --state open --search "Bug - Detox - Fix Overnight Failures in:title") - # new_body=$(echo "$old_body"$'\n'"- "${{ env.DATE_OF_ISSUE}}" on Android: "${{steps.failing_tests.outputs.FAILING_TEST}}) - # echo "$new_body" - # echo "TICKET_EXISTS=true" >> "$GITHUB_OUTPUT" - # gh issue edit $ticket_number -b "$new_body" - # else - # echo "TICKET_EXISTS=" >> "$GITHUB_OUTPUT" - # fi - # env: - # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Update a ticket on failure (if needed) + if: steps.inform_slack.outputs.TEST_FAILURE != '' + id: find_if_ticket_already_exists + run: | + old_body=$(gh issue list --json body --jq '.[] | .body' --state open --search "Bug - Detox - Fix Overnight Failures in:title") + if [[ "$old_body" != "" ]]; then + ticket_number=$(gh issue list --json number --jq '.[] | .number' --state open --search "Bug - Detox - Fix Overnight Failures in:title") + new_body=$(echo "$old_body"$'\n'"- "${{ env.DATE_OF_ISSUE}}" on Android: "${{steps.failing_tests.outputs.FAILING_TEST}}) + echo "$new_body" + echo "TICKET_EXISTS=true" >> "$GITHUB_OUTPUT" + gh issue edit $ticket_number -b "$new_body" + else + echo "TICKET_EXISTS=" >> "$GITHUB_OUTPUT" + fi + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - name: Make a ticket on failure (if needed) - # if: steps.inform_slack.outputs.TEST_FAILURE != '' && steps.find_if_ticket_already_exists.outputs.TICKET_EXISTS == '' - # uses: JasonEtco/create-an-issue@v2 - # with: - # filename: .github/ISSUE_TEMPLATE/detox_nightly_build_failure.md - # search_existing: open - # env: - # dateOfIssue: ${{ env.DATE_OF_ISSUE }} - # OS: "Android" - # issues: ${{steps.failing_tests.outputs.FAILING_TEST}} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # id: create-issue + - name: Make a ticket on failure (if needed) + if: steps.inform_slack.outputs.TEST_FAILURE != '' && steps.find_if_ticket_already_exists.outputs.TICKET_EXISTS == '' + uses: JasonEtco/create-an-issue@v2 + with: + filename: .github/ISSUE_TEMPLATE/detox_nightly_build_failure.md + search_existing: open + env: + dateOfIssue: ${{ env.DATE_OF_ISSUE }} + OS: "Android" + issues: ${{steps.failing_tests.outputs.FAILING_TEST}} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + id: create-issue - # matrix_send_test_results_to_testrail: - # if: (!cancelled()) && github.event.inputs.run_testRail == 'true' - # needs: [matrix-e2e-android, output_detox_tests_to_run] - # strategy: - # fail-fast: false - # max-parallel: 1 - # matrix: - # testsuite: ${{ fromJSON(needs.output_detox_tests_to_run.outputs.output1) }} - # name: Update testRail Results - # uses: ./.github/workflows/update_testrail_results.yml - # with: - # test_names: "${{matrix.testsuite}}" - # testRail_name: ${{ inputs.testRail_name }} - # test_OS_name: "Android" - # secrets: inherit + matrix_send_test_results_to_testrail: + if: (!cancelled()) && github.event.inputs.run_testRail == 'true' + needs: [matrix-e2e-android, output_detox_tests_to_run] + strategy: + fail-fast: false + max-parallel: 1 + matrix: + testsuite: ${{ fromJSON(needs.output_detox_tests_to_run.outputs.output1) }} + name: Update testRail Results + uses: ./.github/workflows/update_testrail_results.yml + with: + test_names: "${{matrix.testsuite}}" + testRail_name: ${{ inputs.testRail_name }} + test_OS_name: "Android" + secrets: inherit update-test-names: if: (!cancelled()) && github.event.inputs.run_testRail == 'true' From 9e1260f25c38dfb7bdea309acc00d5764ec4109b Mon Sep 17 00:00:00 2001 From: rbontrager Date: Tue, 29 Oct 2024 14:04:02 -0500 Subject: [PATCH 03/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 1bb15d125fe..d7f961e69a6 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -365,7 +365,7 @@ jobs: update-test-names: if: (!cancelled()) && github.event.inputs.run_testRail == 'true' - #needs: [matrix-e2e-android, output_detox_tests_to_run, matrix_send_test_results_to_testrail] + needs: [matrix-e2e-android, output_detox_tests_to_run, matrix_send_test_results_to_testrail] continue-on-error: false runs-on: ubuntu-latest steps: From 9008a8b91607629b00f6ee1392e8c41a17f79ba9 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Tue, 29 Oct 2024 14:18:00 -0500 Subject: [PATCH 04/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 637 +++++++++++++++--------------- 1 file changed, 322 insertions(+), 315 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index d7f961e69a6..7a1aa015344 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -72,300 +72,300 @@ env: SLACK_API_TOKEN: ${{ secrets.SLACK_API_TOKEN }} jobs: - start_slack_thread: - if: github.event_name == 'schedule' - name: Start Slack thread - uses: ./.github/workflows/start_slack_thread.yml - secrets: inherit - with: - channel_name: va-mobile-build-alerts - message: 'Starting E2E Android tests. Please see :thread: for results. This process may take a while.' + # start_slack_thread: + # if: github.event_name == 'schedule' + # name: Start Slack thread + # uses: ./.github/workflows/start_slack_thread.yml + # secrets: inherit + # with: + # channel_name: va-mobile-build-alerts + # message: 'Starting E2E Android tests. Please see :thread: for results. This process may take a while.' - find_detox_tests_to_run: - if: github.event_name == 'pull_request' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' - uses: ./.github/workflows/e2e_detox_mapping.yml + # find_detox_tests_to_run: + # if: github.event_name == 'pull_request' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' + # uses: ./.github/workflows/e2e_detox_mapping.yml - output_detox_tests_to_run: - runs-on: macos-latest-xl - needs: find_detox_tests_to_run - outputs: - output1: ${{ steps.matrix_value.outputs.matrix }} - output2: ${{ steps.matrix_value.outputs.individual_matrix}} - steps: - - name: Checkout - uses: actions/checkout@v3 - with: - ref: ${{ github.ref }} - - name: 'Get Matrix Value' - id: matrix_value - run: | - if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]] || [[ "${{ inputs.tests_to_run}}" != "" ]]; then - if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]]; then - e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]') - echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT" - echo "individual_matrix=" >> "$GITHUB_OUTPUT" - else - if [[ "${{ inputs.tests_to_run}}" != "" ]]; then - echo "matrix=${{ toJson(inputs.tests_to_run)}}" >> "$GITHUB_OUTPUT" - echo "individual_matrix=true" >> "$GITHUB_OUTPUT" - else - echo "matrix=" >> "$GITHUB_OUTPUT" - fi - fi - else - if [[ "${{ needs.find_detox_tests_to_run.outputs.test_run }}" != "" ]]; then - echo "${{needs.find_detox_tests_to_run.outputs.test_matrix}}" - if [[ "${{needs.find_detox_tests_to_run.outputs.test_matrix}}" == "[]" ]]; then - if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]]; then - e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]') - echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT" - echo "individual_matrix=" >> "$GITHUB_OUTPUT" - else - if [[ "${{ inputs.tests_to_run}}" != "" ]]; then - echo "matrix=${{ toJson(inputs.tests_to_run)}}" >> "$GITHUB_OUTPUT" - echo "individual_matrix=true" >> "$GITHUB_OUTPUT" - else - echo "matrix=" >> "$GITHUB_OUTPUT" - fi - fi - else - resp=${{toJson(needs.find_detox_tests_to_run.outputs.test_matrix)}} - echo "matrix=$resp" >> "$GITHUB_OUTPUT" - fi - fi - fi - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # output_detox_tests_to_run: + # runs-on: macos-latest-xl + # needs: find_detox_tests_to_run + # outputs: + # output1: ${{ steps.matrix_value.outputs.matrix }} + # output2: ${{ steps.matrix_value.outputs.individual_matrix}} + # steps: + # - name: Checkout + # uses: actions/checkout@v3 + # with: + # ref: ${{ github.ref }} + # - name: 'Get Matrix Value' + # id: matrix_value + # run: | + # if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]] || [[ "${{ inputs.tests_to_run}}" != "" ]]; then + # if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]]; then + # e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]') + # echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT" + # echo "individual_matrix=" >> "$GITHUB_OUTPUT" + # else + # if [[ "${{ inputs.tests_to_run}}" != "" ]]; then + # echo "matrix=${{ toJson(inputs.tests_to_run)}}" >> "$GITHUB_OUTPUT" + # echo "individual_matrix=true" >> "$GITHUB_OUTPUT" + # else + # echo "matrix=" >> "$GITHUB_OUTPUT" + # fi + # fi + # else + # if [[ "${{ needs.find_detox_tests_to_run.outputs.test_run }}" != "" ]]; then + # echo "${{needs.find_detox_tests_to_run.outputs.test_matrix}}" + # if [[ "${{needs.find_detox_tests_to_run.outputs.test_matrix}}" == "[]" ]]; then + # if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]]; then + # e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]') + # echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT" + # echo "individual_matrix=" >> "$GITHUB_OUTPUT" + # else + # if [[ "${{ inputs.tests_to_run}}" != "" ]]; then + # echo "matrix=${{ toJson(inputs.tests_to_run)}}" >> "$GITHUB_OUTPUT" + # echo "individual_matrix=true" >> "$GITHUB_OUTPUT" + # else + # echo "matrix=" >> "$GITHUB_OUTPUT" + # fi + # fi + # else + # resp=${{toJson(needs.find_detox_tests_to_run.outputs.test_matrix)}} + # echo "matrix=$resp" >> "$GITHUB_OUTPUT" + # fi + # fi + # fi + # env: + # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - matrix-e2e-android: - if: (!cancelled()) && needs.output_detox_tests_to_run.outputs.output1 != '' - runs-on: macos-latest-xl - needs: [start_slack_thread, output_detox_tests_to_run] - strategy: - fail-fast: false - matrix: - testsuite: ${{fromJson(needs.output_detox_tests_to_run.outputs.output1)}} + # matrix-e2e-android: + # if: (!cancelled()) && needs.output_detox_tests_to_run.outputs.output1 != '' + # runs-on: macos-latest-xl + # needs: [start_slack_thread, output_detox_tests_to_run] + # strategy: + # fail-fast: false + # matrix: + # testsuite: ${{fromJson(needs.output_detox_tests_to_run.outputs.output1)}} - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ github.ref }} + # steps: + # - uses: actions/checkout@v3 + # with: + # ref: ${{ github.ref }} - - name: Set git config - run: | - git config --global user.name 'VA Automation Bot' - git config --global user.email 'va-mobileapp@adhocteam.us' + # - name: Set git config + # run: | + # git config --global user.name 'VA Automation Bot' + # git config --global user.email 'va-mobileapp@adhocteam.us' - - name: Decode base64 encoded keys - working-directory: VAMobile/android - run: | - mkdir keys - cd keys - echo "${{ secrets.GOOGLE_KS }}" | base64 --decode > vamobile - echo "${{ secrets.GOOGLE_SA_JSON }}" | base64 --decode > service-account.json - echo "${{ secrets.FIREBASE_DIST_FILE_BASE64 }}" | base64 --decode > firebase-dist.json - cd ../app - echo "${{ secrets.GOOGLE_SERVICES_JSON }}" | base64 --decode > google-services.json + # - name: Decode base64 encoded keys + # working-directory: VAMobile/android + # run: | + # mkdir keys + # cd keys + # echo "${{ secrets.GOOGLE_KS }}" | base64 --decode > vamobile + # echo "${{ secrets.GOOGLE_SA_JSON }}" | base64 --decode > service-account.json + # echo "${{ secrets.FIREBASE_DIST_FILE_BASE64 }}" | base64 --decode > firebase-dist.json + # cd ../app + # echo "${{ secrets.GOOGLE_SERVICES_JSON }}" | base64 --decode > google-services.json - - name: Setup ruby and restore bundler cache - uses: ruby/setup-ruby@v1 - with: - ruby-version: '3.0.2' - bundler-cache: true - working-directory: VAMobile/android + # - name: Setup ruby and restore bundler cache + # uses: ruby/setup-ruby@v1 + # with: + # ruby-version: '3.0.2' + # bundler-cache: true + # working-directory: VAMobile/android - - name: Set up JDK - uses: actions/setup-java@v3 - with: - java-version: 17 - distribution: 'microsoft' + # - name: Set up JDK + # uses: actions/setup-java@v3 + # with: + # java-version: 17 + # distribution: 'microsoft' - - name: Setup node and restore yarn cache - uses: actions/setup-node@v3 - with: - node-version-file: 'VAMobile/.nvmrc' - cache: 'yarn' - cache-dependency-path: './VAMobile/yarn.lock' + # - name: Setup node and restore yarn cache + # uses: actions/setup-node@v3 + # with: + # node-version-file: 'VAMobile/.nvmrc' + # cache: 'yarn' + # cache-dependency-path: './VAMobile/yarn.lock' - - name: Install npm dependencies - run: yarn install --frozen-lockfile --non-interactive + # - name: Install npm dependencies + # run: yarn install --frozen-lockfile --non-interactive - - name: Set app environment variables - run: yarn env:staging + # - name: Set app environment variables + # run: yarn env:staging - - name: Bundle Android app - run: yarn e2e:android-build + # - name: Bundle Android app + # run: yarn e2e:android-build - - name: Run e2e tests for Android - Full Test - id: run_e2e_tests - if: ${{needs.output_detox_tests_to_run.outputs.output2 == ''}} - uses: reactivecircus/android-emulator-runner@v2 - with: - working-directory: VAMobile - api-level: 28 - profile: pixel_6_pro - force-avd-creation: false - disable-animations: true - arch: x86_64 - avd-name: Pixel_4_XL_API_28 - script: yarn e2e:android-test /e2e/tests/${{matrix.testsuite}} --updateSnapshot - continue-on-error: true + # - name: Run e2e tests for Android - Full Test + # id: run_e2e_tests + # if: ${{needs.output_detox_tests_to_run.outputs.output2 == ''}} + # uses: reactivecircus/android-emulator-runner@v2 + # with: + # working-directory: VAMobile + # api-level: 28 + # profile: pixel_6_pro + # force-avd-creation: false + # disable-animations: true + # arch: x86_64 + # avd-name: Pixel_4_XL_API_28 + # script: yarn e2e:android-test /e2e/tests/${{matrix.testsuite}} --updateSnapshot + # continue-on-error: true - - name: Run e2e tests for Android - id: run_e2e_tests_nav_AF - if: ${{needs.output_detox_tests_to_run.outputs.output2 != ''}} - uses: reactivecircus/android-emulator-runner@v2 - with: - working-directory: VAMobile - api-level: 28 - profile: pixel_6_pro - force-avd-creation: false - disable-animations: true - arch: x86_64 - avd-name: Pixel_4_XL_API_28 - script: yarn e2e:android-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot + # - name: Run e2e tests for Android + # id: run_e2e_tests_nav_AF + # if: ${{needs.output_detox_tests_to_run.outputs.output2 != ''}} + # uses: reactivecircus/android-emulator-runner@v2 + # with: + # working-directory: VAMobile + # api-level: 28 + # profile: pixel_6_pro + # force-avd-creation: false + # disable-animations: true + # arch: x86_64 + # avd-name: Pixel_4_XL_API_28 + # script: yarn e2e:android-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot - - name: Run e2e tests for Android on failure - if: failure() && steps.run_e2e_tests_nav_AF.outcome == 'failure' - uses: reactivecircus/android-emulator-runner@v2 - with: - working-directory: VAMobile - api-level: 28 - profile: pixel_6_pro - force-avd-creation: false - disable-animations: true - arch: x86_64 - avd-name: Pixel_4_XL_API_28 - script: yarn e2e:android-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot + # - name: Run e2e tests for Android on failure + # if: failure() && steps.run_e2e_tests_nav_AF.outcome == 'failure' + # uses: reactivecircus/android-emulator-runner@v2 + # with: + # working-directory: VAMobile + # api-level: 28 + # profile: pixel_6_pro + # force-avd-creation: false + # disable-animations: true + # arch: x86_64 + # avd-name: Pixel_4_XL_API_28 + # script: yarn e2e:android-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot - - name: Upload e2e-junit - if: failure() || success() - uses: actions/upload-artifact@v4 - with: - name: ${{matrix.testsuite}}-e2e-junit - path: VAMobile/e2e/test_reports/e2e-junit.xml + # - name: Upload e2e-junit + # if: failure() || success() + # uses: actions/upload-artifact@v4 + # with: + # name: ${{matrix.testsuite}}-e2e-junit + # path: VAMobile/e2e/test_reports/e2e-junit.xml - - name: Upload artifacts on failure - if: failure() || steps.run_e2e_tests.outcome == 'failure' - uses: actions/upload-artifact@v4 - with: - name: detox-artifacts-${{ runner.os }}-${{ github.run_id }}-${{matrix.testsuite}} - path: VAMobile/artifacts - retention-days: 1 + # - name: Upload artifacts on failure + # if: failure() || steps.run_e2e_tests.outcome == 'failure' + # uses: actions/upload-artifact@v4 + # with: + # name: detox-artifacts-${{ runner.os }}-${{ github.run_id }}-${{matrix.testsuite}} + # path: VAMobile/artifacts + # retention-days: 1 - - name: Fail workflow if needed(View e2e step for details) - if: steps.run_e2e_tests.outcome == 'failure' - run: exit 1 + # - name: Fail workflow if needed(View e2e step for details) + # if: steps.run_e2e_tests.outcome == 'failure' + # run: exit 1 - output-slack-results-and-update-detox-failure-ticket: - if: (!cancelled()) && github.event_name == 'schedule' - needs: [matrix-e2e-android, start_slack_thread] - runs-on: macos-latest-xl - steps: - - uses: actions/checkout@v3 - with: - ref: ${{ github.ref }} + # output-slack-results-and-update-detox-failure-ticket: + # if: (!cancelled()) && github.event_name == 'schedule' + # needs: [matrix-e2e-android, start_slack_thread] + # runs-on: macos-latest-xl + # steps: + # - uses: actions/checkout@v3 + # with: + # ref: ${{ github.ref }} - - name: Download results - uses: actions/download-artifact@v4 - with: - path: VAMobile/e2e/test_reports + # - name: Download results + # uses: actions/download-artifact@v4 + # with: + # path: VAMobile/e2e/test_reports - - name: Inform Slack - id: inform_slack - shell: bash - run: | - if grep -rq "" .; then - echo SLACK_THREAD_TS=${ts} >> $GITHUB_OUTPUT - ts=$(curl -X POST -H 'Authorization: Bearer '"$SLACK_API_TOKEN"' ' \ - -H 'Content-type: application/json' \ - --data '{"channel":"'${{needs.start_slack_thread.outputs.channel_id}}'","thread_ts":"'${{needs.start_slack_thread.outputs.thread_ts}}'","text":"Failed! Please check workflow for results: https://github.com/department-of-veterans-affairs/va-mobile-app/actions"}' \ - https://slack.com/api/chat.postMessage| - jq -r '.ts') - echo SLACK_THREAD_TS=${ts} >> $GITHUB_OUTPUT - echo "TEST_FAILURE=true" >> "$GITHUB_OUTPUT" - else - ts=$(curl -X POST -H 'Authorization: Bearer '"$SLACK_API_TOKEN"' ' \ - -H 'Content-type: application/json' \ - --data '{"channel":"'${{needs.start_slack_thread.outputs.channel_id}}'","thread_ts":"'${{needs.start_slack_thread.outputs.thread_ts}}'","text":"Success! All E2E tests have passed"}' \ - https://slack.com/api/chat.postMessage| - jq -r '.ts') - fi + # - name: Inform Slack + # id: inform_slack + # shell: bash + # run: | + # if grep -rq "" .; then + # echo SLACK_THREAD_TS=${ts} >> $GITHUB_OUTPUT + # ts=$(curl -X POST -H 'Authorization: Bearer '"$SLACK_API_TOKEN"' ' \ + # -H 'Content-type: application/json' \ + # --data '{"channel":"'${{needs.start_slack_thread.outputs.channel_id}}'","thread_ts":"'${{needs.start_slack_thread.outputs.thread_ts}}'","text":"Failed! Please check workflow for results: https://github.com/department-of-veterans-affairs/va-mobile-app/actions"}' \ + # https://slack.com/api/chat.postMessage| + # jq -r '.ts') + # echo SLACK_THREAD_TS=${ts} >> $GITHUB_OUTPUT + # echo "TEST_FAILURE=true" >> "$GITHUB_OUTPUT" + # else + # ts=$(curl -X POST -H 'Authorization: Bearer '"$SLACK_API_TOKEN"' ' \ + # -H 'Content-type: application/json' \ + # --data '{"channel":"'${{needs.start_slack_thread.outputs.channel_id}}'","thread_ts":"'${{needs.start_slack_thread.outputs.thread_ts}}'","text":"Success! All E2E tests have passed"}' \ + # https://slack.com/api/chat.postMessage| + # jq -r '.ts') + # fi - - name: Find failing tests - id: failing_tests - shell: bash - run: | - if grep -rq "" .; then - failing_tests_list=$(grep -rl "") - failing_tests="" - for i in ${failing_tests_list[@]}; do - remove_before=${i%.ts*} - remove_after=${remove_before#*test_reports/} - echo "$remove_after" - if [ -z "${failing_tests}" ]; then - failing_tests=$(echo $failing_tests"$remove_after") - else - failing_tests=$(echo $failing_tests", ""$remove_after") - fi - done - echo "FAILING_TEST=$failing_tests" >> "$GITHUB_OUTPUT" - fi + # - name: Find failing tests + # id: failing_tests + # shell: bash + # run: | + # if grep -rq "" .; then + # failing_tests_list=$(grep -rl "") + # failing_tests="" + # for i in ${failing_tests_list[@]}; do + # remove_before=${i%.ts*} + # remove_after=${remove_before#*test_reports/} + # echo "$remove_after" + # if [ -z "${failing_tests}" ]; then + # failing_tests=$(echo $failing_tests"$remove_after") + # else + # failing_tests=$(echo $failing_tests", ""$remove_after") + # fi + # done + # echo "FAILING_TEST=$failing_tests" >> "$GITHUB_OUTPUT" + # fi - - name: Github CLI Authentication - run: | - echo "${{ secrets.GITHUB_TOKEN }}" >> token.txt - gh auth login --with-token < token.txt + # - name: Github CLI Authentication + # run: | + # echo "${{ secrets.GITHUB_TOKEN }}" >> token.txt + # gh auth login --with-token < token.txt - - name: Update a ticket on failure (if needed) - if: steps.inform_slack.outputs.TEST_FAILURE != '' - id: find_if_ticket_already_exists - run: | - old_body=$(gh issue list --json body --jq '.[] | .body' --state open --search "Bug - Detox - Fix Overnight Failures in:title") - if [[ "$old_body" != "" ]]; then - ticket_number=$(gh issue list --json number --jq '.[] | .number' --state open --search "Bug - Detox - Fix Overnight Failures in:title") - new_body=$(echo "$old_body"$'\n'"- "${{ env.DATE_OF_ISSUE}}" on Android: "${{steps.failing_tests.outputs.FAILING_TEST}}) - echo "$new_body" - echo "TICKET_EXISTS=true" >> "$GITHUB_OUTPUT" - gh issue edit $ticket_number -b "$new_body" - else - echo "TICKET_EXISTS=" >> "$GITHUB_OUTPUT" - fi - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - name: Update a ticket on failure (if needed) + # if: steps.inform_slack.outputs.TEST_FAILURE != '' + # id: find_if_ticket_already_exists + # run: | + # old_body=$(gh issue list --json body --jq '.[] | .body' --state open --search "Bug - Detox - Fix Overnight Failures in:title") + # if [[ "$old_body" != "" ]]; then + # ticket_number=$(gh issue list --json number --jq '.[] | .number' --state open --search "Bug - Detox - Fix Overnight Failures in:title") + # new_body=$(echo "$old_body"$'\n'"- "${{ env.DATE_OF_ISSUE}}" on Android: "${{steps.failing_tests.outputs.FAILING_TEST}}) + # echo "$new_body" + # echo "TICKET_EXISTS=true" >> "$GITHUB_OUTPUT" + # gh issue edit $ticket_number -b "$new_body" + # else + # echo "TICKET_EXISTS=" >> "$GITHUB_OUTPUT" + # fi + # env: + # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Make a ticket on failure (if needed) - if: steps.inform_slack.outputs.TEST_FAILURE != '' && steps.find_if_ticket_already_exists.outputs.TICKET_EXISTS == '' - uses: JasonEtco/create-an-issue@v2 - with: - filename: .github/ISSUE_TEMPLATE/detox_nightly_build_failure.md - search_existing: open - env: - dateOfIssue: ${{ env.DATE_OF_ISSUE }} - OS: "Android" - issues: ${{steps.failing_tests.outputs.FAILING_TEST}} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - id: create-issue + # - name: Make a ticket on failure (if needed) + # if: steps.inform_slack.outputs.TEST_FAILURE != '' && steps.find_if_ticket_already_exists.outputs.TICKET_EXISTS == '' + # uses: JasonEtco/create-an-issue@v2 + # with: + # filename: .github/ISSUE_TEMPLATE/detox_nightly_build_failure.md + # search_existing: open + # env: + # dateOfIssue: ${{ env.DATE_OF_ISSUE }} + # OS: "Android" + # issues: ${{steps.failing_tests.outputs.FAILING_TEST}} + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # id: create-issue - matrix_send_test_results_to_testrail: - if: (!cancelled()) && github.event.inputs.run_testRail == 'true' - needs: [matrix-e2e-android, output_detox_tests_to_run] - strategy: - fail-fast: false - max-parallel: 1 - matrix: - testsuite: ${{ fromJSON(needs.output_detox_tests_to_run.outputs.output1) }} - name: Update testRail Results - uses: ./.github/workflows/update_testrail_results.yml - with: - test_names: "${{matrix.testsuite}}" - testRail_name: ${{ inputs.testRail_name }} - test_OS_name: "Android" - secrets: inherit + # matrix_send_test_results_to_testrail: + # if: (!cancelled()) && github.event.inputs.run_testRail == 'true' + # needs: [matrix-e2e-android, output_detox_tests_to_run] + # strategy: + # fail-fast: false + # max-parallel: 1 + # matrix: + # testsuite: ${{ fromJSON(needs.output_detox_tests_to_run.outputs.output1) }} + # name: Update testRail Results + # uses: ./.github/workflows/update_testrail_results.yml + # with: + # test_names: "${{matrix.testsuite}}" + # testRail_name: ${{ inputs.testRail_name }} + # test_OS_name: "Android" + # secrets: inherit update-test-names: if: (!cancelled()) && github.event.inputs.run_testRail == 'true' - needs: [matrix-e2e-android, output_detox_tests_to_run, matrix_send_test_results_to_testrail] + #needs: [matrix-e2e-android, output_detox_tests_to_run, matrix_send_test_results_to_testrail] continue-on-error: false runs-on: ubuntu-latest steps: @@ -373,56 +373,63 @@ jobs: uses: actions/checkout@v3 - name: update-test-names run: | - for ((i=0; ; i+=250)); do - echo "i = $i" - getTestCaseNewName=$(curl -X GET -H 'Content-Type: application/json' \ - -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ - "https://dsvavsp.testrail.io//index.php?/api/v2/get_tests/${{ needs.matrix_send_test_results_to_testrail.outputs.test_run_id_number }}&offset=$i") - echo $(jq --compact-output '[.tests[] | .title |= sub("(]).*$"; "]")]' <<< "$getTestCaseNewName") >> input.json - if [[ $(jq '._links.next == null' <<< "$getTestCaseNewName") == 'true' ]]; - then - break - fi - done getTest=$(curl -X GET -H 'Content-Type: application/json' \ -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ "https://dsvavsp.testrail.io//index.php?/api/v2/get_test/43942") - getTestCaseNewName=$(jq --compact-output -s 'add' input.json) - groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]') - getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]') - getCasesID=$(curl -X GET -H 'Content-Type: application/json' \ - -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ - "https://dsvavsp.testrail.io//index.php?/api/v2/get_cases/29") - updateRunWithNewCases=$(curl -X POST -H 'Content-Type: application/json' \ - -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ - -d '{"suite_id": 92, "include_all": false, "case_ids": '$(echo $getCasesID | jq --argjson testRailNames "$getFirstTestNewName" --compact-output '.cases | map(select(.title == $testRailNames[])) | map(.id)')'}' \ - "https://dsvavsp.testrail.io//index.php?/api/v2/update_run/${{needs.matrix_send_test_results_to_testrail.outputs.test_run_id_number}}") - getTestCases=$(curl -X GET -H 'Content-Type: application/json' \ - -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ - "https://dsvavsp.testrail.io//index.php?/api/v2/get_tests/${{needs.matrix_send_test_results_to_testrail.outputs.test_run_id_number}}") - for i in $(echo $getTestCases | jq -r '.tests[].id'); do - getTestName=$(echo $getTestCases | jq --argjson testIDs "$i" -r '.tests | map(select(.id == $testIDs)) | .[0].title') - - getFailedTests=$(echo $getTestCaseNewName | jq --compact-output 'map(select(.status_id == 5)) | map(.title)') - isTestFailed=$(echo $getFailedTests | jq 'any(. == "'"$getTestName"'")') - getRetestTests=$(echo $getTestCaseNewName | jq --compact-output 'map(select(.status_id == 4)) | map(.title)') - isTestRetest=$(echo $getRetestTests | jq 'any(. == "'"$getTestName"'")') - getPassedTests=$(echo $getTestCaseNewName | jq --compact-output 'map(select(.status_id == 1)) | map(.title)') - isTestPassed=$(echo $getPassedTests | jq 'any(. == "'"$getTestName"'")') - if [[ "$isTestFailed" == "true" ]]; then - resp5=$(curl -X POST -H 'Content-Type: application/json' \ - -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ - -d '{"status_id": 5}' \ - "https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"") - elif [[ "$isTestRetest" == "true" ]]; then - resp5=$(curl -X POST -H 'Content-Type: application/json' \ - -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ - -d '{"status_id": 4}' \ - "https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"") - elif [[ "$isTestPassed" == "true" ]]; then - resp5=$(curl -X POST -H 'Content-Type: application/json' \ - -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ - -d '{"status_id": 1}' \ - "https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"") - fi - done + echo "$getTest" + + +# for ((i=0; ; i+=250)); do +# echo "i = $i" +# getTestCaseNewName=$(curl -X GET -H 'Content-Type: application/json' \ +# -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ +# "https://dsvavsp.testrail.io//index.php?/api/v2/get_tests/${{ needs.matrix_send_test_results_to_testrail.outputs.test_run_id_number }}&offset=$i") +# echo $(jq --compact-output '[.tests[] | .title |= sub("(]).*$"; "]")]' <<< "$getTestCaseNewName") >> input.json +# if [[ $(jq '._links.next == null' <<< "$getTestCaseNewName") == 'true' ]]; +# then +# break +# fi +# done +# getTest=$(curl -X GET -H 'Content-Type: application/json' \ +# -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ +# "https://dsvavsp.testrail.io//index.php?/api/v2/get_test/43942") +# echo "$getTest" +# getTestCaseNewName=$(jq --compact-output -s 'add' input.json) +# groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]') +# getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]') +# getCasesID=$(curl -X GET -H 'Content-Type: application/json' \ +# -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ +# "https://dsvavsp.testrail.io//index.php?/api/v2/get_cases/29") +# updateRunWithNewCases=$(curl -X POST -H 'Content-Type: application/json' \ +# -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ +# -d '{"suite_id": 92, "include_all": false, "case_ids": '$(echo $getCasesID | jq --argjson testRailNames "$getFirstTestNewName" --compact-output '.cases | map(select(.title == $testRailNames[])) | map(.id)')'}' \ +# "https://dsvavsp.testrail.io//index.php?/api/v2/update_run/${{needs.matrix_send_test_results_to_testrail.outputs.test_run_id_number}}") +# getTestCases=$(curl -X GET -H 'Content-Type: application/json' \ +# -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ +# "https://dsvavsp.testrail.io//index.php?/api/v2/get_tests/${{needs.matrix_send_test_results_to_testrail.outputs.test_run_id_number}}") +# for i in $(echo $getTestCases | jq -r '.tests[].id'); do +# getTestName=$(echo $getTestCases | jq --argjson testIDs "$i" -r '.tests | map(select(.id == $testIDs)) | .[0].title') + +# getFailedTests=$(echo $getTestCaseNewName | jq --compact-output 'map(select(.status_id == 5)) | map(.title)') +# isTestFailed=$(echo $getFailedTests | jq 'any(. == "'"$getTestName"'")') +# getRetestTests=$(echo $getTestCaseNewName | jq --compact-output 'map(select(.status_id == 4)) | map(.title)') +# isTestRetest=$(echo $getRetestTests | jq 'any(. == "'"$getTestName"'")') +# getPassedTests=$(echo $getTestCaseNewName | jq --compact-output 'map(select(.status_id == 1)) | map(.title)') +# isTestPassed=$(echo $getPassedTests | jq 'any(. == "'"$getTestName"'")') +# if [[ "$isTestFailed" == "true" ]]; then +# resp5=$(curl -X POST -H 'Content-Type: application/json' \ +# -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ +# -d '{"status_id": 5}' \ +# "https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"") +# elif [[ "$isTestRetest" == "true" ]]; then +# resp5=$(curl -X POST -H 'Content-Type: application/json' \ +# -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ +# -d '{"status_id": 4}' \ +# "https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"") +# elif [[ "$isTestPassed" == "true" ]]; then +# resp5=$(curl -X POST -H 'Content-Type: application/json' \ +# -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ +# -d '{"status_id": 1}' \ +# "https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"") +# fi +# done From 40393a54c2c5b45f76c06285e3bf264463315624 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Tue, 29 Oct 2024 14:20:15 -0500 Subject: [PATCH 05/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 7a1aa015344..1db79dab4ed 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -375,7 +375,7 @@ jobs: run: | getTest=$(curl -X GET -H 'Content-Type: application/json' \ -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ - "https://dsvavsp.testrail.io//index.php?/api/v2/get_test/43942") + "https://dsvavsp.testrail.io//index.php?/api/v2/get_case/43942") echo "$getTest" From b5b8db13098e0854d337bc180a066cceb9ebd2ea Mon Sep 17 00:00:00 2001 From: rbontrager Date: Tue, 29 Oct 2024 14:42:31 -0500 Subject: [PATCH 06/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 1db79dab4ed..37af1d40ddc 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -373,11 +373,26 @@ jobs: uses: actions/checkout@v3 - name: update-test-names run: | + for ((i=0; ; i+=250)); do + echo "i = $i" + getTestCaseNewName=$(curl -X GET -H 'Content-Type: application/json' \ + -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ + "https://dsvavsp.testrail.io//index.php?/api/v2/get_tests/6171&offset=$i") + echo $(jq --compact-output '[.tests[] | .title |= sub("(]).*$"; "]")]' <<< "$getTestCaseNewName") >> input.json + if [[ $(jq '._links.next == null' <<< "$getTestCaseNewName") == 'true' ]]; + then + break + fi + done getTest=$(curl -X GET -H 'Content-Type: application/json' \ -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ - "https://dsvavsp.testrail.io//index.php?/api/v2/get_case/43942") + "https://dsvavsp.testrail.io//index.php?/api/v2/get_cases/29§ion_id=9683" | jq .cases[]) echo "$getTest" - + for y in ${{ inputs.tests_to_run}}; do + echo "$y" + done + getTestCaseNewName=$(jq --compact-output -s 'add' input.json) + getTestTitles=$(echo $getTestCaseNewName | jq --compact output '.title') # for ((i=0; ; i+=250)); do # echo "i = $i" From 71cdc25ae7e79c0cde65fbb17ab1fbc3338f150f Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 30 Oct 2024 06:36:57 -0500 Subject: [PATCH 07/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 37af1d40ddc..3c3acbac047 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -387,13 +387,22 @@ jobs: getTest=$(curl -X GET -H 'Content-Type: application/json' \ -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ "https://dsvavsp.testrail.io//index.php?/api/v2/get_cases/29§ion_id=9683" | jq .cases[]) - echo "$getTest" + echo "Automated test cases: $getTest" + getTestCaseNewName=$(jq --compact-output -s 'add' input.json) + echo "testCasesFromFile: $getTestCaseNewName" + groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]') + getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]') + echo "TestCasesFirstName: $getFirstTestNewName" for y in ${{ inputs.tests_to_run}}; do - echo "$y" + removeBracket=$(echo $y | tr -d '[') + removeBracket=$(echo $removeBracket | tr -d ']') + echo "$removeBracket" + echo "$test" + missingCases=$(echo $getFirstTestNewName | jq --argjson testsTypedIn "$removeBracket" --compact-output 'index($removeBracket)') + if [[ "$missingCases" == "null" ]]; then + echo "$missingCases" + fi done - getTestCaseNewName=$(jq --compact-output -s 'add' input.json) - getTestTitles=$(echo $getTestCaseNewName | jq --compact output '.title') - # for ((i=0; ; i+=250)); do # echo "i = $i" # getTestCaseNewName=$(curl -X GET -H 'Content-Type: application/json' \ From 031adf2b6cb4508437271fd6a3ffc5632d207db9 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 30 Oct 2024 07:05:27 -0500 Subject: [PATCH 08/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 3c3acbac047..bf4c9997ea2 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -397,12 +397,15 @@ jobs: removeBracket=$(echo $y | tr -d '[') removeBracket=$(echo $removeBracket | tr -d ']') echo "$removeBracket" - echo "$test" - missingCases=$(echo $getFirstTestNewName | jq --argjson testsTypedIn "$removeBracket" --compact-output 'index($removeBracket)') - if [[ "$missingCases" == "null" ]]; then - echo "$missingCases" + missingCases=$(echo $getFirstTestNewName | jq --argjson testsTypedIn "$removeBracket" 'map(select(index($testsTypedIn)))') + if [[ "$missingCases" == "[]" ]]; then + echo "Missing cases: $missingCases" + missingCasesWithOS="$missingCases [android]" + echo $(jq --argjson getCase "$missingCasesWithOS" --compact-output 'select(.title | contains($getCase)) | .title' <<< "$getTest" >> input.json fi done + getTestCaseNewName=$(jq --compact-output -s 'add' input.json) + echo "testCasesFromFileUpdated: $getTestCaseNewName" # for ((i=0; ; i+=250)); do # echo "i = $i" # getTestCaseNewName=$(curl -X GET -H 'Content-Type: application/json' \ From 9a68b16598904ae46cd6e596018039324e5fc070 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 30 Oct 2024 07:08:13 -0500 Subject: [PATCH 09/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index bf4c9997ea2..9c7247d9633 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -401,7 +401,7 @@ jobs: if [[ "$missingCases" == "[]" ]]; then echo "Missing cases: $missingCases" missingCasesWithOS="$missingCases [android]" - echo $(jq --argjson getCase "$missingCasesWithOS" --compact-output 'select(.title | contains($getCase)) | .title' <<< "$getTest" >> input.json + echo $(jq --argjson getCase "$missingCasesWithOS" --compact-output 'select(.title | contains($getCase)) | .title' <<< "$getTest") >> input.json fi done getTestCaseNewName=$(jq --compact-output -s 'add' input.json) From 038b8658b5da2afd17a9c454431963031d3c5a88 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 30 Oct 2024 07:11:33 -0500 Subject: [PATCH 10/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 9c7247d9633..3b8d0aa3b39 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -397,11 +397,11 @@ jobs: removeBracket=$(echo $y | tr -d '[') removeBracket=$(echo $removeBracket | tr -d ']') echo "$removeBracket" - missingCases=$(echo $getFirstTestNewName | jq --argjson testsTypedIn "$removeBracket" 'map(select(index($testsTypedIn)))') + missingCases=$(echo $getFirstTestNewName | jq --args testsTypedIn "$removeBracket" 'map(select(index($testsTypedIn)))') if [[ "$missingCases" == "[]" ]]; then echo "Missing cases: $missingCases" missingCasesWithOS="$missingCases [android]" - echo $(jq --argjson getCase "$missingCasesWithOS" --compact-output 'select(.title | contains($getCase)) | .title' <<< "$getTest") >> input.json + echo $(jq --args getCase "$missingCasesWithOS" --compact-output 'select(.title | contains($getCase)) | .title' <<< "$getTest") >> input.json fi done getTestCaseNewName=$(jq --compact-output -s 'add' input.json) From 9dfb9126984ff92bb8e7697aeebd856d1b87b502 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 30 Oct 2024 07:16:19 -0500 Subject: [PATCH 11/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 3b8d0aa3b39..4983dc82f2c 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -397,11 +397,11 @@ jobs: removeBracket=$(echo $y | tr -d '[') removeBracket=$(echo $removeBracket | tr -d ']') echo "$removeBracket" - missingCases=$(echo $getFirstTestNewName | jq --args testsTypedIn "$removeBracket" 'map(select(index($testsTypedIn)))') + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'map(select(index($testsTypedIn)))') if [[ "$missingCases" == "[]" ]]; then echo "Missing cases: $missingCases" missingCasesWithOS="$missingCases [android]" - echo $(jq --args getCase "$missingCasesWithOS" --compact-output 'select(.title | contains($getCase)) | .title' <<< "$getTest") >> input.json + echo $(jq --arg getCase "$missingCasesWithOS" --compact-output 'select(.title | contains($getCase)) | .title' <<< "$getTest") >> input.json fi done getTestCaseNewName=$(jq --compact-output -s 'add' input.json) From 00cad73af3b28d97baa5df228d9ef1aa8d0c9224 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 30 Oct 2024 07:19:28 -0500 Subject: [PATCH 12/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 4983dc82f2c..c2cceb7813c 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -398,7 +398,7 @@ jobs: removeBracket=$(echo $removeBracket | tr -d ']') echo "$removeBracket" missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'map(select(index($testsTypedIn)))') - if [[ "$missingCases" == "[]" ]]; then + if [[ "$missingCases" != "[]" ]]; then echo "Missing cases: $missingCases" missingCasesWithOS="$missingCases [android]" echo $(jq --arg getCase "$missingCasesWithOS" --compact-output 'select(.title | contains($getCase)) | .title' <<< "$getTest") >> input.json From 700fd51852f4107ea8fbf34964966d601cdccb50 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 30 Oct 2024 07:25:05 -0500 Subject: [PATCH 13/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index c2cceb7813c..ecdf53ac107 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -387,20 +387,17 @@ jobs: getTest=$(curl -X GET -H 'Content-Type: application/json' \ -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ "https://dsvavsp.testrail.io//index.php?/api/v2/get_cases/29§ion_id=9683" | jq .cases[]) - echo "Automated test cases: $getTest" getTestCaseNewName=$(jq --compact-output -s 'add' input.json) - echo "testCasesFromFile: $getTestCaseNewName" groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]') getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]') - echo "TestCasesFirstName: $getFirstTestNewName" for y in ${{ inputs.tests_to_run}}; do removeBracket=$(echo $y | tr -d '[') removeBracket=$(echo $removeBracket | tr -d ']') echo "$removeBracket" missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'map(select(index($testsTypedIn)))') - if [[ "$missingCases" != "[]" ]]; then - echo "Missing cases: $missingCases" - missingCasesWithOS="$missingCases [android]" + if [[ "$missingCases" == "[]" ]]; then + echo "Missing cases: $removeBracket" + missingCasesWithOS="$removeBracket [android]" echo $(jq --arg getCase "$missingCasesWithOS" --compact-output 'select(.title | contains($getCase)) | .title' <<< "$getTest") >> input.json fi done From d6cd815b3286d57cc88a94fe9eaacc37013630bd Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 30 Oct 2024 10:46:15 -0500 Subject: [PATCH 14/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index ecdf53ac107..92305188350 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -398,7 +398,10 @@ jobs: if [[ "$missingCases" == "[]" ]]; then echo "Missing cases: $removeBracket" missingCasesWithOS="$removeBracket [android]" - echo $(jq --arg getCase "$missingCasesWithOS" --compact-output 'select(.title | contains($getCase)) | .title' <<< "$getTest") >> input.json + echo "$missingCasesWithOS" + test=$(echo $getTest| jq --arg getCase "$missingCasesWithOS" --compact-output 'select(.title | contains($getCase))) + echo "$test" + echo $(jq --arg getCase "$missingCasesWithOS" --compact-output 'select(.title | contains($getCase))' <<< "$getTest") >> input.json fi done getTestCaseNewName=$(jq --compact-output -s 'add' input.json) From f9c94bdb55eba415e4f57783835c84c9f08de992 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 30 Oct 2024 10:47:57 -0500 Subject: [PATCH 15/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 92305188350..f457be3e538 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -399,7 +399,7 @@ jobs: echo "Missing cases: $removeBracket" missingCasesWithOS="$removeBracket [android]" echo "$missingCasesWithOS" - test=$(echo $getTest| jq --arg getCase "$missingCasesWithOS" --compact-output 'select(.title | contains($getCase))) + test=$(echo $getTest| jq --arg getCase "$missingCasesWithOS" --compact-output 'select(.title | contains($getCase))') echo "$test" echo $(jq --arg getCase "$missingCasesWithOS" --compact-output 'select(.title | contains($getCase))' <<< "$getTest") >> input.json fi From ec283eae8344a906e7fe139d6b91141096ffa7b0 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 30 Oct 2024 11:58:52 -0500 Subject: [PATCH 16/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index f457be3e538..414856fc2f9 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -373,6 +373,7 @@ jobs: uses: actions/checkout@v3 - name: update-test-names run: | + echo "" >> input.json for ((i=0; ; i+=250)); do echo "i = $i" getTestCaseNewName=$(curl -X GET -H 'Content-Type: application/json' \ @@ -401,7 +402,9 @@ jobs: echo "$missingCasesWithOS" test=$(echo $getTest| jq --arg getCase "$missingCasesWithOS" --compact-output 'select(.title | contains($getCase))') echo "$test" - echo $(jq --arg getCase "$missingCasesWithOS" --compact-output 'select(.title | contains($getCase))' <<< "$getTest") >> input.json + echo "" >> input.json + test2=$(echo $getTestCaseNewName | jq --argjson testToAdd $test --compact-output '. += [$testToAdd]') + echo $test2" >> input.json fi done getTestCaseNewName=$(jq --compact-output -s 'add' input.json) From 1e999fcc2e3b9071bb1f8402ad87cba4f9651e92 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 30 Oct 2024 13:06:30 -0500 Subject: [PATCH 17/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 414856fc2f9..b2f9b1782e0 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -403,8 +403,8 @@ jobs: test=$(echo $getTest| jq --arg getCase "$missingCasesWithOS" --compact-output 'select(.title | contains($getCase))') echo "$test" echo "" >> input.json - test2=$(echo $getTestCaseNewName | jq --argjson testToAdd $test --compact-output '. += [$testToAdd]') - echo $test2" >> input.json + test2=$(echo $getTestCaseNewName | jq --argjson testToAdd $test '. += [$testToAdd]') + echo $test2 >> input.json fi done getTestCaseNewName=$(jq --compact-output -s 'add' input.json) From 920649c85f093692ecd0cf6cce9114ec6f703ec3 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 30 Oct 2024 13:08:53 -0500 Subject: [PATCH 18/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index b2f9b1782e0..962e6bb79ee 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -403,7 +403,7 @@ jobs: test=$(echo $getTest| jq --arg getCase "$missingCasesWithOS" --compact-output 'select(.title | contains($getCase))') echo "$test" echo "" >> input.json - test2=$(echo $getTestCaseNewName | jq --argjson testToAdd $test '. += [$testToAdd]') + test2=$(echo $getTestCaseNewName | jq --argjson testToAdd "$test" '. += [$testToAdd]') echo $test2 >> input.json fi done From 25129acca7a8f8734aad6d389cecb9e2395fe5f9 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 30 Oct 2024 13:56:44 -0500 Subject: [PATCH 19/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 97 ++++++++++++++----------------- 1 file changed, 43 insertions(+), 54 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 962e6bb79ee..78795a33f56 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -409,57 +409,46 @@ jobs: done getTestCaseNewName=$(jq --compact-output -s 'add' input.json) echo "testCasesFromFileUpdated: $getTestCaseNewName" -# for ((i=0; ; i+=250)); do -# echo "i = $i" -# getTestCaseNewName=$(curl -X GET -H 'Content-Type: application/json' \ -# -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ -# "https://dsvavsp.testrail.io//index.php?/api/v2/get_tests/${{ needs.matrix_send_test_results_to_testrail.outputs.test_run_id_number }}&offset=$i") -# echo $(jq --compact-output '[.tests[] | .title |= sub("(]).*$"; "]")]' <<< "$getTestCaseNewName") >> input.json -# if [[ $(jq '._links.next == null' <<< "$getTestCaseNewName") == 'true' ]]; -# then -# break -# fi -# done -# getTest=$(curl -X GET -H 'Content-Type: application/json' \ -# -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ -# "https://dsvavsp.testrail.io//index.php?/api/v2/get_test/43942") -# echo "$getTest" -# getTestCaseNewName=$(jq --compact-output -s 'add' input.json) -# groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]') -# getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]') -# getCasesID=$(curl -X GET -H 'Content-Type: application/json' \ -# -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ -# "https://dsvavsp.testrail.io//index.php?/api/v2/get_cases/29") -# updateRunWithNewCases=$(curl -X POST -H 'Content-Type: application/json' \ -# -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ -# -d '{"suite_id": 92, "include_all": false, "case_ids": '$(echo $getCasesID | jq --argjson testRailNames "$getFirstTestNewName" --compact-output '.cases | map(select(.title == $testRailNames[])) | map(.id)')'}' \ -# "https://dsvavsp.testrail.io//index.php?/api/v2/update_run/${{needs.matrix_send_test_results_to_testrail.outputs.test_run_id_number}}") -# getTestCases=$(curl -X GET -H 'Content-Type: application/json' \ -# -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ -# "https://dsvavsp.testrail.io//index.php?/api/v2/get_tests/${{needs.matrix_send_test_results_to_testrail.outputs.test_run_id_number}}") -# for i in $(echo $getTestCases | jq -r '.tests[].id'); do -# getTestName=$(echo $getTestCases | jq --argjson testIDs "$i" -r '.tests | map(select(.id == $testIDs)) | .[0].title') - -# getFailedTests=$(echo $getTestCaseNewName | jq --compact-output 'map(select(.status_id == 5)) | map(.title)') -# isTestFailed=$(echo $getFailedTests | jq 'any(. == "'"$getTestName"'")') -# getRetestTests=$(echo $getTestCaseNewName | jq --compact-output 'map(select(.status_id == 4)) | map(.title)') -# isTestRetest=$(echo $getRetestTests | jq 'any(. == "'"$getTestName"'")') -# getPassedTests=$(echo $getTestCaseNewName | jq --compact-output 'map(select(.status_id == 1)) | map(.title)') -# isTestPassed=$(echo $getPassedTests | jq 'any(. == "'"$getTestName"'")') -# if [[ "$isTestFailed" == "true" ]]; then -# resp5=$(curl -X POST -H 'Content-Type: application/json' \ -# -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ -# -d '{"status_id": 5}' \ -# "https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"") -# elif [[ "$isTestRetest" == "true" ]]; then -# resp5=$(curl -X POST -H 'Content-Type: application/json' \ -# -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ -# -d '{"status_id": 4}' \ -# "https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"") -# elif [[ "$isTestPassed" == "true" ]]; then -# resp5=$(curl -X POST -H 'Content-Type: application/json' \ -# -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ -# -d '{"status_id": 1}' \ -# "https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"") -# fi -# done + groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]') + getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]') + getCasesID=$(curl -X GET -H 'Content-Type: application/json' \ + -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ + "https://dsvavsp.testrail.io//index.php?/api/v2/get_cases/29") + updateRunWithNewCases=$(curl -X POST -H 'Content-Type: application/json' \ + -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ + -d '{"suite_id": 92, "include_all": false, "case_ids": '$(echo $getCasesID | jq --argjson testRailNames "$getFirstTestNewName" --compact-output '.cases | map(select(.title == $testRailNames[])) | map(.id)')'}' \ + "https://dsvavsp.testrail.io//index.php?/api/v2/update_run/${{needs.matrix_send_test_results_to_testrail.outputs.test_run_id_number}}") + getTestCases=$(curl -X GET -H 'Content-Type: application/json' \ + -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ + "https://dsvavsp.testrail.io//index.php?/api/v2/get_tests/${{needs.matrix_send_test_results_to_testrail.outputs.test_run_id_number}}") + for i in $(echo $getTestCases | jq -r '.tests[].id'); do + getTestName=$(echo $getTestCases | jq --argjson testIDs "$i" -r '.tests | map(select(.id == $testIDs)) | .[0].title') + + getFailedTests=$(echo $getTestCaseNewName | jq --compact-output 'map(select(.status_id == 5)) | map(.title)') + isTestFailed=$(echo $getFailedTests | jq 'any(. == "'"$getTestName"'")') + getRetestTests=$(echo $getTestCaseNewName | jq --compact-output 'map(select(.status_id == 4)) | map(.title)') + isTestRetest=$(echo $getRetestTests | jq 'any(. == "'"$getTestName"'")') + getPassedTests=$(echo $getTestCaseNewName | jq --compact-output 'map(select(.status_id == 1)) | map(.title)') + isTestPassed=$(echo $getPassedTests | jq 'any(. == "'"$getTestName"'")') + if [[ "$isTestFailed" == "true" ]]; then + resp5=$(curl -X POST -H 'Content-Type: application/json' \ + -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ + -d '{"status_id": 5}' \ + "https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"") + elif [[ "$isTestRetest" == "true" ]]; then + resp5=$(curl -X POST -H 'Content-Type: application/json' \ + -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ + -d '{"status_id": 4}' \ + "https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"") + elif [[ "$isTestPassed" == "true" ]]; then + resp5=$(curl -X POST -H 'Content-Type: application/json' \ + -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ + -d '{"status_id": 1}' \ + "https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"") + else + resp5=$(curl -X POST -H 'Content-Type: application/json' \ + -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ + -d '{"status_id": 5}' \ + "https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"") + fi + done From 85c05510632f3135bb89978fbe14b466544bde0c Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 30 Oct 2024 14:01:16 -0500 Subject: [PATCH 20/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 78795a33f56..ee45da8023d 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -411,6 +411,7 @@ jobs: echo "testCasesFromFileUpdated: $getTestCaseNewName" groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]') getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]') + echo "$getFirstTestNewName" getCasesID=$(curl -X GET -H 'Content-Type: application/json' \ -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ "https://dsvavsp.testrail.io//index.php?/api/v2/get_cases/29") @@ -421,6 +422,7 @@ jobs: getTestCases=$(curl -X GET -H 'Content-Type: application/json' \ -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ "https://dsvavsp.testrail.io//index.php?/api/v2/get_tests/${{needs.matrix_send_test_results_to_testrail.outputs.test_run_id_number}}") + echo "$getTestCases" for i in $(echo $getTestCases | jq -r '.tests[].id'); do getTestName=$(echo $getTestCases | jq --argjson testIDs "$i" -r '.tests | map(select(.id == $testIDs)) | .[0].title') From f8a22a7679bedbac7d68056e3fc77d865cd469bf Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 30 Oct 2024 14:07:07 -0500 Subject: [PATCH 21/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index ee45da8023d..ab0f29014ce 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -418,10 +418,10 @@ jobs: updateRunWithNewCases=$(curl -X POST -H 'Content-Type: application/json' \ -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ -d '{"suite_id": 92, "include_all": false, "case_ids": '$(echo $getCasesID | jq --argjson testRailNames "$getFirstTestNewName" --compact-output '.cases | map(select(.title == $testRailNames[])) | map(.id)')'}' \ - "https://dsvavsp.testrail.io//index.php?/api/v2/update_run/${{needs.matrix_send_test_results_to_testrail.outputs.test_run_id_number}}") + "https://dsvavsp.testrail.io//index.php?/api/v2/update_run/6171") getTestCases=$(curl -X GET -H 'Content-Type: application/json' \ -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ - "https://dsvavsp.testrail.io//index.php?/api/v2/get_tests/${{needs.matrix_send_test_results_to_testrail.outputs.test_run_id_number}}") + "https://dsvavsp.testrail.io//index.php?/api/v2/get_tests/6171") echo "$getTestCases" for i in $(echo $getTestCases | jq -r '.tests[].id'); do getTestName=$(echo $getTestCases | jq --argjson testIDs "$i" -r '.tests | map(select(.id == $testIDs)) | .[0].title') From 8e439774d55b473af58af799e07ee8e26748ac86 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 30 Oct 2024 14:51:33 -0500 Subject: [PATCH 22/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index ab0f29014ce..e6930ce7390 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -402,26 +402,23 @@ jobs: echo "$missingCasesWithOS" test=$(echo $getTest| jq --arg getCase "$missingCasesWithOS" --compact-output 'select(.title | contains($getCase))') echo "$test" - echo "" >> input.json - test2=$(echo $getTestCaseNewName | jq --argjson testToAdd "$test" '. += [$testToAdd]') + echo "[]" >> missingTests.json + echo $(jq --argjson testToAdd "$test" '. += [$testToAdd]' <<< "$test") >> missingTests.json echo $test2 >> input.json fi done - getTestCaseNewName=$(jq --compact-output -s 'add' input.json) - echo "testCasesFromFileUpdated: $getTestCaseNewName" - groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]') - getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]') - echo "$getFirstTestNewName" + getMissingTestCaseNames=$(jq --compact-output -s 'add' input.json) + echo "$getMissingTestCaseNames" getCasesID=$(curl -X GET -H 'Content-Type: application/json' \ -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ "https://dsvavsp.testrail.io//index.php?/api/v2/get_cases/29") updateRunWithNewCases=$(curl -X POST -H 'Content-Type: application/json' \ -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ -d '{"suite_id": 92, "include_all": false, "case_ids": '$(echo $getCasesID | jq --argjson testRailNames "$getFirstTestNewName" --compact-output '.cases | map(select(.title == $testRailNames[])) | map(.id)')'}' \ - "https://dsvavsp.testrail.io//index.php?/api/v2/update_run/6171") + "https://dsvavsp.testrail.io//index.php?/api/v2/update_run/${{needs.matrix_send_test_results_to_testrail.outputs.test_run_id_number}}") getTestCases=$(curl -X GET -H 'Content-Type: application/json' \ -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ - "https://dsvavsp.testrail.io//index.php?/api/v2/get_tests/6171") + "https://dsvavsp.testrail.io//index.php?/api/v2/get_tests/${{needs.matrix_send_test_results_to_testrail.outputs.test_run_id_number}}") echo "$getTestCases" for i in $(echo $getTestCases | jq -r '.tests[].id'); do getTestName=$(echo $getTestCases | jq --argjson testIDs "$i" -r '.tests | map(select(.id == $testIDs)) | .[0].title') @@ -447,10 +444,11 @@ jobs: -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ -d '{"status_id": 1}' \ "https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"") - else - resp5=$(curl -X POST -H 'Content-Type: application/json' \ - -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ - -d '{"status_id": 5}' \ - "https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"") fi done + for i in $(echo $getMissingTestCaseNames | jq -r '.[].id'); do + resp5=$(curl -X POST -H 'Content-Type: application/json' \ + -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ + -d '{"status_id": 4}' \ + "https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"") + done From ee374530be26b72419710b33b47eb6cb5cc7e1ee Mon Sep 17 00:00:00 2001 From: rbontrager Date: Thu, 31 Oct 2024 06:12:00 -0500 Subject: [PATCH 23/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index e6930ce7390..d142b82bc8f 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -402,23 +402,28 @@ jobs: echo "$missingCasesWithOS" test=$(echo $getTest| jq --arg getCase "$missingCasesWithOS" --compact-output 'select(.title | contains($getCase))') echo "$test" - echo "[]" >> missingTests.json - echo $(jq --argjson testToAdd "$test" '. += [$testToAdd]' <<< "$test") >> missingTests.json + echo "" >> input.json + test2=$(echo $getTestCaseNewName | jq --argjson testToAdd "$test" '. += [$testToAdd]') echo $test2 >> input.json fi done - getMissingTestCaseNames=$(jq --compact-output -s 'add' input.json) - echo "$getMissingTestCaseNames" + getTestCaseNewName=$(jq --compact-output -s 'add' input.json) + echo "testCasesFromFileUpdated: $getTestCaseNewName" + groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]') + getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]') + echo "$getFirstTestNewName" getCasesID=$(curl -X GET -H 'Content-Type: application/json' \ -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ "https://dsvavsp.testrail.io//index.php?/api/v2/get_cases/29") + echo "$getCasesID" updateRunWithNewCases=$(curl -X POST -H 'Content-Type: application/json' \ -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ -d '{"suite_id": 92, "include_all": false, "case_ids": '$(echo $getCasesID | jq --argjson testRailNames "$getFirstTestNewName" --compact-output '.cases | map(select(.title == $testRailNames[])) | map(.id)')'}' \ - "https://dsvavsp.testrail.io//index.php?/api/v2/update_run/${{needs.matrix_send_test_results_to_testrail.outputs.test_run_id_number}}") + "https://dsvavsp.testrail.io//index.php?/api/v2/update_run/6171") + echo "$updateRunWithNewCases" getTestCases=$(curl -X GET -H 'Content-Type: application/json' \ -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ - "https://dsvavsp.testrail.io//index.php?/api/v2/get_tests/${{needs.matrix_send_test_results_to_testrail.outputs.test_run_id_number}}") + "https://dsvavsp.testrail.io//index.php?/api/v2/get_tests/6171") echo "$getTestCases" for i in $(echo $getTestCases | jq -r '.tests[].id'); do getTestName=$(echo $getTestCases | jq --argjson testIDs "$i" -r '.tests | map(select(.id == $testIDs)) | .[0].title') @@ -444,11 +449,10 @@ jobs: -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ -d '{"status_id": 1}' \ "https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"") + else + resp5=$(curl -X POST -H 'Content-Type: application/json' \ + -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ + -d '{"status_id": 5}' \ + "https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"") fi done - for i in $(echo $getMissingTestCaseNames | jq -r '.[].id'); do - resp5=$(curl -X POST -H 'Content-Type: application/json' \ - -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ - -d '{"status_id": 4}' \ - "https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"") - done From c176d013b56ec52331d0627dd89385cfc3f7fdf7 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Thu, 31 Oct 2024 06:25:54 -0500 Subject: [PATCH 24/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index d142b82bc8f..3d72dc2221e 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -420,6 +420,8 @@ jobs: -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ -d '{"suite_id": 92, "include_all": false, "case_ids": '$(echo $getCasesID | jq --argjson testRailNames "$getFirstTestNewName" --compact-output '.cases | map(select(.title == $testRailNames[])) | map(.id)')'}' \ "https://dsvavsp.testrail.io//index.php?/api/v2/update_run/6171") + test=$(echo $getCasesID | jq --argjson testRailNames "$getFirstTestNewName" --compact-output '.cases | map(select(.title == $testRailNames[])) | map(.id)') + echo "matchedTestCases: $test" echo "$updateRunWithNewCases" getTestCases=$(curl -X GET -H 'Content-Type: application/json' \ -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ From e62150b4ef46bb429d210e470f24f29161442848 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Thu, 31 Oct 2024 06:39:41 -0500 Subject: [PATCH 25/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 551 +++++++++++++++--------------- 1 file changed, 272 insertions(+), 279 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 3d72dc2221e..3fae7c89a47 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -72,300 +72,300 @@ env: SLACK_API_TOKEN: ${{ secrets.SLACK_API_TOKEN }} jobs: - # start_slack_thread: - # if: github.event_name == 'schedule' - # name: Start Slack thread - # uses: ./.github/workflows/start_slack_thread.yml - # secrets: inherit - # with: - # channel_name: va-mobile-build-alerts - # message: 'Starting E2E Android tests. Please see :thread: for results. This process may take a while.' + start_slack_thread: + if: github.event_name == 'schedule' + name: Start Slack thread + uses: ./.github/workflows/start_slack_thread.yml + secrets: inherit + with: + channel_name: va-mobile-build-alerts + message: 'Starting E2E Android tests. Please see :thread: for results. This process may take a while.' - # find_detox_tests_to_run: - # if: github.event_name == 'pull_request' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' - # uses: ./.github/workflows/e2e_detox_mapping.yml + find_detox_tests_to_run: + if: github.event_name == 'pull_request' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' + uses: ./.github/workflows/e2e_detox_mapping.yml - # output_detox_tests_to_run: - # runs-on: macos-latest-xl - # needs: find_detox_tests_to_run - # outputs: - # output1: ${{ steps.matrix_value.outputs.matrix }} - # output2: ${{ steps.matrix_value.outputs.individual_matrix}} - # steps: - # - name: Checkout - # uses: actions/checkout@v3 - # with: - # ref: ${{ github.ref }} - # - name: 'Get Matrix Value' - # id: matrix_value - # run: | - # if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]] || [[ "${{ inputs.tests_to_run}}" != "" ]]; then - # if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]]; then - # e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]') - # echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT" - # echo "individual_matrix=" >> "$GITHUB_OUTPUT" - # else - # if [[ "${{ inputs.tests_to_run}}" != "" ]]; then - # echo "matrix=${{ toJson(inputs.tests_to_run)}}" >> "$GITHUB_OUTPUT" - # echo "individual_matrix=true" >> "$GITHUB_OUTPUT" - # else - # echo "matrix=" >> "$GITHUB_OUTPUT" - # fi - # fi - # else - # if [[ "${{ needs.find_detox_tests_to_run.outputs.test_run }}" != "" ]]; then - # echo "${{needs.find_detox_tests_to_run.outputs.test_matrix}}" - # if [[ "${{needs.find_detox_tests_to_run.outputs.test_matrix}}" == "[]" ]]; then - # if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]]; then - # e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]') - # echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT" - # echo "individual_matrix=" >> "$GITHUB_OUTPUT" - # else - # if [[ "${{ inputs.tests_to_run}}" != "" ]]; then - # echo "matrix=${{ toJson(inputs.tests_to_run)}}" >> "$GITHUB_OUTPUT" - # echo "individual_matrix=true" >> "$GITHUB_OUTPUT" - # else - # echo "matrix=" >> "$GITHUB_OUTPUT" - # fi - # fi - # else - # resp=${{toJson(needs.find_detox_tests_to_run.outputs.test_matrix)}} - # echo "matrix=$resp" >> "$GITHUB_OUTPUT" - # fi - # fi - # fi - # env: - # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + output_detox_tests_to_run: + runs-on: macos-latest-xl + needs: find_detox_tests_to_run + outputs: + output1: ${{ steps.matrix_value.outputs.matrix }} + output2: ${{ steps.matrix_value.outputs.individual_matrix}} + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + ref: ${{ github.ref }} + - name: 'Get Matrix Value' + id: matrix_value + run: | + if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]] || [[ "${{ inputs.tests_to_run}}" != "" ]]; then + if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]]; then + e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]') + echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT" + echo "individual_matrix=" >> "$GITHUB_OUTPUT" + else + if [[ "${{ inputs.tests_to_run}}" != "" ]]; then + echo "matrix=${{ toJson(inputs.tests_to_run)}}" >> "$GITHUB_OUTPUT" + echo "individual_matrix=true" >> "$GITHUB_OUTPUT" + else + echo "matrix=" >> "$GITHUB_OUTPUT" + fi + fi + else + if [[ "${{ needs.find_detox_tests_to_run.outputs.test_run }}" != "" ]]; then + echo "${{needs.find_detox_tests_to_run.outputs.test_matrix}}" + if [[ "${{needs.find_detox_tests_to_run.outputs.test_matrix}}" == "[]" ]]; then + if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]]; then + e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]') + echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT" + echo "individual_matrix=" >> "$GITHUB_OUTPUT" + else + if [[ "${{ inputs.tests_to_run}}" != "" ]]; then + echo "matrix=${{ toJson(inputs.tests_to_run)}}" >> "$GITHUB_OUTPUT" + echo "individual_matrix=true" >> "$GITHUB_OUTPUT" + else + echo "matrix=" >> "$GITHUB_OUTPUT" + fi + fi + else + resp=${{toJson(needs.find_detox_tests_to_run.outputs.test_matrix)}} + echo "matrix=$resp" >> "$GITHUB_OUTPUT" + fi + fi + fi + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # matrix-e2e-android: - # if: (!cancelled()) && needs.output_detox_tests_to_run.outputs.output1 != '' - # runs-on: macos-latest-xl - # needs: [start_slack_thread, output_detox_tests_to_run] - # strategy: - # fail-fast: false - # matrix: - # testsuite: ${{fromJson(needs.output_detox_tests_to_run.outputs.output1)}} + matrix-e2e-android: + if: (!cancelled()) && needs.output_detox_tests_to_run.outputs.output1 != '' + runs-on: macos-latest-xl + needs: [start_slack_thread, output_detox_tests_to_run] + strategy: + fail-fast: false + matrix: + testsuite: ${{fromJson(needs.output_detox_tests_to_run.outputs.output1)}} - # steps: - # - uses: actions/checkout@v3 - # with: - # ref: ${{ github.ref }} + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.ref }} - # - name: Set git config - # run: | - # git config --global user.name 'VA Automation Bot' - # git config --global user.email 'va-mobileapp@adhocteam.us' + - name: Set git config + run: | + git config --global user.name 'VA Automation Bot' + git config --global user.email 'va-mobileapp@adhocteam.us' - # - name: Decode base64 encoded keys - # working-directory: VAMobile/android - # run: | - # mkdir keys - # cd keys - # echo "${{ secrets.GOOGLE_KS }}" | base64 --decode > vamobile - # echo "${{ secrets.GOOGLE_SA_JSON }}" | base64 --decode > service-account.json - # echo "${{ secrets.FIREBASE_DIST_FILE_BASE64 }}" | base64 --decode > firebase-dist.json - # cd ../app - # echo "${{ secrets.GOOGLE_SERVICES_JSON }}" | base64 --decode > google-services.json + - name: Decode base64 encoded keys + working-directory: VAMobile/android + run: | + mkdir keys + cd keys + echo "${{ secrets.GOOGLE_KS }}" | base64 --decode > vamobile + echo "${{ secrets.GOOGLE_SA_JSON }}" | base64 --decode > service-account.json + echo "${{ secrets.FIREBASE_DIST_FILE_BASE64 }}" | base64 --decode > firebase-dist.json + cd ../app + echo "${{ secrets.GOOGLE_SERVICES_JSON }}" | base64 --decode > google-services.json - # - name: Setup ruby and restore bundler cache - # uses: ruby/setup-ruby@v1 - # with: - # ruby-version: '3.0.2' - # bundler-cache: true - # working-directory: VAMobile/android + - name: Setup ruby and restore bundler cache + uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.0.2' + bundler-cache: true + working-directory: VAMobile/android - # - name: Set up JDK - # uses: actions/setup-java@v3 - # with: - # java-version: 17 - # distribution: 'microsoft' + - name: Set up JDK + uses: actions/setup-java@v3 + with: + java-version: 17 + distribution: 'microsoft' - # - name: Setup node and restore yarn cache - # uses: actions/setup-node@v3 - # with: - # node-version-file: 'VAMobile/.nvmrc' - # cache: 'yarn' - # cache-dependency-path: './VAMobile/yarn.lock' + - name: Setup node and restore yarn cache + uses: actions/setup-node@v3 + with: + node-version-file: 'VAMobile/.nvmrc' + cache: 'yarn' + cache-dependency-path: './VAMobile/yarn.lock' - # - name: Install npm dependencies - # run: yarn install --frozen-lockfile --non-interactive + - name: Install npm dependencies + run: yarn install --frozen-lockfile --non-interactive - # - name: Set app environment variables - # run: yarn env:staging + - name: Set app environment variables + run: yarn env:staging - # - name: Bundle Android app - # run: yarn e2e:android-build + - name: Bundle Android app + run: yarn e2e:android-build - # - name: Run e2e tests for Android - Full Test - # id: run_e2e_tests - # if: ${{needs.output_detox_tests_to_run.outputs.output2 == ''}} - # uses: reactivecircus/android-emulator-runner@v2 - # with: - # working-directory: VAMobile - # api-level: 28 - # profile: pixel_6_pro - # force-avd-creation: false - # disable-animations: true - # arch: x86_64 - # avd-name: Pixel_4_XL_API_28 - # script: yarn e2e:android-test /e2e/tests/${{matrix.testsuite}} --updateSnapshot - # continue-on-error: true + - name: Run e2e tests for Android - Full Test + id: run_e2e_tests + if: ${{needs.output_detox_tests_to_run.outputs.output2 == ''}} + uses: reactivecircus/android-emulator-runner@v2 + with: + working-directory: VAMobile + api-level: 28 + profile: pixel_6_pro + force-avd-creation: false + disable-animations: true + arch: x86_64 + avd-name: Pixel_4_XL_API_28 + script: yarn e2e:android-test /e2e/tests/${{matrix.testsuite}} --updateSnapshot + continue-on-error: true - # - name: Run e2e tests for Android - # id: run_e2e_tests_nav_AF - # if: ${{needs.output_detox_tests_to_run.outputs.output2 != ''}} - # uses: reactivecircus/android-emulator-runner@v2 - # with: - # working-directory: VAMobile - # api-level: 28 - # profile: pixel_6_pro - # force-avd-creation: false - # disable-animations: true - # arch: x86_64 - # avd-name: Pixel_4_XL_API_28 - # script: yarn e2e:android-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot + - name: Run e2e tests for Android + id: run_e2e_tests_nav_AF + if: ${{needs.output_detox_tests_to_run.outputs.output2 != ''}} + uses: reactivecircus/android-emulator-runner@v2 + with: + working-directory: VAMobile + api-level: 28 + profile: pixel_6_pro + force-avd-creation: false + disable-animations: true + arch: x86_64 + avd-name: Pixel_4_XL_API_28 + script: yarn e2e:android-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot - # - name: Run e2e tests for Android on failure - # if: failure() && steps.run_e2e_tests_nav_AF.outcome == 'failure' - # uses: reactivecircus/android-emulator-runner@v2 - # with: - # working-directory: VAMobile - # api-level: 28 - # profile: pixel_6_pro - # force-avd-creation: false - # disable-animations: true - # arch: x86_64 - # avd-name: Pixel_4_XL_API_28 - # script: yarn e2e:android-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot + - name: Run e2e tests for Android on failure + if: failure() && steps.run_e2e_tests_nav_AF.outcome == 'failure' + uses: reactivecircus/android-emulator-runner@v2 + with: + working-directory: VAMobile + api-level: 28 + profile: pixel_6_pro + force-avd-creation: false + disable-animations: true + arch: x86_64 + avd-name: Pixel_4_XL_API_28 + script: yarn e2e:android-test /e2e/tests/Navigation.e2e AvailabilityFramework.e2e ${{matrix.testsuite}}.e2e --updateSnapshot - # - name: Upload e2e-junit - # if: failure() || success() - # uses: actions/upload-artifact@v4 - # with: - # name: ${{matrix.testsuite}}-e2e-junit - # path: VAMobile/e2e/test_reports/e2e-junit.xml + - name: Upload e2e-junit + if: failure() || success() + uses: actions/upload-artifact@v4 + with: + name: ${{matrix.testsuite}}-e2e-junit + path: VAMobile/e2e/test_reports/e2e-junit.xml - # - name: Upload artifacts on failure - # if: failure() || steps.run_e2e_tests.outcome == 'failure' - # uses: actions/upload-artifact@v4 - # with: - # name: detox-artifacts-${{ runner.os }}-${{ github.run_id }}-${{matrix.testsuite}} - # path: VAMobile/artifacts - # retention-days: 1 + - name: Upload artifacts on failure + if: failure() || steps.run_e2e_tests.outcome == 'failure' + uses: actions/upload-artifact@v4 + with: + name: detox-artifacts-${{ runner.os }}-${{ github.run_id }}-${{matrix.testsuite}} + path: VAMobile/artifacts + retention-days: 1 - # - name: Fail workflow if needed(View e2e step for details) - # if: steps.run_e2e_tests.outcome == 'failure' - # run: exit 1 + - name: Fail workflow if needed(View e2e step for details) + if: steps.run_e2e_tests.outcome == 'failure' + run: exit 1 - # output-slack-results-and-update-detox-failure-ticket: - # if: (!cancelled()) && github.event_name == 'schedule' - # needs: [matrix-e2e-android, start_slack_thread] - # runs-on: macos-latest-xl - # steps: - # - uses: actions/checkout@v3 - # with: - # ref: ${{ github.ref }} + output-slack-results-and-update-detox-failure-ticket: + if: (!cancelled()) && github.event_name == 'schedule' + needs: [matrix-e2e-android, start_slack_thread] + runs-on: macos-latest-xl + steps: + - uses: actions/checkout@v3 + with: + ref: ${{ github.ref }} - # - name: Download results - # uses: actions/download-artifact@v4 - # with: - # path: VAMobile/e2e/test_reports + - name: Download results + uses: actions/download-artifact@v4 + with: + path: VAMobile/e2e/test_reports - # - name: Inform Slack - # id: inform_slack - # shell: bash - # run: | - # if grep -rq "" .; then - # echo SLACK_THREAD_TS=${ts} >> $GITHUB_OUTPUT - # ts=$(curl -X POST -H 'Authorization: Bearer '"$SLACK_API_TOKEN"' ' \ - # -H 'Content-type: application/json' \ - # --data '{"channel":"'${{needs.start_slack_thread.outputs.channel_id}}'","thread_ts":"'${{needs.start_slack_thread.outputs.thread_ts}}'","text":"Failed! Please check workflow for results: https://github.com/department-of-veterans-affairs/va-mobile-app/actions"}' \ - # https://slack.com/api/chat.postMessage| - # jq -r '.ts') - # echo SLACK_THREAD_TS=${ts} >> $GITHUB_OUTPUT - # echo "TEST_FAILURE=true" >> "$GITHUB_OUTPUT" - # else - # ts=$(curl -X POST -H 'Authorization: Bearer '"$SLACK_API_TOKEN"' ' \ - # -H 'Content-type: application/json' \ - # --data '{"channel":"'${{needs.start_slack_thread.outputs.channel_id}}'","thread_ts":"'${{needs.start_slack_thread.outputs.thread_ts}}'","text":"Success! All E2E tests have passed"}' \ - # https://slack.com/api/chat.postMessage| - # jq -r '.ts') - # fi + - name: Inform Slack + id: inform_slack + shell: bash + run: | + if grep -rq "" .; then + echo SLACK_THREAD_TS=${ts} >> $GITHUB_OUTPUT + ts=$(curl -X POST -H 'Authorization: Bearer '"$SLACK_API_TOKEN"' ' \ + -H 'Content-type: application/json' \ + --data '{"channel":"'${{needs.start_slack_thread.outputs.channel_id}}'","thread_ts":"'${{needs.start_slack_thread.outputs.thread_ts}}'","text":"Failed! Please check workflow for results: https://github.com/department-of-veterans-affairs/va-mobile-app/actions"}' \ + https://slack.com/api/chat.postMessage| + jq -r '.ts') + echo SLACK_THREAD_TS=${ts} >> $GITHUB_OUTPUT + echo "TEST_FAILURE=true" >> "$GITHUB_OUTPUT" + else + ts=$(curl -X POST -H 'Authorization: Bearer '"$SLACK_API_TOKEN"' ' \ + -H 'Content-type: application/json' \ + --data '{"channel":"'${{needs.start_slack_thread.outputs.channel_id}}'","thread_ts":"'${{needs.start_slack_thread.outputs.thread_ts}}'","text":"Success! All E2E tests have passed"}' \ + https://slack.com/api/chat.postMessage| + jq -r '.ts') + fi - # - name: Find failing tests - # id: failing_tests - # shell: bash - # run: | - # if grep -rq "" .; then - # failing_tests_list=$(grep -rl "") - # failing_tests="" - # for i in ${failing_tests_list[@]}; do - # remove_before=${i%.ts*} - # remove_after=${remove_before#*test_reports/} - # echo "$remove_after" - # if [ -z "${failing_tests}" ]; then - # failing_tests=$(echo $failing_tests"$remove_after") - # else - # failing_tests=$(echo $failing_tests", ""$remove_after") - # fi - # done - # echo "FAILING_TEST=$failing_tests" >> "$GITHUB_OUTPUT" - # fi + - name: Find failing tests + id: failing_tests + shell: bash + run: | + if grep -rq "" .; then + failing_tests_list=$(grep -rl "") + failing_tests="" + for i in ${failing_tests_list[@]}; do + remove_before=${i%.ts*} + remove_after=${remove_before#*test_reports/} + echo "$remove_after" + if [ -z "${failing_tests}" ]; then + failing_tests=$(echo $failing_tests"$remove_after") + else + failing_tests=$(echo $failing_tests", ""$remove_after") + fi + done + echo "FAILING_TEST=$failing_tests" >> "$GITHUB_OUTPUT" + fi - # - name: Github CLI Authentication - # run: | - # echo "${{ secrets.GITHUB_TOKEN }}" >> token.txt - # gh auth login --with-token < token.txt + - name: Github CLI Authentication + run: | + echo "${{ secrets.GITHUB_TOKEN }}" >> token.txt + gh auth login --with-token < token.txt - # - name: Update a ticket on failure (if needed) - # if: steps.inform_slack.outputs.TEST_FAILURE != '' - # id: find_if_ticket_already_exists - # run: | - # old_body=$(gh issue list --json body --jq '.[] | .body' --state open --search "Bug - Detox - Fix Overnight Failures in:title") - # if [[ "$old_body" != "" ]]; then - # ticket_number=$(gh issue list --json number --jq '.[] | .number' --state open --search "Bug - Detox - Fix Overnight Failures in:title") - # new_body=$(echo "$old_body"$'\n'"- "${{ env.DATE_OF_ISSUE}}" on Android: "${{steps.failing_tests.outputs.FAILING_TEST}}) - # echo "$new_body" - # echo "TICKET_EXISTS=true" >> "$GITHUB_OUTPUT" - # gh issue edit $ticket_number -b "$new_body" - # else - # echo "TICKET_EXISTS=" >> "$GITHUB_OUTPUT" - # fi - # env: - # GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Update a ticket on failure (if needed) + if: steps.inform_slack.outputs.TEST_FAILURE != '' + id: find_if_ticket_already_exists + run: | + old_body=$(gh issue list --json body --jq '.[] | .body' --state open --search "Bug - Detox - Fix Overnight Failures in:title") + if [[ "$old_body" != "" ]]; then + ticket_number=$(gh issue list --json number --jq '.[] | .number' --state open --search "Bug - Detox - Fix Overnight Failures in:title") + new_body=$(echo "$old_body"$'\n'"- "${{ env.DATE_OF_ISSUE}}" on Android: "${{steps.failing_tests.outputs.FAILING_TEST}}) + echo "$new_body" + echo "TICKET_EXISTS=true" >> "$GITHUB_OUTPUT" + gh issue edit $ticket_number -b "$new_body" + else + echo "TICKET_EXISTS=" >> "$GITHUB_OUTPUT" + fi + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # - name: Make a ticket on failure (if needed) - # if: steps.inform_slack.outputs.TEST_FAILURE != '' && steps.find_if_ticket_already_exists.outputs.TICKET_EXISTS == '' - # uses: JasonEtco/create-an-issue@v2 - # with: - # filename: .github/ISSUE_TEMPLATE/detox_nightly_build_failure.md - # search_existing: open - # env: - # dateOfIssue: ${{ env.DATE_OF_ISSUE }} - # OS: "Android" - # issues: ${{steps.failing_tests.outputs.FAILING_TEST}} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # id: create-issue + - name: Make a ticket on failure (if needed) + if: steps.inform_slack.outputs.TEST_FAILURE != '' && steps.find_if_ticket_already_exists.outputs.TICKET_EXISTS == '' + uses: JasonEtco/create-an-issue@v2 + with: + filename: .github/ISSUE_TEMPLATE/detox_nightly_build_failure.md + search_existing: open + env: + dateOfIssue: ${{ env.DATE_OF_ISSUE }} + OS: "Android" + issues: ${{steps.failing_tests.outputs.FAILING_TEST}} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + id: create-issue - # matrix_send_test_results_to_testrail: - # if: (!cancelled()) && github.event.inputs.run_testRail == 'true' - # needs: [matrix-e2e-android, output_detox_tests_to_run] - # strategy: - # fail-fast: false - # max-parallel: 1 - # matrix: - # testsuite: ${{ fromJSON(needs.output_detox_tests_to_run.outputs.output1) }} - # name: Update testRail Results - # uses: ./.github/workflows/update_testrail_results.yml - # with: - # test_names: "${{matrix.testsuite}}" - # testRail_name: ${{ inputs.testRail_name }} - # test_OS_name: "Android" - # secrets: inherit + matrix_send_test_results_to_testrail: + if: (!cancelled()) && github.event.inputs.run_testRail == 'true' + needs: [matrix-e2e-android, output_detox_tests_to_run] + strategy: + fail-fast: false + max-parallel: 1 + matrix: + testsuite: ${{ fromJSON(needs.output_detox_tests_to_run.outputs.output1) }} + name: Update testRail Results + uses: ./.github/workflows/update_testrail_results.yml + with: + test_names: "${{matrix.testsuite}}" + testRail_name: ${{ inputs.testRail_name }} + test_OS_name: "Android" + secrets: inherit update-test-names: if: (!cancelled()) && github.event.inputs.run_testRail == 'true' - #needs: [matrix-e2e-android, output_detox_tests_to_run, matrix_send_test_results_to_testrail] + needs: [matrix-e2e-android, output_detox_tests_to_run, matrix_send_test_results_to_testrail] continue-on-error: false runs-on: ubuntu-latest steps: @@ -378,7 +378,7 @@ jobs: echo "i = $i" getTestCaseNewName=$(curl -X GET -H 'Content-Type: application/json' \ -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ - "https://dsvavsp.testrail.io//index.php?/api/v2/get_tests/6171&offset=$i") + "https://dsvavsp.testrail.io//index.php?/api/v2/get_tests/${{ needs.matrix_send_test_results_to_testrail.outputs.test_run_id_number }}&offset=$i") echo $(jq --compact-output '[.tests[] | .title |= sub("(]).*$"; "]")]' <<< "$getTestCaseNewName") >> input.json if [[ $(jq '._links.next == null' <<< "$getTestCaseNewName") == 'true' ]]; then @@ -400,33 +400,26 @@ jobs: echo "Missing cases: $removeBracket" missingCasesWithOS="$removeBracket [android]" echo "$missingCasesWithOS" - test=$(echo $getTest| jq --arg getCase "$missingCasesWithOS" --compact-output 'select(.title | contains($getCase))') - echo "$test" + matchMissingCases=$(echo $getTest| jq --arg getCase "$missingCasesWithOS" --compact-output 'select(.title | contains($getCase))') echo "" >> input.json - test2=$(echo $getTestCaseNewName | jq --argjson testToAdd "$test" '. += [$testToAdd]') - echo $test2 >> input.json + addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') + echo $addMissingCasesToArray >> input.json fi done getTestCaseNewName=$(jq --compact-output -s 'add' input.json) echo "testCasesFromFileUpdated: $getTestCaseNewName" groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]') getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]') - echo "$getFirstTestNewName" getCasesID=$(curl -X GET -H 'Content-Type: application/json' \ -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ "https://dsvavsp.testrail.io//index.php?/api/v2/get_cases/29") - echo "$getCasesID" updateRunWithNewCases=$(curl -X POST -H 'Content-Type: application/json' \ -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ -d '{"suite_id": 92, "include_all": false, "case_ids": '$(echo $getCasesID | jq --argjson testRailNames "$getFirstTestNewName" --compact-output '.cases | map(select(.title == $testRailNames[])) | map(.id)')'}' \ - "https://dsvavsp.testrail.io//index.php?/api/v2/update_run/6171") - test=$(echo $getCasesID | jq --argjson testRailNames "$getFirstTestNewName" --compact-output '.cases | map(select(.title == $testRailNames[])) | map(.id)') - echo "matchedTestCases: $test" - echo "$updateRunWithNewCases" + "https://dsvavsp.testrail.io//index.php?/api/v2/update_run/${{needs.matrix_send_test_results_to_testrail.outputs.test_run_id_number}}") getTestCases=$(curl -X GET -H 'Content-Type: application/json' \ -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ - "https://dsvavsp.testrail.io//index.php?/api/v2/get_tests/6171") - echo "$getTestCases" + "https://dsvavsp.testrail.io//index.php?/api/v2/get_tests/${{needs.matrix_send_test_results_to_testrail.outputs.test_run_id_number}}") for i in $(echo $getTestCases | jq -r '.tests[].id'); do getTestName=$(echo $getTestCases | jq --argjson testIDs "$i" -r '.tests | map(select(.id == $testIDs)) | .[0].title') @@ -454,7 +447,7 @@ jobs: else resp5=$(curl -X POST -H 'Content-Type: application/json' \ -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ - -d '{"status_id": 5}' \ + -d '{"status_id": 4}' \ "https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"") fi done From 3c4d3ae239aa6ff8d69a24380c11280eeabd22b9 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Thu, 31 Oct 2024 08:17:15 -0500 Subject: [PATCH 26/74] Update e2e names to match file names --- VAMobile/e2e/tests/Appointments.e2e.ts | 2 +- VAMobile/e2e/tests/AppointmentsExpanded.e2e.ts | 2 +- VAMobile/e2e/tests/AvailabilityFramework.e2e.ts | 16 ++++++++-------- VAMobile/e2e/tests/Cerner.e2e.ts | 2 +- VAMobile/e2e/tests/Claims.e2e.ts | 2 +- VAMobile/e2e/tests/ContactInformation.e2e.ts | 2 +- VAMobile/e2e/tests/DecisionLetters.e2e.ts | 2 +- VAMobile/e2e/tests/DirectDeposit.e2e.ts | 2 +- VAMobile/e2e/tests/DisabilityRatings.e2e.ts | 2 +- VAMobile/e2e/tests/HomeScreen.e2e.ts | 2 +- VAMobile/e2e/tests/LoginScreen.e2e.ts | 2 +- VAMobile/e2e/tests/Messages.e2e.ts | 2 +- VAMobile/e2e/tests/MilitaryInformation.e2e.ts | 2 +- VAMobile/e2e/tests/Onboarding.e2e.ts | 2 +- VAMobile/e2e/tests/Payments.e2e.ts | 2 +- .../e2e/tests/PersonalInformationScreen.e2e.ts | 2 +- VAMobile/e2e/tests/Prescriptions.e2e.ts | 2 +- VAMobile/e2e/tests/ProfileScreen.e2e.ts | 2 +- VAMobile/e2e/tests/PushNotifications.e2e.ts | 2 +- VAMobile/e2e/tests/SettingsScreen.e2e.ts | 2 +- VAMobile/e2e/tests/SignIn.e2e.ts | 2 +- VAMobile/e2e/tests/VALetters.e2e.ts | 2 +- VAMobile/e2e/tests/VaccineRecords.e2e.ts | 2 +- VAMobile/e2e/tests/VeteranStatusCard.e2e.ts | 2 +- VAMobile/e2e/tests/VeteransCrisisLine.e2e.ts | 2 +- 25 files changed, 32 insertions(+), 32 deletions(-) diff --git a/VAMobile/e2e/tests/Appointments.e2e.ts b/VAMobile/e2e/tests/Appointments.e2e.ts index bb4322740c9..059cffa6145 100644 --- a/VAMobile/e2e/tests/Appointments.e2e.ts +++ b/VAMobile/e2e/tests/Appointments.e2e.ts @@ -39,7 +39,7 @@ beforeAll(async () => { await openAppointments() }) -describe('Appointments Screen', () => { +describe('Appointments', () => { it('should tap and open the appointment details links', async () => { await waitFor(element(by.text('Vilanisi Reddy'))) .toBeVisible() diff --git a/VAMobile/e2e/tests/AppointmentsExpanded.e2e.ts b/VAMobile/e2e/tests/AppointmentsExpanded.e2e.ts index 630d17cf08e..2665408d61d 100644 --- a/VAMobile/e2e/tests/AppointmentsExpanded.e2e.ts +++ b/VAMobile/e2e/tests/AppointmentsExpanded.e2e.ts @@ -1074,7 +1074,7 @@ beforeAll(async () => { .withTimeout(10000) }) -describe(':ios: Appointments Screen Expansion', () => { +describe(':ios: AppointmentsExpanded', () => { apppointmentVerification() apppointmentVerification(true) }) diff --git a/VAMobile/e2e/tests/AvailabilityFramework.e2e.ts b/VAMobile/e2e/tests/AvailabilityFramework.e2e.ts index 064495a41be..135bd0c3154 100644 --- a/VAMobile/e2e/tests/AvailabilityFramework.e2e.ts +++ b/VAMobile/e2e/tests/AvailabilityFramework.e2e.ts @@ -131,13 +131,13 @@ const AFNavigationForIndividual = [ ['BenefitLetters.e2e', 'WG_ClaimLettersScreen', 'Benefits', 'Claims', 'Claim letters'], ['Claims.e2e', 'WG_ClaimDetailsScreen', 'Benefits', 'Claims', 'Claims history', 'Received December 05, 2021'], // [ - // 'Claims.e2e', - // 'WG_SubmitEvidence', - // 'Benefits', - // 'Claims', - // 'Claims history', - // 'Received December 05, 2021', - // 'Submit evidence', + // 'Claims.e2e', + // 'WG_SubmitEvidence', + // 'Benefits', + // 'Claims', + // 'Claims history', + // 'Received December 05, 2021', + // 'Submit evidence', // ], ['Appeals.e2e', 'WG_AppealDetailsScreen', 'Benefits', 'Claims', 'Claims history', 'Received July 17, 2008'], [ @@ -178,7 +178,7 @@ export async function runTests(testRun, AFNavigationArray, x) { }) } -describe('Availability Framework', () => { +describe('AvailabilityFramework', () => { if (AFValue !== undefined) { let AFNeeded = false for (let x = 0; x < AFNavigationForIndividual.length; x++) { diff --git a/VAMobile/e2e/tests/Cerner.e2e.ts b/VAMobile/e2e/tests/Cerner.e2e.ts index 3831539e16b..38af628edda 100644 --- a/VAMobile/e2e/tests/Cerner.e2e.ts +++ b/VAMobile/e2e/tests/Cerner.e2e.ts @@ -59,7 +59,7 @@ beforeAll(async () => { } }) -describe(':android: Cerner Notice', () => { +describe(':android: Cerner', () => { it('should match the cerner subtext on home screen', async () => { await waitFor(element(by.text(CernerIdConstants.CERNER_HOME_SUBTEXT_TEXT))) .toBeVisible() diff --git a/VAMobile/e2e/tests/Claims.e2e.ts b/VAMobile/e2e/tests/Claims.e2e.ts index c5ff4d13984..dff2d109fcb 100644 --- a/VAMobile/e2e/tests/Claims.e2e.ts +++ b/VAMobile/e2e/tests/Claims.e2e.ts @@ -74,7 +74,7 @@ beforeAll(async () => { await openClaimsHistory() }) -describe('Claims Screen', () => { +describe('Claims', () => { it('should match the Claims history page design', async () => { await expect(element(by.text('Your active claims, decision reviews, and appeals'))).toExist() await expect(element(by.id(ClaimsE2eIdConstants.CLAIM_1_ID))).toExist() diff --git a/VAMobile/e2e/tests/ContactInformation.e2e.ts b/VAMobile/e2e/tests/ContactInformation.e2e.ts index 3660979a305..c3c8cb06040 100644 --- a/VAMobile/e2e/tests/ContactInformation.e2e.ts +++ b/VAMobile/e2e/tests/ContactInformation.e2e.ts @@ -414,7 +414,7 @@ beforeAll(async () => { await openContactInfo() }) -describe(':ios: Contact Info Screen', () => { +describe(':ios: ContactInformation', () => { it('should match the Contact Info page design', async () => { await expect(element(by.id(ContactInfoE2eIdConstants.MAILING_ADDRESS_ID))).toExist() await expect(element(by.id(ContactInfoE2eIdConstants.HOME_ADDRESS_ID))).toExist() diff --git a/VAMobile/e2e/tests/DecisionLetters.e2e.ts b/VAMobile/e2e/tests/DecisionLetters.e2e.ts index 0d348afbf13..4cfe9a25d9d 100644 --- a/VAMobile/e2e/tests/DecisionLetters.e2e.ts +++ b/VAMobile/e2e/tests/DecisionLetters.e2e.ts @@ -29,7 +29,7 @@ beforeAll(async () => { await openClaimsHistory() }) -describe('Decision Letters Screen', () => { +describe('DecisionLetters', () => { it('should tap on the closed tab', async () => { await element(by.id(CommonE2eIdConstants.CLAIMS_HISTORY_CLOSED_TAB_ID)).tap() }) diff --git a/VAMobile/e2e/tests/DirectDeposit.e2e.ts b/VAMobile/e2e/tests/DirectDeposit.e2e.ts index 8fdb94e1252..00929e1be0b 100644 --- a/VAMobile/e2e/tests/DirectDeposit.e2e.ts +++ b/VAMobile/e2e/tests/DirectDeposit.e2e.ts @@ -47,7 +47,7 @@ beforeAll(async () => { await openDirectDeposit() }) -describe('Direct Deposit Screen', () => { +describe('DirectDeposit', () => { it('should match design', async () => { await expect(element(by.text(DirectDepositConstants.SCREEN_TITLE))).toExist() await expect(element(by.text(DirectDepositConstants.INFORMATION_HEADING))).toExist() diff --git a/VAMobile/e2e/tests/DisabilityRatings.e2e.ts b/VAMobile/e2e/tests/DisabilityRatings.e2e.ts index 04c40b0cac7..0f9143f00d1 100644 --- a/VAMobile/e2e/tests/DisabilityRatings.e2e.ts +++ b/VAMobile/e2e/tests/DisabilityRatings.e2e.ts @@ -22,7 +22,7 @@ beforeAll(async () => { await openDisabilityRating() }) -describe('Disability Ratings', () => { +describe('DisabilityRatings', () => { it('should match the disability ratings page design', async () => { await expect(element(by.text(DisabilityRatingsIdConstants.COMBINED_DISABILITY_RATING_TEXT))).toExist() await expect(element(by.text(DisabilityRatingsIdConstants.COMBINED_DISABILITY_RATING_TEXT))).toExist() diff --git a/VAMobile/e2e/tests/HomeScreen.e2e.ts b/VAMobile/e2e/tests/HomeScreen.e2e.ts index 49ae00ed6cb..3659bdf6608 100644 --- a/VAMobile/e2e/tests/HomeScreen.e2e.ts +++ b/VAMobile/e2e/tests/HomeScreen.e2e.ts @@ -40,7 +40,7 @@ beforeAll(async () => { await loginToDemoMode() }) -describe('Home Screen', () => { +describe('HomeScreen', () => { it(':android: should enable AF use case 3', async () => { await enableAF('WG_Home', 'AllowFunction') await verifyAF(undefined, 'AllowFunction', undefined) diff --git a/VAMobile/e2e/tests/LoginScreen.e2e.ts b/VAMobile/e2e/tests/LoginScreen.e2e.ts index 1be4a16dddf..36637017e08 100644 --- a/VAMobile/e2e/tests/LoginScreen.e2e.ts +++ b/VAMobile/e2e/tests/LoginScreen.e2e.ts @@ -8,7 +8,7 @@ export const LoginE2eIdConstants = { LOGIN_APP_VERSION_ID: 'AppVersionTestID', } -describe('Login Screen', () => { +describe('LoginScreen', () => { it('should show login page content', async () => { try { await waitFor(element(by.id(CommonE2eIdConstants.VA_LOGO_ICON_ID))) diff --git a/VAMobile/e2e/tests/Messages.e2e.ts b/VAMobile/e2e/tests/Messages.e2e.ts index ea5110971ad..b9721d41fe8 100644 --- a/VAMobile/e2e/tests/Messages.e2e.ts +++ b/VAMobile/e2e/tests/Messages.e2e.ts @@ -95,7 +95,7 @@ beforeAll(async () => { await openMessages() }) -describe('Messages Screen', () => { +describe('Messages', () => { it('should match the messages page design', async () => { await expect(element(by.id(CommonE2eIdConstants.START_NEW_MESSAGE_BUTTON_ID))).toExist() await expect(element(by.text('Inbox (3)'))).toExist() diff --git a/VAMobile/e2e/tests/MilitaryInformation.e2e.ts b/VAMobile/e2e/tests/MilitaryInformation.e2e.ts index d3c1b1129cb..9002f18edc0 100644 --- a/VAMobile/e2e/tests/MilitaryInformation.e2e.ts +++ b/VAMobile/e2e/tests/MilitaryInformation.e2e.ts @@ -49,7 +49,7 @@ export async function verifyMilitaryInfo(militaryBranch: string) { }) } -describe('Military Info Screen', () => { +describe('MilitaryInformation', () => { verifyMilitaryInfo('United States Coast Guard') verifyMilitaryInfo('United States Army') verifyMilitaryInfo('United States Air Force') diff --git a/VAMobile/e2e/tests/Onboarding.e2e.ts b/VAMobile/e2e/tests/Onboarding.e2e.ts index e0bada940ec..53cd227f158 100644 --- a/VAMobile/e2e/tests/Onboarding.e2e.ts +++ b/VAMobile/e2e/tests/Onboarding.e2e.ts @@ -12,7 +12,7 @@ beforeAll(async () => { await loginToDemoMode(false) }) -describe('Onboarding Screen', () => { +describe('Onboarding', () => { it('should show the welcome onboarding content', async () => { const onboardingIconCheck = await element(by.id(OnboardingE2eIdConstants.VA_ICON_ID)).takeScreenshot( 'VAIconOnboarding', diff --git a/VAMobile/e2e/tests/Payments.e2e.ts b/VAMobile/e2e/tests/Payments.e2e.ts index 8d36aba215a..eef68ca3acd 100644 --- a/VAMobile/e2e/tests/Payments.e2e.ts +++ b/VAMobile/e2e/tests/Payments.e2e.ts @@ -24,7 +24,7 @@ beforeAll(async () => { await openVAPaymentHistory() }) -describe('Payments Screen', () => { +describe('Payments', () => { it('should match the Payments history page design', async () => { await expect(element(by.id(PaymentsE2eIDConstants.MISSING_PAYMENTS_LINK_ID))).toExist() await expect(element(by.id(PaymentsE2eIDConstants.PAYMENTS_YEAR_PICKER_ID))).toExist() diff --git a/VAMobile/e2e/tests/PersonalInformationScreen.e2e.ts b/VAMobile/e2e/tests/PersonalInformationScreen.e2e.ts index 7e527f70531..75d553a4512 100644 --- a/VAMobile/e2e/tests/PersonalInformationScreen.e2e.ts +++ b/VAMobile/e2e/tests/PersonalInformationScreen.e2e.ts @@ -97,7 +97,7 @@ beforeAll(async () => { await openPersonalInformation() }) -describe('Personal Info Screen', () => { +describe('PersonalInformationScreen', () => { it('should match design', async () => { await expect(element(by.text('Date of birth'))).toExist() await expect(element(by.text('January 01, 1950'))).toExist() diff --git a/VAMobile/e2e/tests/Prescriptions.e2e.ts b/VAMobile/e2e/tests/Prescriptions.e2e.ts index c490c1f424d..fab2ee2b64b 100644 --- a/VAMobile/e2e/tests/Prescriptions.e2e.ts +++ b/VAMobile/e2e/tests/Prescriptions.e2e.ts @@ -148,7 +148,7 @@ export async function validateFilter(name: string, quantity: number, helperText? }) } -describe('Prescriptions Screen', () => { +describe('Prescriptions', () => { it('should match the prescription page design', async () => { tempPath = await element(by.id(PrescriptionsE2eIdConstants.FILTER_PRESCRIPTIONS_TEST_ID)).takeScreenshot( 'filterSortWrapperBox', diff --git a/VAMobile/e2e/tests/ProfileScreen.e2e.ts b/VAMobile/e2e/tests/ProfileScreen.e2e.ts index 84914d553cd..60b3ad82a0a 100644 --- a/VAMobile/e2e/tests/ProfileScreen.e2e.ts +++ b/VAMobile/e2e/tests/ProfileScreen.e2e.ts @@ -17,7 +17,7 @@ beforeAll(async () => { await openProfile() }) -describe('Profile Screen', () => { +describe('ProfileScreen', () => { it('should show profile list content', async () => { await waitFor(element(by.text(ProfileE2eIdConstants.PROFILE_TEXT))) .toExist() diff --git a/VAMobile/e2e/tests/PushNotifications.e2e.ts b/VAMobile/e2e/tests/PushNotifications.e2e.ts index ec3984364f6..273c3144226 100644 --- a/VAMobile/e2e/tests/PushNotifications.e2e.ts +++ b/VAMobile/e2e/tests/PushNotifications.e2e.ts @@ -19,7 +19,7 @@ const mockNotification = { }, } -describe(':ios: Push Notifications', () => { +describe(':ios: PushNotifications', () => { it('dead state: should navigate to appropriate screen when launching', async () => { await device.launchApp({ delete: true, diff --git a/VAMobile/e2e/tests/SettingsScreen.e2e.ts b/VAMobile/e2e/tests/SettingsScreen.e2e.ts index bfd8fef0703..7d14e6aa29e 100644 --- a/VAMobile/e2e/tests/SettingsScreen.e2e.ts +++ b/VAMobile/e2e/tests/SettingsScreen.e2e.ts @@ -33,7 +33,7 @@ beforeAll(async () => { await openSettings() }) -describe('Settings Screen', () => { +describe('SettingsScreen', () => { it('should show settings list content', async () => { await waitFor(element(by.text(SettingsE2eIdConstants.SETTINGS_SCREEN_TEXT))) .toExist() diff --git a/VAMobile/e2e/tests/SignIn.e2e.ts b/VAMobile/e2e/tests/SignIn.e2e.ts index 30743d6eaee..1a25d54a419 100644 --- a/VAMobile/e2e/tests/SignIn.e2e.ts +++ b/VAMobile/e2e/tests/SignIn.e2e.ts @@ -15,7 +15,7 @@ export const SignE2eIdConstants = { CONTINUE_SIGN_IN_BTN_ID: 'Continue to sign in', } -describe('Sign In', () => { +describe('SignIn', () => { it('should show sign in page content', async () => { try { await waitFor(element(by.id(CommonE2eIdConstants.VA_LOGO_ICON_ID))) diff --git a/VAMobile/e2e/tests/VALetters.e2e.ts b/VAMobile/e2e/tests/VALetters.e2e.ts index 75b5f59b35d..b07a244f498 100644 --- a/VAMobile/e2e/tests/VALetters.e2e.ts +++ b/VAMobile/e2e/tests/VALetters.e2e.ts @@ -72,7 +72,7 @@ beforeAll(async () => { await openLetters() }) -describe('VA Letters', () => { +describe('VALetters', () => { it('should match design', async () => { await expect(element(by.text(LettersConstants.MAILING_ADDRESS))).toExist() }) diff --git a/VAMobile/e2e/tests/VaccineRecords.e2e.ts b/VAMobile/e2e/tests/VaccineRecords.e2e.ts index e967e48f331..633c66fa3c6 100644 --- a/VAMobile/e2e/tests/VaccineRecords.e2e.ts +++ b/VAMobile/e2e/tests/VaccineRecords.e2e.ts @@ -17,7 +17,7 @@ beforeAll(async () => { await openVaccineRecords() }) -describe('Vaccine Records Screen', () => { +describe('VaccineRecords', () => { it('should show vaccine records list content', async () => { await expect(element(by.text('VA vaccines'))).toExist() await expect(element(by.id(VaccinesE2eIdConstants.VACCINE_1_ID))).toExist() diff --git a/VAMobile/e2e/tests/VeteranStatusCard.e2e.ts b/VAMobile/e2e/tests/VeteranStatusCard.e2e.ts index a3ed4bcb3b0..53a5d6ca3b8 100644 --- a/VAMobile/e2e/tests/VeteranStatusCard.e2e.ts +++ b/VAMobile/e2e/tests/VeteranStatusCard.e2e.ts @@ -117,7 +117,7 @@ export async function verifyMilitaryInfo(militaryBranch) { await expect(element(by.text(militaryBranch))).toExist() }) } -describe('Veteran Status Card', () => { +describe('VeteranStatusCard', () => { it('should match design in the home screen', async () => { await waitFor(element(by.id(VeteranStatusCardConstants.VETERAN_STATUS_ID))) .toBeVisible() diff --git a/VAMobile/e2e/tests/VeteransCrisisLine.e2e.ts b/VAMobile/e2e/tests/VeteransCrisisLine.e2e.ts index 56240e7715e..9437d05f55c 100644 --- a/VAMobile/e2e/tests/VeteransCrisisLine.e2e.ts +++ b/VAMobile/e2e/tests/VeteransCrisisLine.e2e.ts @@ -33,7 +33,7 @@ beforeAll(async () => { await openVeteransCrisisLine() }) -describe('Veterans Crisis Line', () => { +describe('VeteransCrisisLine', () => { it('should match design', async () => { await expect(element(by.text(VCLConstants.HEADING_TEXT))).toExist() await expect(element(by.text(VCLConstants.SUBHEADING_TEXT))).toExist() From 6b6d2bcf3afe8bfef85968d9e6972c6cd90bf29d Mon Sep 17 00:00:00 2001 From: rbontrager Date: Thu, 31 Oct 2024 11:29:54 -0500 Subject: [PATCH 27/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 3fae7c89a47..cbc556175db 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -394,6 +394,7 @@ jobs: for y in ${{ inputs.tests_to_run}}; do removeBracket=$(echo $y | tr -d '[') removeBracket=$(echo $removeBracket | tr -d ']') + removeBracket=$(echo $removeBracket | tr -d ',') echo "$removeBracket" missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'map(select(index($testsTypedIn)))') if [[ "$missingCases" == "[]" ]]; then From 64c17f89cf76a0024ec5c1e0b598d0f995e47e7d Mon Sep 17 00:00:00 2001 From: rbontrager Date: Thu, 31 Oct 2024 11:46:42 -0500 Subject: [PATCH 28/74] Put screen names back --- VAMobile/e2e/tests/Appointments.e2e.ts | 2 +- VAMobile/e2e/tests/AppointmentsExpanded.e2e.ts | 2 +- VAMobile/e2e/tests/AvailabilityFramework.e2e.ts | 2 +- VAMobile/e2e/tests/Cerner.e2e.ts | 2 +- VAMobile/e2e/tests/Claims.e2e.ts | 2 +- VAMobile/e2e/tests/ContactInformation.e2e.ts | 2 +- VAMobile/e2e/tests/DecisionLetters.e2e.ts | 2 +- VAMobile/e2e/tests/DirectDeposit.e2e.ts | 2 +- VAMobile/e2e/tests/DisabilityRatings.e2e.ts | 2 +- VAMobile/e2e/tests/HomeScreen.e2e.ts | 2 +- VAMobile/e2e/tests/LoginScreen.e2e.ts | 2 +- VAMobile/e2e/tests/Messages.e2e.ts | 2 +- VAMobile/e2e/tests/MilitaryInformation.e2e.ts | 2 +- VAMobile/e2e/tests/Onboarding.e2e.ts | 2 +- VAMobile/e2e/tests/Payments.e2e.ts | 2 +- VAMobile/e2e/tests/PersonalInformationScreen.e2e.ts | 2 +- VAMobile/e2e/tests/Prescriptions.e2e.ts | 2 +- VAMobile/e2e/tests/ProfileScreen.e2e.ts | 2 +- VAMobile/e2e/tests/PushNotifications.e2e.ts | 2 +- VAMobile/e2e/tests/SettingsScreen.e2e.ts | 2 +- VAMobile/e2e/tests/SignIn.e2e.ts | 2 +- VAMobile/e2e/tests/VALetters.e2e.ts | 2 +- VAMobile/e2e/tests/VaccineRecords.e2e.ts | 2 +- VAMobile/e2e/tests/VeteranStatusCard.e2e.ts | 2 +- VAMobile/e2e/tests/VeteransCrisisLine.e2e.ts | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/VAMobile/e2e/tests/Appointments.e2e.ts b/VAMobile/e2e/tests/Appointments.e2e.ts index 059cffa6145..bb4322740c9 100644 --- a/VAMobile/e2e/tests/Appointments.e2e.ts +++ b/VAMobile/e2e/tests/Appointments.e2e.ts @@ -39,7 +39,7 @@ beforeAll(async () => { await openAppointments() }) -describe('Appointments', () => { +describe('Appointments Screen', () => { it('should tap and open the appointment details links', async () => { await waitFor(element(by.text('Vilanisi Reddy'))) .toBeVisible() diff --git a/VAMobile/e2e/tests/AppointmentsExpanded.e2e.ts b/VAMobile/e2e/tests/AppointmentsExpanded.e2e.ts index 2665408d61d..630d17cf08e 100644 --- a/VAMobile/e2e/tests/AppointmentsExpanded.e2e.ts +++ b/VAMobile/e2e/tests/AppointmentsExpanded.e2e.ts @@ -1074,7 +1074,7 @@ beforeAll(async () => { .withTimeout(10000) }) -describe(':ios: AppointmentsExpanded', () => { +describe(':ios: Appointments Screen Expansion', () => { apppointmentVerification() apppointmentVerification(true) }) diff --git a/VAMobile/e2e/tests/AvailabilityFramework.e2e.ts b/VAMobile/e2e/tests/AvailabilityFramework.e2e.ts index 135bd0c3154..c838ec428fa 100644 --- a/VAMobile/e2e/tests/AvailabilityFramework.e2e.ts +++ b/VAMobile/e2e/tests/AvailabilityFramework.e2e.ts @@ -178,7 +178,7 @@ export async function runTests(testRun, AFNavigationArray, x) { }) } -describe('AvailabilityFramework', () => { +describe('Availability Framework', () => { if (AFValue !== undefined) { let AFNeeded = false for (let x = 0; x < AFNavigationForIndividual.length; x++) { diff --git a/VAMobile/e2e/tests/Cerner.e2e.ts b/VAMobile/e2e/tests/Cerner.e2e.ts index 38af628edda..3831539e16b 100644 --- a/VAMobile/e2e/tests/Cerner.e2e.ts +++ b/VAMobile/e2e/tests/Cerner.e2e.ts @@ -59,7 +59,7 @@ beforeAll(async () => { } }) -describe(':android: Cerner', () => { +describe(':android: Cerner Notice', () => { it('should match the cerner subtext on home screen', async () => { await waitFor(element(by.text(CernerIdConstants.CERNER_HOME_SUBTEXT_TEXT))) .toBeVisible() diff --git a/VAMobile/e2e/tests/Claims.e2e.ts b/VAMobile/e2e/tests/Claims.e2e.ts index dff2d109fcb..c5ff4d13984 100644 --- a/VAMobile/e2e/tests/Claims.e2e.ts +++ b/VAMobile/e2e/tests/Claims.e2e.ts @@ -74,7 +74,7 @@ beforeAll(async () => { await openClaimsHistory() }) -describe('Claims', () => { +describe('Claims Screen', () => { it('should match the Claims history page design', async () => { await expect(element(by.text('Your active claims, decision reviews, and appeals'))).toExist() await expect(element(by.id(ClaimsE2eIdConstants.CLAIM_1_ID))).toExist() diff --git a/VAMobile/e2e/tests/ContactInformation.e2e.ts b/VAMobile/e2e/tests/ContactInformation.e2e.ts index c3c8cb06040..3660979a305 100644 --- a/VAMobile/e2e/tests/ContactInformation.e2e.ts +++ b/VAMobile/e2e/tests/ContactInformation.e2e.ts @@ -414,7 +414,7 @@ beforeAll(async () => { await openContactInfo() }) -describe(':ios: ContactInformation', () => { +describe(':ios: Contact Info Screen', () => { it('should match the Contact Info page design', async () => { await expect(element(by.id(ContactInfoE2eIdConstants.MAILING_ADDRESS_ID))).toExist() await expect(element(by.id(ContactInfoE2eIdConstants.HOME_ADDRESS_ID))).toExist() diff --git a/VAMobile/e2e/tests/DecisionLetters.e2e.ts b/VAMobile/e2e/tests/DecisionLetters.e2e.ts index 4cfe9a25d9d..0d348afbf13 100644 --- a/VAMobile/e2e/tests/DecisionLetters.e2e.ts +++ b/VAMobile/e2e/tests/DecisionLetters.e2e.ts @@ -29,7 +29,7 @@ beforeAll(async () => { await openClaimsHistory() }) -describe('DecisionLetters', () => { +describe('Decision Letters Screen', () => { it('should tap on the closed tab', async () => { await element(by.id(CommonE2eIdConstants.CLAIMS_HISTORY_CLOSED_TAB_ID)).tap() }) diff --git a/VAMobile/e2e/tests/DirectDeposit.e2e.ts b/VAMobile/e2e/tests/DirectDeposit.e2e.ts index 00929e1be0b..8fdb94e1252 100644 --- a/VAMobile/e2e/tests/DirectDeposit.e2e.ts +++ b/VAMobile/e2e/tests/DirectDeposit.e2e.ts @@ -47,7 +47,7 @@ beforeAll(async () => { await openDirectDeposit() }) -describe('DirectDeposit', () => { +describe('Direct Deposit Screen', () => { it('should match design', async () => { await expect(element(by.text(DirectDepositConstants.SCREEN_TITLE))).toExist() await expect(element(by.text(DirectDepositConstants.INFORMATION_HEADING))).toExist() diff --git a/VAMobile/e2e/tests/DisabilityRatings.e2e.ts b/VAMobile/e2e/tests/DisabilityRatings.e2e.ts index 0f9143f00d1..04c40b0cac7 100644 --- a/VAMobile/e2e/tests/DisabilityRatings.e2e.ts +++ b/VAMobile/e2e/tests/DisabilityRatings.e2e.ts @@ -22,7 +22,7 @@ beforeAll(async () => { await openDisabilityRating() }) -describe('DisabilityRatings', () => { +describe('Disability Ratings', () => { it('should match the disability ratings page design', async () => { await expect(element(by.text(DisabilityRatingsIdConstants.COMBINED_DISABILITY_RATING_TEXT))).toExist() await expect(element(by.text(DisabilityRatingsIdConstants.COMBINED_DISABILITY_RATING_TEXT))).toExist() diff --git a/VAMobile/e2e/tests/HomeScreen.e2e.ts b/VAMobile/e2e/tests/HomeScreen.e2e.ts index 3659bdf6608..49ae00ed6cb 100644 --- a/VAMobile/e2e/tests/HomeScreen.e2e.ts +++ b/VAMobile/e2e/tests/HomeScreen.e2e.ts @@ -40,7 +40,7 @@ beforeAll(async () => { await loginToDemoMode() }) -describe('HomeScreen', () => { +describe('Home Screen', () => { it(':android: should enable AF use case 3', async () => { await enableAF('WG_Home', 'AllowFunction') await verifyAF(undefined, 'AllowFunction', undefined) diff --git a/VAMobile/e2e/tests/LoginScreen.e2e.ts b/VAMobile/e2e/tests/LoginScreen.e2e.ts index 36637017e08..1be4a16dddf 100644 --- a/VAMobile/e2e/tests/LoginScreen.e2e.ts +++ b/VAMobile/e2e/tests/LoginScreen.e2e.ts @@ -8,7 +8,7 @@ export const LoginE2eIdConstants = { LOGIN_APP_VERSION_ID: 'AppVersionTestID', } -describe('LoginScreen', () => { +describe('Login Screen', () => { it('should show login page content', async () => { try { await waitFor(element(by.id(CommonE2eIdConstants.VA_LOGO_ICON_ID))) diff --git a/VAMobile/e2e/tests/Messages.e2e.ts b/VAMobile/e2e/tests/Messages.e2e.ts index b9721d41fe8..ea5110971ad 100644 --- a/VAMobile/e2e/tests/Messages.e2e.ts +++ b/VAMobile/e2e/tests/Messages.e2e.ts @@ -95,7 +95,7 @@ beforeAll(async () => { await openMessages() }) -describe('Messages', () => { +describe('Messages Screen', () => { it('should match the messages page design', async () => { await expect(element(by.id(CommonE2eIdConstants.START_NEW_MESSAGE_BUTTON_ID))).toExist() await expect(element(by.text('Inbox (3)'))).toExist() diff --git a/VAMobile/e2e/tests/MilitaryInformation.e2e.ts b/VAMobile/e2e/tests/MilitaryInformation.e2e.ts index 9002f18edc0..d3c1b1129cb 100644 --- a/VAMobile/e2e/tests/MilitaryInformation.e2e.ts +++ b/VAMobile/e2e/tests/MilitaryInformation.e2e.ts @@ -49,7 +49,7 @@ export async function verifyMilitaryInfo(militaryBranch: string) { }) } -describe('MilitaryInformation', () => { +describe('Military Info Screen', () => { verifyMilitaryInfo('United States Coast Guard') verifyMilitaryInfo('United States Army') verifyMilitaryInfo('United States Air Force') diff --git a/VAMobile/e2e/tests/Onboarding.e2e.ts b/VAMobile/e2e/tests/Onboarding.e2e.ts index 53cd227f158..e0bada940ec 100644 --- a/VAMobile/e2e/tests/Onboarding.e2e.ts +++ b/VAMobile/e2e/tests/Onboarding.e2e.ts @@ -12,7 +12,7 @@ beforeAll(async () => { await loginToDemoMode(false) }) -describe('Onboarding', () => { +describe('Onboarding Screen', () => { it('should show the welcome onboarding content', async () => { const onboardingIconCheck = await element(by.id(OnboardingE2eIdConstants.VA_ICON_ID)).takeScreenshot( 'VAIconOnboarding', diff --git a/VAMobile/e2e/tests/Payments.e2e.ts b/VAMobile/e2e/tests/Payments.e2e.ts index eef68ca3acd..8d36aba215a 100644 --- a/VAMobile/e2e/tests/Payments.e2e.ts +++ b/VAMobile/e2e/tests/Payments.e2e.ts @@ -24,7 +24,7 @@ beforeAll(async () => { await openVAPaymentHistory() }) -describe('Payments', () => { +describe('Payments Screen', () => { it('should match the Payments history page design', async () => { await expect(element(by.id(PaymentsE2eIDConstants.MISSING_PAYMENTS_LINK_ID))).toExist() await expect(element(by.id(PaymentsE2eIDConstants.PAYMENTS_YEAR_PICKER_ID))).toExist() diff --git a/VAMobile/e2e/tests/PersonalInformationScreen.e2e.ts b/VAMobile/e2e/tests/PersonalInformationScreen.e2e.ts index 75d553a4512..7e527f70531 100644 --- a/VAMobile/e2e/tests/PersonalInformationScreen.e2e.ts +++ b/VAMobile/e2e/tests/PersonalInformationScreen.e2e.ts @@ -97,7 +97,7 @@ beforeAll(async () => { await openPersonalInformation() }) -describe('PersonalInformationScreen', () => { +describe('Personal Info Screen', () => { it('should match design', async () => { await expect(element(by.text('Date of birth'))).toExist() await expect(element(by.text('January 01, 1950'))).toExist() diff --git a/VAMobile/e2e/tests/Prescriptions.e2e.ts b/VAMobile/e2e/tests/Prescriptions.e2e.ts index fab2ee2b64b..c490c1f424d 100644 --- a/VAMobile/e2e/tests/Prescriptions.e2e.ts +++ b/VAMobile/e2e/tests/Prescriptions.e2e.ts @@ -148,7 +148,7 @@ export async function validateFilter(name: string, quantity: number, helperText? }) } -describe('Prescriptions', () => { +describe('Prescriptions Screen', () => { it('should match the prescription page design', async () => { tempPath = await element(by.id(PrescriptionsE2eIdConstants.FILTER_PRESCRIPTIONS_TEST_ID)).takeScreenshot( 'filterSortWrapperBox', diff --git a/VAMobile/e2e/tests/ProfileScreen.e2e.ts b/VAMobile/e2e/tests/ProfileScreen.e2e.ts index 60b3ad82a0a..84914d553cd 100644 --- a/VAMobile/e2e/tests/ProfileScreen.e2e.ts +++ b/VAMobile/e2e/tests/ProfileScreen.e2e.ts @@ -17,7 +17,7 @@ beforeAll(async () => { await openProfile() }) -describe('ProfileScreen', () => { +describe('Profile Screen', () => { it('should show profile list content', async () => { await waitFor(element(by.text(ProfileE2eIdConstants.PROFILE_TEXT))) .toExist() diff --git a/VAMobile/e2e/tests/PushNotifications.e2e.ts b/VAMobile/e2e/tests/PushNotifications.e2e.ts index 273c3144226..ec3984364f6 100644 --- a/VAMobile/e2e/tests/PushNotifications.e2e.ts +++ b/VAMobile/e2e/tests/PushNotifications.e2e.ts @@ -19,7 +19,7 @@ const mockNotification = { }, } -describe(':ios: PushNotifications', () => { +describe(':ios: Push Notifications', () => { it('dead state: should navigate to appropriate screen when launching', async () => { await device.launchApp({ delete: true, diff --git a/VAMobile/e2e/tests/SettingsScreen.e2e.ts b/VAMobile/e2e/tests/SettingsScreen.e2e.ts index 7d14e6aa29e..bfd8fef0703 100644 --- a/VAMobile/e2e/tests/SettingsScreen.e2e.ts +++ b/VAMobile/e2e/tests/SettingsScreen.e2e.ts @@ -33,7 +33,7 @@ beforeAll(async () => { await openSettings() }) -describe('SettingsScreen', () => { +describe('Settings Screen', () => { it('should show settings list content', async () => { await waitFor(element(by.text(SettingsE2eIdConstants.SETTINGS_SCREEN_TEXT))) .toExist() diff --git a/VAMobile/e2e/tests/SignIn.e2e.ts b/VAMobile/e2e/tests/SignIn.e2e.ts index 1a25d54a419..30743d6eaee 100644 --- a/VAMobile/e2e/tests/SignIn.e2e.ts +++ b/VAMobile/e2e/tests/SignIn.e2e.ts @@ -15,7 +15,7 @@ export const SignE2eIdConstants = { CONTINUE_SIGN_IN_BTN_ID: 'Continue to sign in', } -describe('SignIn', () => { +describe('Sign In', () => { it('should show sign in page content', async () => { try { await waitFor(element(by.id(CommonE2eIdConstants.VA_LOGO_ICON_ID))) diff --git a/VAMobile/e2e/tests/VALetters.e2e.ts b/VAMobile/e2e/tests/VALetters.e2e.ts index b07a244f498..75b5f59b35d 100644 --- a/VAMobile/e2e/tests/VALetters.e2e.ts +++ b/VAMobile/e2e/tests/VALetters.e2e.ts @@ -72,7 +72,7 @@ beforeAll(async () => { await openLetters() }) -describe('VALetters', () => { +describe('VA Letters', () => { it('should match design', async () => { await expect(element(by.text(LettersConstants.MAILING_ADDRESS))).toExist() }) diff --git a/VAMobile/e2e/tests/VaccineRecords.e2e.ts b/VAMobile/e2e/tests/VaccineRecords.e2e.ts index 633c66fa3c6..e967e48f331 100644 --- a/VAMobile/e2e/tests/VaccineRecords.e2e.ts +++ b/VAMobile/e2e/tests/VaccineRecords.e2e.ts @@ -17,7 +17,7 @@ beforeAll(async () => { await openVaccineRecords() }) -describe('VaccineRecords', () => { +describe('Vaccine Records Screen', () => { it('should show vaccine records list content', async () => { await expect(element(by.text('VA vaccines'))).toExist() await expect(element(by.id(VaccinesE2eIdConstants.VACCINE_1_ID))).toExist() diff --git a/VAMobile/e2e/tests/VeteranStatusCard.e2e.ts b/VAMobile/e2e/tests/VeteranStatusCard.e2e.ts index 53a5d6ca3b8..a3ed4bcb3b0 100644 --- a/VAMobile/e2e/tests/VeteranStatusCard.e2e.ts +++ b/VAMobile/e2e/tests/VeteranStatusCard.e2e.ts @@ -117,7 +117,7 @@ export async function verifyMilitaryInfo(militaryBranch) { await expect(element(by.text(militaryBranch))).toExist() }) } -describe('VeteranStatusCard', () => { +describe('Veteran Status Card', () => { it('should match design in the home screen', async () => { await waitFor(element(by.id(VeteranStatusCardConstants.VETERAN_STATUS_ID))) .toBeVisible() diff --git a/VAMobile/e2e/tests/VeteransCrisisLine.e2e.ts b/VAMobile/e2e/tests/VeteransCrisisLine.e2e.ts index 9437d05f55c..56240e7715e 100644 --- a/VAMobile/e2e/tests/VeteransCrisisLine.e2e.ts +++ b/VAMobile/e2e/tests/VeteransCrisisLine.e2e.ts @@ -33,7 +33,7 @@ beforeAll(async () => { await openVeteransCrisisLine() }) -describe('VeteransCrisisLine', () => { +describe('Veterans Crisis Line', () => { it('should match design', async () => { await expect(element(by.text(VCLConstants.HEADING_TEXT))).toExist() await expect(element(by.text(VCLConstants.SUBHEADING_TEXT))).toExist() From dc72086320a94868d50d863e86d7099d41c05f47 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Fri, 1 Nov 2024 06:15:14 -0500 Subject: [PATCH 29/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index cbc556175db..7df3c2a8b20 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -396,16 +396,18 @@ jobs: removeBracket=$(echo $removeBracket | tr -d ']') removeBracket=$(echo $removeBracket | tr -d ',') echo "$removeBracket" - missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'map(select(index($testsTypedIn)))') - if [[ "$missingCases" == "[]" ]]; then - echo "Missing cases: $removeBracket" - missingCasesWithOS="$removeBracket [android]" - echo "$missingCasesWithOS" - matchMissingCases=$(echo $getTest| jq --arg getCase "$missingCasesWithOS" --compact-output 'select(.title | contains($getCase))') - echo "" >> input.json - addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') - echo $addMissingCasesToArray >> input.json - fi + for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g'); do + echo "$z" + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$z" 'map(select(index($testsTypedIn)))') + if [[ "$missingCases" == "[]" ]]; then + echo "Missing cases: $removeBracket" + matchMissingCases=$(echo $getTest| jq --arg getCase "$removeBracket" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') + echo "" >> input.json + addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') + echo $addMissingCasesToArray >> input.json + break + fi + done done getTestCaseNewName=$(jq --compact-output -s 'add' input.json) echo "testCasesFromFileUpdated: $getTestCaseNewName" From bffe101ea9a82c3f6a7a2f71869947dd85edfc49 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Fri, 1 Nov 2024 06:40:46 -0500 Subject: [PATCH 30/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 7df3c2a8b20..3cb3fa5b64f 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -194,7 +194,7 @@ jobs: run: yarn env:staging - name: Bundle Android app - run: yarn e2e:android-build + run: yarn e2e:android-build1 - name: Run e2e tests for Android - Full Test id: run_e2e_tests From 06244247d02efeb5c247373376d93d20ca19005f Mon Sep 17 00:00:00 2001 From: rbontrager Date: Fri, 1 Nov 2024 06:47:49 -0500 Subject: [PATCH 31/74] Update update_testrail_results.yml --- .github/workflows/update_testrail_results.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/update_testrail_results.yml b/.github/workflows/update_testrail_results.yml index a6bf3b822a5..34dc9b23fb3 100644 --- a/.github/workflows/update_testrail_results.yml +++ b/.github/workflows/update_testrail_results.yml @@ -41,6 +41,7 @@ jobs: with: name: ${{inputs.test_names}}-e2e-junit - name: 'Find run ID in testRail' + if: failure() || success() id: run-id-selection run: | resp=$(curl -X GET -H 'Content-Type: application/json' \ @@ -72,6 +73,7 @@ jobs: fi fi - name: 'Find section ID in testRail' + if: failure() || success() id: section-id-selection run: | resp=$(curl -X GET -H 'Content-Type: application/json' \ From c66b459772de02e59359032541d7133a2a5153be Mon Sep 17 00:00:00 2001 From: rbontrager Date: Fri, 1 Nov 2024 06:59:12 -0500 Subject: [PATCH 32/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 3cb3fa5b64f..3f9434430ac 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -400,8 +400,7 @@ jobs: echo "$z" missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$z" 'map(select(index($testsTypedIn)))') if [[ "$missingCases" == "[]" ]]; then - echo "Missing cases: $removeBracket" - matchMissingCases=$(echo $getTest| jq --arg getCase "$removeBracket" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') + matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') echo "" >> input.json addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') echo $addMissingCasesToArray >> input.json From 42f46b0a4028e64e7e5c4175856c1b6efea641d1 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Fri, 1 Nov 2024 07:10:52 -0500 Subject: [PATCH 33/74] Add changes to e2e_ios --- .github/workflows/e2e_android.yml | 7 ++----- .github/workflows/e2e_ios.yml | 31 +++++++++++++++++++++++++++++-- 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 3f9434430ac..6cb6cda2df9 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -194,7 +194,7 @@ jobs: run: yarn env:staging - name: Bundle Android app - run: yarn e2e:android-build1 + run: yarn e2e:android-build - name: Run e2e tests for Android - Full Test id: run_e2e_tests @@ -395,9 +395,7 @@ jobs: removeBracket=$(echo $y | tr -d '[') removeBracket=$(echo $removeBracket | tr -d ']') removeBracket=$(echo $removeBracket | tr -d ',') - echo "$removeBracket" for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g'); do - echo "$z" missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$z" 'map(select(index($testsTypedIn)))') if [[ "$missingCases" == "[]" ]]; then matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') @@ -409,7 +407,6 @@ jobs: done done getTestCaseNewName=$(jq --compact-output -s 'add' input.json) - echo "testCasesFromFileUpdated: $getTestCaseNewName" groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]') getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]') getCasesID=$(curl -X GET -H 'Content-Type: application/json' \ @@ -449,7 +446,7 @@ jobs: else resp5=$(curl -X POST -H 'Content-Type: application/json' \ -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ - -d '{"status_id": 4}' \ + -d '{"status_id": 4, "comment": "Something failed in github actions outside of the e2e tests. Please try again."}' \ "https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"") fi done diff --git a/.github/workflows/e2e_ios.yml b/.github/workflows/e2e_ios.yml index 00822a7b1e3..59a517199b1 100644 --- a/.github/workflows/e2e_ios.yml +++ b/.github/workflows/e2e_ios.yml @@ -352,6 +352,7 @@ jobs: uses: actions/checkout@v3 - name: update-test-names run: | + echo "" >> input.json for ((i=0; ; i+=250)); do echo "i = $i" getTestCaseNewName=$(curl -X GET -H 'Content-Type: application/json' \ @@ -363,12 +364,33 @@ jobs: break fi done + getTest=$(curl -X GET -H 'Content-Type: application/json' \ + -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ + "https://dsvavsp.testrail.io//index.php?/api/v2/get_cases/29§ion_id=9683" | jq .cases[]) + getTestCaseNewName=$(jq --compact-output -s 'add' input.json) + groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]') + getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]') + for y in ${{ inputs.tests_to_run}}; do + removeBracket=$(echo $y | tr -d '[') + removeBracket=$(echo $removeBracket | tr -d ']') + removeBracket=$(echo $removeBracket | tr -d ',') + for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g'); do + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$z" 'map(select(index($testsTypedIn)))') + if [[ "$missingCases" == "[]" ]]; then + matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[ios]"))') + echo "" >> input.json + addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') + echo $addMissingCasesToArray >> input.json + break + fi + done + done getTestCaseNewName=$(jq --compact-output -s 'add' input.json) groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]') getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]') getCasesID=$(curl -X GET -H 'Content-Type: application/json' \ - -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ - "https://dsvavsp.testrail.io//index.php?/api/v2/get_cases/29") + -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ + "https://dsvavsp.testrail.io//index.php?/api/v2/get_cases/29") updateRunWithNewCases=$(curl -X POST -H 'Content-Type: application/json' \ -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ -d '{"suite_id": 92, "include_all": false, "case_ids": '$(echo $getCasesID | jq --argjson testRailNames "$getFirstTestNewName" --compact-output '.cases | map(select(.title == $testRailNames[])) | map(.id)')'}' \ @@ -400,5 +422,10 @@ jobs: -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ -d '{"status_id": 1}' \ "https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"") + else + resp5=$(curl -X POST -H 'Content-Type: application/json' \ + -u "${{secrets.TEST_RAIL_USER}}:${{secrets.TEST_RAIL_KEY}}" \ + -d '{"status_id": 4, "comment": "Something failed in github actions outside of the e2e tests. Please try again."}' \ + "https://dsvavsp.testrail.io//index.php?/api/v2/add_result/"$i"") fi done From 9ad804300ca3bb6e24596c58092144fbbfcda895 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 20 Nov 2024 06:51:42 -0600 Subject: [PATCH 34/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 6202273f998..fb89fe9b8f5 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -90,6 +90,7 @@ jobs: outputs: output1: ${{ steps.matrix_value.outputs.matrix }} output2: ${{ steps.matrix_value.outputs.individual_matrix}} + output3: ${{ steps.matrix_value.outputs.testRail_matrix}} steps: - name: Checkout uses: actions/checkout@v3 @@ -130,6 +131,8 @@ jobs: else resp=${{toJson(needs.find_detox_tests_to_run.outputs.test_matrix)}} echo "matrix=$resp" >> "$GITHUB_OUTPUT" + testRailResponse=${{needs.find_detox_tests_to_run.outputs.test_matrix}} + echo "testRail_matrix=$testRailResponse" >> "$GITHUB_OUTPUT" fi fi fi @@ -193,7 +196,7 @@ jobs: run: yarn env:staging - name: Bundle Android app - run: yarn e2e:android-build + run: yarn e2e:android-build1 - name: Run e2e tests for Android - Full Test id: run_e2e_tests @@ -384,10 +387,12 @@ jobs: getTestCaseNewName=$(jq --compact-output -s 'add' input.json) groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]') getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]') - for y in ${{ inputs.tests_to_run}}; do + for y in ${{ needs.output_detox_tests_to_run.outputs.output1 }}; do + echo "$y" removeBracket=$(echo $y | tr -d '[') removeBracket=$(echo $removeBracket | tr -d ']') removeBracket=$(echo $removeBracket | tr -d ',') + echo "$removeBracket" for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g'); do missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$z" 'map(select(index($testsTypedIn)))') if [[ "$missingCases" == "[]" ]]; then From 55cf4efc8f2d6ad37049a003a42dc565e03cb24b Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 20 Nov 2024 07:18:01 -0600 Subject: [PATCH 35/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index fb89fe9b8f5..0b0b3c06b0c 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -90,7 +90,6 @@ jobs: outputs: output1: ${{ steps.matrix_value.outputs.matrix }} output2: ${{ steps.matrix_value.outputs.individual_matrix}} - output3: ${{ steps.matrix_value.outputs.testRail_matrix}} steps: - name: Checkout uses: actions/checkout@v3 @@ -131,8 +130,6 @@ jobs: else resp=${{toJson(needs.find_detox_tests_to_run.outputs.test_matrix)}} echo "matrix=$resp" >> "$GITHUB_OUTPUT" - testRailResponse=${{needs.find_detox_tests_to_run.outputs.test_matrix}} - echo "testRail_matrix=$testRailResponse" >> "$GITHUB_OUTPUT" fi fi fi @@ -387,13 +384,14 @@ jobs: getTestCaseNewName=$(jq --compact-output -s 'add' input.json) groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]') getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]') - for y in ${{ needs.output_detox_tests_to_run.outputs.output1 }}; do + for y in ${{fromJson(needs.output_detox_tests_to_run.outputs.output1)}}; do echo "$y" removeBracket=$(echo $y | tr -d '[') removeBracket=$(echo $removeBracket | tr -d ']') removeBracket=$(echo $removeBracket | tr -d ',') echo "$removeBracket" for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g'); do + echo "$z" missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$z" 'map(select(index($testsTypedIn)))') if [[ "$missingCases" == "[]" ]]; then matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') From 4c853d3d8858e8bb1f65163de4fa0c8873602d13 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 20 Nov 2024 07:25:51 -0600 Subject: [PATCH 36/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 0b0b3c06b0c..37fe0368e06 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -90,6 +90,7 @@ jobs: outputs: output1: ${{ steps.matrix_value.outputs.matrix }} output2: ${{ steps.matrix_value.outputs.individual_matrix}} + output3: ${{ steps.matrix_value.outputs.testRail_matrix}} steps: - name: Checkout uses: actions/checkout@v3 @@ -102,10 +103,12 @@ jobs: if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]] || [[ "${{ github.event.pull_request.user.login }}" == "dependabot[bot]" ]]; then e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]') echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT" + echo "testRail_matrix=$e2eNames" >> "$GITHUB_OUTPUT" echo "individual_matrix=" >> "$GITHUB_OUTPUT" else if [[ "${{ inputs.tests_to_run}}" != "" ]]; then echo "matrix=${{ toJson(inputs.tests_to_run)}}" >> "$GITHUB_OUTPUT" + echo "testRail_matrix=${{ inputs.tests_to_run}}" >> "$GITHUB_OUTPUT" echo "individual_matrix=true" >> "$GITHUB_OUTPUT" else echo "matrix=" >> "$GITHUB_OUTPUT" @@ -118,13 +121,16 @@ jobs: if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]] || [[ "${{ github.event.pull_request.user.login }}" == "dependabot[bot]" ]]; then e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]') echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT" + echo "testRail_matrix=$e2eNames" >> "$GITHUB_OUTPUT" echo "individual_matrix=" >> "$GITHUB_OUTPUT" else if [[ "${{ inputs.tests_to_run}}" != "" ]]; then echo "matrix=${{ toJson(inputs.tests_to_run)}}" >> "$GITHUB_OUTPUT" + echo "testRail_matrix=${{ inputs.tests_to_run}}" >> "$GITHUB_OUTPUT" echo "individual_matrix=true" >> "$GITHUB_OUTPUT" else echo "matrix=" >> "$GITHUB_OUTPUT" + echo "testRail_matrix=" >> "$GITHUB_OUTPUT" fi fi else @@ -384,7 +390,7 @@ jobs: getTestCaseNewName=$(jq --compact-output -s 'add' input.json) groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]') getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]') - for y in ${{fromJson(needs.output_detox_tests_to_run.outputs.output1)}}; do + for y in ${{needs.output_detox_tests_to_run.outputs.output3}}; do echo "$y" removeBracket=$(echo $y | tr -d '[') removeBracket=$(echo $removeBracket | tr -d ']') From f86ec795a6443a5d9deb5bd33843add560b74558 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 20 Nov 2024 07:44:18 -0600 Subject: [PATCH 37/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 37fe0368e06..6a3082a9a10 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -394,14 +394,19 @@ jobs: echo "$y" removeBracket=$(echo $y | tr -d '[') removeBracket=$(echo $removeBracket | tr -d ']') - removeBracket=$(echo $removeBracket | tr -d ',') - echo "$removeBracket" + if [[ "${{ inputs.tests_to_run}}" != "" ]]; then + removeBracket=$(echo $removeBracket | tr ',' ' ') + else + removeBracket=$(echo $removeBracket | tr -d ',') + fi for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g'); do - echo "$z" missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$z" 'map(select(index($testsTypedIn)))') + echo "$z" + echo "$missingCases" if [[ "$missingCases" == "[]" ]]; then matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') echo "" >> input.json + echo "$matchMissingCases" addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') echo $addMissingCasesToArray >> input.json break From 3eb747017ac8b3060e3f5eb695428338beb4102b Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 20 Nov 2024 08:40:54 -0600 Subject: [PATCH 38/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 6a3082a9a10..d294b1bf722 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -398,13 +398,21 @@ jobs: removeBracket=$(echo $removeBracket | tr ',' ' ') else removeBracket=$(echo $removeBracket | tr -d ',') - fi + fi for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g'); do - missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$z" 'map(select(index($testsTypedIn)))') + if [ "$removeBracket" == "AppealsExpanded" || "$removeBracket" == "AppointmentsExpanded"]; then + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'map(select(index($testsTypedIn)))') + else + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$z" 'map(select(index($testsTypedIn)))') + fi echo "$z" echo "$missingCases" if [[ "$missingCases" == "[]" ]]; then - matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') + if [ "$removeBracket" == "Appeals" || "$removeBracket" == "Appointments"]; then + matchMissingCases=$(echo $getTest| jq --arg getCase "$removeBracket" --compact-output 'select(.title == "'"$getTestName"' [android]"))') + else + matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') + fi echo "" >> input.json echo "$matchMissingCases" addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') From cda17425d1a3bcf6eb51f1763c8159364ae11a50 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 20 Nov 2024 08:53:04 -0600 Subject: [PATCH 39/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index d294b1bf722..0ea004ce60f 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -398,9 +398,9 @@ jobs: removeBracket=$(echo $removeBracket | tr ',' ' ') else removeBracket=$(echo $removeBracket | tr -d ',') - fi + fi for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g'); do - if [ "$removeBracket" == "AppealsExpanded" || "$removeBracket" == "AppointmentsExpanded"]; then + if [[ "$removeBracket" == "AppealsExpanded" ]] || [[ "$removeBracket" == "AppointmentsExpanded" ]]; then missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'map(select(index($testsTypedIn)))') else missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$z" 'map(select(index($testsTypedIn)))') @@ -408,7 +408,7 @@ jobs: echo "$z" echo "$missingCases" if [[ "$missingCases" == "[]" ]]; then - if [ "$removeBracket" == "Appeals" || "$removeBracket" == "Appointments"]; then + if [[ "$removeBracket" == "Appeals" ]] || [[ "$removeBracket" == "Appointments" ]]; then matchMissingCases=$(echo $getTest| jq --arg getCase "$removeBracket" --compact-output 'select(.title == "'"$getTestName"' [android]"))') else matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') From f5d992b3a10f6a956f1d480ddf93e644c6934c35 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 20 Nov 2024 09:01:11 -0600 Subject: [PATCH 40/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 0ea004ce60f..5c4c47434f6 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -408,8 +408,10 @@ jobs: echo "$z" echo "$missingCases" if [[ "$missingCases" == "[]" ]]; then + echo "$removeBracket" if [[ "$removeBracket" == "Appeals" ]] || [[ "$removeBracket" == "Appointments" ]]; then - matchMissingCases=$(echo $getTest| jq --arg getCase "$removeBracket" --compact-output 'select(.title == "'"$getTestName"' [android]"))') + echo "$test" + matchMissingCases=$(echo $getTest| jq --arg getCase "$removeBracket" --compact-output 'select(.title == "'"$getCase"' [android]"))') else matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') fi From 26d8a81bcc64c01bebac56a834c8d4c4c43ceee9 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 20 Nov 2024 09:02:23 -0600 Subject: [PATCH 41/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 5c4c47434f6..6de0f60b853 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -409,7 +409,7 @@ jobs: echo "$missingCases" if [[ "$missingCases" == "[]" ]]; then echo "$removeBracket" - if [[ "$removeBracket" == "Appeals" ]] || [[ "$removeBracket" == "Appointments" ]]; then + if [[ "$removeBracket" == "Appeals" ]] || [[ "$removeBracket" == "Appointments" ]] || [[ "$removeBracket" == "AppointmentsExpanded" ]] || [[ "$removeBracket" == "AppealsExpanded" ]]; then echo "$test" matchMissingCases=$(echo $getTest| jq --arg getCase "$removeBracket" --compact-output 'select(.title == "'"$getCase"' [android]"))') else From bca1fe39a3f522666d103fd947a7930b3d9361ac Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 20 Nov 2024 09:25:44 -0600 Subject: [PATCH 42/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 6de0f60b853..be5666512b3 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -409,7 +409,7 @@ jobs: echo "$missingCases" if [[ "$missingCases" == "[]" ]]; then echo "$removeBracket" - if [[ "$removeBracket" == "Appeals" ]] || [[ "$removeBracket" == "Appointments" ]] || [[ "$removeBracket" == "AppointmentsExpanded" ]] || [[ "$removeBracket" == "AppealsExpanded" ]]; then + if [[ ("$removeBracket" == "Appeals" || "$removeBracket" == "Appointments" || "$removeBracket" == "AppointmentsExpanded" || "$removeBracket" == "AppealsExpanded") ]]; then echo "$test" matchMissingCases=$(echo $getTest| jq --arg getCase "$removeBracket" --compact-output 'select(.title == "'"$getCase"' [android]"))') else From add2415bfba91171af597cb007a6457add9fccf1 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 20 Nov 2024 09:35:43 -0600 Subject: [PATCH 43/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index be5666512b3..2ce31c580ef 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -400,7 +400,7 @@ jobs: removeBracket=$(echo $removeBracket | tr -d ',') fi for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g'); do - if [[ "$removeBracket" == "AppealsExpanded" ]] || [[ "$removeBracket" == "AppointmentsExpanded" ]]; then + if [[ "$removeBracket" == "AppealsExpanded" || "$removeBracket" == "AppointmentsExpanded" ]]; then missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'map(select(index($testsTypedIn)))') else missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$z" 'map(select(index($testsTypedIn)))') @@ -410,8 +410,7 @@ jobs: if [[ "$missingCases" == "[]" ]]; then echo "$removeBracket" if [[ ("$removeBracket" == "Appeals" || "$removeBracket" == "Appointments" || "$removeBracket" == "AppointmentsExpanded" || "$removeBracket" == "AppealsExpanded") ]]; then - echo "$test" - matchMissingCases=$(echo $getTest| jq --arg getCase "$removeBracket" --compact-output 'select(.title == "'"$getCase"' [android]"))') + matchMissingCases=$(echo $getTest| jq --arg getCase "$removeBracket" --compact-output 'select(.title == "$getCase [android]"))') else matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') fi From d7d40bdd3b30a295a78e2552d5ba5c23caa6470a Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 20 Nov 2024 09:45:49 -0600 Subject: [PATCH 44/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 2ce31c580ef..c2381ce8448 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -410,7 +410,7 @@ jobs: if [[ "$missingCases" == "[]" ]]; then echo "$removeBracket" if [[ ("$removeBracket" == "Appeals" || "$removeBracket" == "Appointments" || "$removeBracket" == "AppointmentsExpanded" || "$removeBracket" == "AppealsExpanded") ]]; then - matchMissingCases=$(echo $getTest| jq --arg getCase "$removeBracket" --compact-output 'select(.title == "$getCase [android]"))') + matchMissingCases=$(echo $getTest| jq --arg getCase "$removeBracket" --compact-output 'select(.title == "$getCase [android]")') else matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') fi From 199f25d50faf55b135148cfcc72f53cd100ae9e3 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 20 Nov 2024 09:54:12 -0600 Subject: [PATCH 45/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index c2381ce8448..001f1d500d9 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -410,7 +410,8 @@ jobs: if [[ "$missingCases" == "[]" ]]; then echo "$removeBracket" if [[ ("$removeBracket" == "Appeals" || "$removeBracket" == "Appointments" || "$removeBracket" == "AppointmentsExpanded" || "$removeBracket" == "AppealsExpanded") ]]; then - matchMissingCases=$(echo $getTest| jq --arg getCase "$removeBracket" --compact-output 'select(.title == "$getCase [android]")') + title="$removeBracket [android]" + matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') else matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') fi From 46976a42e93482fbd771877bc93c1342e14cf252 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 20 Nov 2024 10:08:34 -0600 Subject: [PATCH 46/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 001f1d500d9..5352cce9442 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -394,11 +394,13 @@ jobs: echo "$y" removeBracket=$(echo $y | tr -d '[') removeBracket=$(echo $removeBracket | tr -d ']') - if [[ "${{ inputs.tests_to_run}}" != "" ]]; then + if [[ "${{ inputs.tests_to_run}}" == "" ]]; then removeBracket=$(echo $removeBracket | tr ',' ' ') + removeBracket=$(echo $removeBracket | tr -d '.e2e.ts') else removeBracket=$(echo $removeBracket | tr -d ',') fi + echo "$removeBracket" for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g'); do if [[ "$removeBracket" == "AppealsExpanded" || "$removeBracket" == "AppointmentsExpanded" ]]; then missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'map(select(index($testsTypedIn)))') @@ -408,7 +410,6 @@ jobs: echo "$z" echo "$missingCases" if [[ "$missingCases" == "[]" ]]; then - echo "$removeBracket" if [[ ("$removeBracket" == "Appeals" || "$removeBracket" == "Appointments" || "$removeBracket" == "AppointmentsExpanded" || "$removeBracket" == "AppealsExpanded") ]]; then title="$removeBracket [android]" matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') From 164269638032ac306a81f0152000d47f04c0bff8 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 20 Nov 2024 10:20:20 -0600 Subject: [PATCH 47/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 5352cce9442..64cb7216bca 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -396,12 +396,11 @@ jobs: removeBracket=$(echo $removeBracket | tr -d ']') if [[ "${{ inputs.tests_to_run}}" == "" ]]; then removeBracket=$(echo $removeBracket | tr ',' ' ') - removeBracket=$(echo $removeBracket | tr -d '.e2e.ts') else removeBracket=$(echo $removeBracket | tr -d ',') fi echo "$removeBracket" - for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g'); do + for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g;s/\..*//'); do if [[ "$removeBracket" == "AppealsExpanded" || "$removeBracket" == "AppointmentsExpanded" ]]; then missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'map(select(index($testsTypedIn)))') else From 41321e33da9213e437381e1b4921ca774e088bd2 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 20 Nov 2024 10:32:38 -0600 Subject: [PATCH 48/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 64cb7216bca..726f4069337 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -400,7 +400,9 @@ jobs: removeBracket=$(echo $removeBracket | tr -d ',') fi echo "$removeBracket" - for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g;s/\..*//'); do + for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g'); do + z=$(echo $z | sed 's/\..*//') + echo "$z" if [[ "$removeBracket" == "AppealsExpanded" || "$removeBracket" == "AppointmentsExpanded" ]]; then missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'map(select(index($testsTypedIn)))') else From 3ea009ecf351c31970e8eff92c7ed00a43049223 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 20 Nov 2024 12:31:43 -0600 Subject: [PATCH 49/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 726f4069337..5512b068d54 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -390,19 +390,20 @@ jobs: getTestCaseNewName=$(jq --compact-output -s 'add' input.json) groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]') getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]') - for y in ${{needs.output_detox_tests_to_run.outputs.output3}}; do + if [[ "${{inputs.tests_to_run}}" == "" ]]; then + e2eArray=${{needs.output_detox_tests_to_run.outputs.output3}} + e2eArray=$(echo $e2eArray | tr ',' ' ') + e2eArray=$(echo $e2eArray | 's/\S*\(.e2e.ts\)\S*//g') + else + e2eArray=${{inputs.tests_to_run}} + fi + for y in $e2eArray; do echo "$y" removeBracket=$(echo $y | tr -d '[') removeBracket=$(echo $removeBracket | tr -d ']') - if [[ "${{ inputs.tests_to_run}}" == "" ]]; then - removeBracket=$(echo $removeBracket | tr ',' ' ') - else - removeBracket=$(echo $removeBracket | tr -d ',') - fi + removeBracket=$(echo $removeBracket | tr -d ',') echo "$removeBracket" for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g'); do - z=$(echo $z | sed 's/\..*//') - echo "$z" if [[ "$removeBracket" == "AppealsExpanded" || "$removeBracket" == "AppointmentsExpanded" ]]; then missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'map(select(index($testsTypedIn)))') else From c5a52d92a6f8eb2cbe537bd885792db7a2cfc054 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 20 Nov 2024 12:55:03 -0600 Subject: [PATCH 50/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 5512b068d54..9c0325708e6 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -103,7 +103,9 @@ jobs: if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]] || [[ "${{ github.event.pull_request.user.login }}" == "dependabot[bot]" ]]; then e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]') echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT" - echo "testRail_matrix=$e2eNames" >> "$GITHUB_OUTPUT" + testRail=$(echo $e2eNames | tr ',' ' ') + testRail=$(echo $testRail | sed 's/\S*\(.e2e.ts\)\S*//g') + echo "testRail_matrix=$testRail" >> "$GITHUB_OUTPUT" echo "individual_matrix=" >> "$GITHUB_OUTPUT" else if [[ "${{ inputs.tests_to_run}}" != "" ]]; then @@ -121,7 +123,9 @@ jobs: if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]] || [[ "${{ github.event.pull_request.user.login }}" == "dependabot[bot]" ]]; then e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]') echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT" - echo "testRail_matrix=$e2eNames" >> "$GITHUB_OUTPUT" + testRail=$(echo $e2eNames | tr ',' ' ') + testRail=$(echo $testRail | sed 's/\S*\(.e2e.ts\)\S*//g') + echo "testRail_matrix=$testRail" >> "$GITHUB_OUTPUT" echo "individual_matrix=" >> "$GITHUB_OUTPUT" else if [[ "${{ inputs.tests_to_run}}" != "" ]]; then @@ -390,18 +394,12 @@ jobs: getTestCaseNewName=$(jq --compact-output -s 'add' input.json) groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]') getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]') - if [[ "${{inputs.tests_to_run}}" == "" ]]; then - e2eArray=${{needs.output_detox_tests_to_run.outputs.output3}} - e2eArray=$(echo $e2eArray | tr ',' ' ') - e2eArray=$(echo $e2eArray | 's/\S*\(.e2e.ts\)\S*//g') - else - e2eArray=${{inputs.tests_to_run}} - fi - for y in $e2eArray; do + + for y in ${{needs.output_detox_tests_to_run.outputs.output3}}; do echo "$y" removeBracket=$(echo $y | tr -d '[') removeBracket=$(echo $removeBracket | tr -d ']') - removeBracket=$(echo $removeBracket | tr -d ',') + removeBracket=$(echo $removeBracket | tr -d ',') echo "$removeBracket" for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g'); do if [[ "$removeBracket" == "AppealsExpanded" || "$removeBracket" == "AppointmentsExpanded" ]]; then From e36ff21f477c6cad7e9548b4567369c956c9f9ee Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 20 Nov 2024 13:05:27 -0600 Subject: [PATCH 51/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 9c0325708e6..ac3c5ba2b9b 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -396,11 +396,9 @@ jobs: getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]') for y in ${{needs.output_detox_tests_to_run.outputs.output3}}; do - echo "$y" removeBracket=$(echo $y | tr -d '[') removeBracket=$(echo $removeBracket | tr -d ']') removeBracket=$(echo $removeBracket | tr -d ',') - echo "$removeBracket" for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g'); do if [[ "$removeBracket" == "AppealsExpanded" || "$removeBracket" == "AppointmentsExpanded" ]]; then missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'map(select(index($testsTypedIn)))') @@ -410,17 +408,21 @@ jobs: echo "$z" echo "$missingCases" if [[ "$missingCases" == "[]" ]]; then - if [[ ("$removeBracket" == "Appeals" || "$removeBracket" == "Appointments" || "$removeBracket" == "AppointmentsExpanded" || "$removeBracket" == "AppealsExpanded") ]]; then + if [[ ("$removeBracket" == "Appeals" || "$removeBracket" == "AppointmentsExpanded" || "$removeBracket" == "AppealsExpanded") ]]; then title="$removeBracket [android]" matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') + else if [[ ("$removeBracket" == "Appointments") ]]; then + title="$removeBracket Screen [android]" + matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') else matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') fi echo "" >> input.json echo "$matchMissingCases" - addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') - echo $addMissingCasesToArray >> input.json - break + if [[ "$matchMissingCases" != "" ]]; then + addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') + echo $addMissingCasesToArray >> input.json + fi fi done done From d969a8efd0035ec337fcd0eee71de16566066147 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 20 Nov 2024 13:13:38 -0600 Subject: [PATCH 52/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index ac3c5ba2b9b..83bd33598b4 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -394,7 +394,6 @@ jobs: getTestCaseNewName=$(jq --compact-output -s 'add' input.json) groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]') getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]') - for y in ${{needs.output_detox_tests_to_run.outputs.output3}}; do removeBracket=$(echo $y | tr -d '[') removeBracket=$(echo $removeBracket | tr -d ']') @@ -411,7 +410,7 @@ jobs: if [[ ("$removeBracket" == "Appeals" || "$removeBracket" == "AppointmentsExpanded" || "$removeBracket" == "AppealsExpanded") ]]; then title="$removeBracket [android]" matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') - else if [[ ("$removeBracket" == "Appointments") ]]; then + elif [[ ("$removeBracket" == "Appointments") ]]; then title="$removeBracket Screen [android]" matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') else From e4a21b80601a8d7d8938fd7befe271d300273a8d Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 20 Nov 2024 13:30:00 -0600 Subject: [PATCH 53/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 44 +++++++++++++++---------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 83bd33598b4..442421a092f 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -398,32 +398,30 @@ jobs: removeBracket=$(echo $y | tr -d '[') removeBracket=$(echo $removeBracket | tr -d ']') removeBracket=$(echo $removeBracket | tr -d ',') - for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g'); do - if [[ "$removeBracket" == "AppealsExpanded" || "$removeBracket" == "AppointmentsExpanded" ]]; then - missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'map(select(index($testsTypedIn)))') + remove2ndWord=$(echo $removeBracket | sed 's/[A-Z].*//g') + if [[ "$removeBracket" == "AppealsExpanded" || "$removeBracket" == "AppointmentsExpanded" ]]; then + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'map(select(index($testsTypedIn)))') + else + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$remove2ndWord" 'map(select(index($testsTypedIn)))') + fi + echo "$missingCases" + if [[ "$missingCases" == "[]" ]]; then + if [[ ("$removeBracket" == "Appeals" || "$removeBracket" == "AppointmentsExpanded" || "$removeBracket" == "AppealsExpanded") ]]; then + title="$removeBracket [android]" + matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') + elif [[ ("$removeBracket" == "Appointments") ]]; then + title="$removeBracket Screen [android]" + matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') else - missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$z" 'map(select(index($testsTypedIn)))') + matchMissingCases=$(echo $getTest| jq --arg getCase "$remove2ndWord" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') fi - echo "$z" - echo "$missingCases" - if [[ "$missingCases" == "[]" ]]; then - if [[ ("$removeBracket" == "Appeals" || "$removeBracket" == "AppointmentsExpanded" || "$removeBracket" == "AppealsExpanded") ]]; then - title="$removeBracket [android]" - matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') - elif [[ ("$removeBracket" == "Appointments") ]]; then - title="$removeBracket Screen [android]" - matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') - else - matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') - fi - echo "" >> input.json - echo "$matchMissingCases" - if [[ "$matchMissingCases" != "" ]]; then - addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') - echo $addMissingCasesToArray >> input.json - fi + echo "" >> input.json + echo "$matchMissingCases" + if [[ "$matchMissingCases" != "" ]]; then + addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') + echo $addMissingCasesToArray >> input.json fi - done + fi done getTestCaseNewName=$(jq --compact-output -s 'add' input.json) groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]') From 9823502040ed980e47513356acb8f5186f746634 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 20 Nov 2024 13:53:09 -0600 Subject: [PATCH 54/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 442421a092f..e90ec24f42a 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -398,7 +398,9 @@ jobs: removeBracket=$(echo $y | tr -d '[') removeBracket=$(echo $removeBracket | tr -d ']') removeBracket=$(echo $removeBracket | tr -d ',') - remove2ndWord=$(echo $removeBracket | sed 's/[A-Z].*//g') + addSpace=$(echo $removeBracket | sed 's/\([^[:blank:]]\)\([[:upper:]]\)/\1 \2/g') + remove2ndWord=$(echo $addSpace | sed 's/\s.*$//') + echo "$remove2ndWord" if [[ "$removeBracket" == "AppealsExpanded" || "$removeBracket" == "AppointmentsExpanded" ]]; then missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'map(select(index($testsTypedIn)))') else From 18e1e858f622c17c067eebe0ea723847d70be855 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Wed, 20 Nov 2024 14:02:17 -0600 Subject: [PATCH 55/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index e90ec24f42a..1b0ef9b2d2f 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -403,6 +403,8 @@ jobs: echo "$remove2ndWord" if [[ "$removeBracket" == "AppealsExpanded" || "$removeBracket" == "AppointmentsExpanded" ]]; then missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'map(select(index($testsTypedIn)))') + elif [[ ("$removeBracket" == "VALetters") ]]; then + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "VA Letters" 'map(select(index($testsTypedIn)))') else missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$remove2ndWord" 'map(select(index($testsTypedIn)))') fi @@ -414,6 +416,9 @@ jobs: elif [[ ("$removeBracket" == "Appointments") ]]; then title="$removeBracket Screen [android]" matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') + elif [[ ("$removeBracket" == "VALetters") ]]; then + title="VA Letters [android]" + matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') else matchMissingCases=$(echo $getTest| jq --arg getCase "$remove2ndWord" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') fi From 0ebc6c62e9ec50d06022ed9d02e9c5371ace5d06 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Thu, 21 Nov 2024 06:56:48 -0600 Subject: [PATCH 56/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 63 ++++++++++++++++++++++--------- 1 file changed, 46 insertions(+), 17 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 1b0ef9b2d2f..464817f1963 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -399,35 +399,64 @@ jobs: removeBracket=$(echo $removeBracket | tr -d ']') removeBracket=$(echo $removeBracket | tr -d ',') addSpace=$(echo $removeBracket | sed 's/\([^[:blank:]]\)\([[:upper:]]\)/\1 \2/g') - remove2ndWord=$(echo $addSpace | sed 's/\s.*$//') - echo "$remove2ndWord" - if [[ "$removeBracket" == "AppealsExpanded" || "$removeBracket" == "AppointmentsExpanded" ]]; then - missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'map(select(index($testsTypedIn)))') - elif [[ ("$removeBracket" == "VALetters") ]]; then - missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "VA Letters" 'map(select(index($testsTypedIn)))') + keep1stWord=$(echo $addSpace | sed 's/\s.*$//') + echo "$keep1stWord" + + if [[ "$removeBracket" == "Appeals" || "$removeBracket" == "Appointments"]]; then + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" '.[] == $testsTypedIn') + elif [[ "$removeBracket" == "VALetters" ]]; then + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "VA Letters" 'map(contains($testsTypedIn)) | .[]') else - missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$remove2ndWord" 'map(select(index($testsTypedIn)))') + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'map(contains($testsTypedIn)) | .[]') fi - echo "$missingCases" - if [[ "$missingCases" == "[]" ]]; then - if [[ ("$removeBracket" == "Appeals" || "$removeBracket" == "AppointmentsExpanded" || "$removeBracket" == "AppealsExpanded") ]]; then - title="$removeBracket [android]" - matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') - elif [[ ("$removeBracket" == "Appointments") ]]; then + + if [[ "$missingCases" == "false" ]]; then + if [[ "$removeBracket" == "Appointments" ]]; then title="$removeBracket Screen [android]" matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') - elif [[ ("$removeBracket" == "VALetters") ]]; then - title="VA Letters [android]" - matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') + elif [[ "$removeBracket" == "VALetters" ]]; then + matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "VA Letters [android]")') else - matchMissingCases=$(echo $getTest| jq --arg getCase "$remove2ndWord" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') + title="$removeBracket [android]" + matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') fi echo "" >> input.json echo "$matchMissingCases" if [[ "$matchMissingCases" != "" ]]; then addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') echo $addMissingCasesToArray >> input.json + continue + fi + else + continue + fi + + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$addSpace" 'map(contains($testsTypedIn)) | .[]') + if [[ "$missingCases" == "false" ]]; then + title="$addSpace [android]" + matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') + echo "$matchMissingCases" + if [[ "$matchMissingCases" != "" ]]; then + addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') + echo $addMissingCasesToArray >> input.json + continue + fi + else + continue + fi + + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$keep1stWord" 'map(contains($testsTypedIn)) | .[]') + if [[ "$missingCases" == "false" ]]; then + title="$keep1stWord [android]" + matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') + echo "$matchMissingCases" + if [[ "$matchMissingCases" != "" ]]; then + addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') + echo $addMissingCasesToArray >> input.json + continue fi + else + continue fi done getTestCaseNewName=$(jq --compact-output -s 'add' input.json) From c478d45f945df8888e402e3db2d0c42756c43c72 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Thu, 21 Nov 2024 07:06:40 -0600 Subject: [PATCH 57/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 464817f1963..b60f7b6c1d8 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -402,7 +402,7 @@ jobs: keep1stWord=$(echo $addSpace | sed 's/\s.*$//') echo "$keep1stWord" - if [[ "$removeBracket" == "Appeals" || "$removeBracket" == "Appointments"]]; then + if [[ "$removeBracket" == "Appeals" || "$removeBracket" == "Appointments" ]]; then missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" '.[] == $testsTypedIn') elif [[ "$removeBracket" == "VALetters" ]]; then missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "VA Letters" 'map(contains($testsTypedIn)) | .[]') From 1ff125240d26b6c9ac4788b99da16b0b99efc933 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Thu, 21 Nov 2024 07:20:22 -0600 Subject: [PATCH 58/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index b60f7b6c1d8..b27359e2f4d 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -400,7 +400,6 @@ jobs: removeBracket=$(echo $removeBracket | tr -d ',') addSpace=$(echo $removeBracket | sed 's/\([^[:blank:]]\)\([[:upper:]]\)/\1 \2/g') keep1stWord=$(echo $addSpace | sed 's/\s.*$//') - echo "$keep1stWord" if [[ "$removeBracket" == "Appeals" || "$removeBracket" == "Appointments" ]]; then missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" '.[] == $testsTypedIn') @@ -409,8 +408,9 @@ jobs: else missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'map(contains($testsTypedIn)) | .[]') fi + echo "$missingCases" - if [[ "$missingCases" == "false" ]]; then + if [[ "$missingCases" == "false" || "$missingCases" == "" ]]; then if [[ "$removeBracket" == "Appointments" ]]; then title="$removeBracket Screen [android]" matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') @@ -432,7 +432,8 @@ jobs: fi missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$addSpace" 'map(contains($testsTypedIn)) | .[]') - if [[ "$missingCases" == "false" ]]; then + echo "$missingCases" + if [[ "$missingCases" == "false" || "$missingCases" == "" ]]; then title="$addSpace [android]" matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') echo "$matchMissingCases" @@ -446,7 +447,8 @@ jobs: fi missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$keep1stWord" 'map(contains($testsTypedIn)) | .[]') - if [[ "$missingCases" == "false" ]]; then + echo "$missingCases" + if [[ "$missingCases" == "false" || "$missingCases" == "" ]]; then title="$keep1stWord [android]" matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') echo "$matchMissingCases" From 75f6487edea657d9493d1bc8b01f284940633956 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Thu, 21 Nov 2024 07:28:24 -0600 Subject: [PATCH 59/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index b27359e2f4d..24ee704dd0e 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -449,8 +449,7 @@ jobs: missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$keep1stWord" 'map(contains($testsTypedIn)) | .[]') echo "$missingCases" if [[ "$missingCases" == "false" || "$missingCases" == "" ]]; then - title="$keep1stWord [android]" - matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') + matchMissingCases=$(echo $getTest| jq --arg getCase "$keep1stWord" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') echo "$matchMissingCases" if [[ "$matchMissingCases" != "" ]]; then addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') From 4eaac6c55270f29000cbd81cb6cffdc4fe7bc716 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Thu, 21 Nov 2024 07:52:28 -0600 Subject: [PATCH 60/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 24ee704dd0e..bfa70b9a54b 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -408,7 +408,7 @@ jobs: else missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'map(contains($testsTypedIn)) | .[]') fi - echo "$missingCases" + echo "removeBracket $missingCases" if [[ "$missingCases" == "false" || "$missingCases" == "" ]]; then if [[ "$removeBracket" == "Appointments" ]]; then @@ -432,7 +432,7 @@ jobs: fi missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$addSpace" 'map(contains($testsTypedIn)) | .[]') - echo "$missingCases" + echo "addSpace $missingCases" if [[ "$missingCases" == "false" || "$missingCases" == "" ]]; then title="$addSpace [android]" matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') @@ -446,19 +446,20 @@ jobs: continue fi - missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$keep1stWord" 'map(contains($testsTypedIn)) | .[]') - echo "$missingCases" - if [[ "$missingCases" == "false" || "$missingCases" == "" ]]; then - matchMissingCases=$(echo $getTest| jq --arg getCase "$keep1stWord" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') - echo "$matchMissingCases" - if [[ "$matchMissingCases" != "" ]]; then - addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') - echo $addMissingCasesToArray >> input.json - continue + for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g'); do + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$z" 'map(contains($testsTypedIn)) | .[]') + echo "goThroughWords $missingCases" + if [[ "$missingCases" == "false" || "$missingCases" == "" ]]; then + echo "$z" + matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') + echo "$matchMissingCases" + if [[ "$matchMissingCases" != "" ]]; then + addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') + echo $addMissingCasesToArray >> input.json + break + fi fi - else - continue - fi + done done getTestCaseNewName=$(jq --compact-output -s 'add' input.json) groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]') From bf876d1dd5591ad842849139bb5a3cc48c58130e Mon Sep 17 00:00:00 2001 From: rbontrager Date: Thu, 21 Nov 2024 08:01:24 -0600 Subject: [PATCH 61/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index bfa70b9a54b..fda1028b418 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -399,7 +399,6 @@ jobs: removeBracket=$(echo $removeBracket | tr -d ']') removeBracket=$(echo $removeBracket | tr -d ',') addSpace=$(echo $removeBracket | sed 's/\([^[:blank:]]\)\([[:upper:]]\)/\1 \2/g') - keep1stWord=$(echo $addSpace | sed 's/\s.*$//') if [[ "$removeBracket" == "Appeals" || "$removeBracket" == "Appointments" ]]; then missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" '.[] == $testsTypedIn') @@ -421,8 +420,8 @@ jobs: matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') fi echo "" >> input.json - echo "$matchMissingCases" - if [[ "$matchMissingCases" != "" ]]; then + if [[ "$matchMissingCases" != "" && "$matchMissingCases" != "false" ]]; then + echo "$matchMissingCases" addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') echo $addMissingCasesToArray >> input.json continue @@ -436,8 +435,8 @@ jobs: if [[ "$missingCases" == "false" || "$missingCases" == "" ]]; then title="$addSpace [android]" matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') - echo "$matchMissingCases" - if [[ "$matchMissingCases" != "" ]]; then + if [[ "$matchMissingCases" != "" && "$matchMissingCases" != "false" ]]; then + echo "$matchMissingCases" addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') echo $addMissingCasesToArray >> input.json continue @@ -452,8 +451,8 @@ jobs: if [[ "$missingCases" == "false" || "$missingCases" == "" ]]; then echo "$z" matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') - echo "$matchMissingCases" - if [[ "$matchMissingCases" != "" ]]; then + if [[ "$matchMissingCases" != "" && "$matchMissingCases" != "false" ]]; then + echo "$matchMissingCases" addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') echo $addMissingCasesToArray >> input.json break From 7233e3c6c942f2e78e944590465367c795c2ed80 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Thu, 21 Nov 2024 08:18:23 -0600 Subject: [PATCH 62/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index fda1028b418..695ab61c818 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -420,12 +420,14 @@ jobs: matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') fi echo "" >> input.json - if [[ "$matchMissingCases" != "" && "$matchMissingCases" != "false" ]]; then + if [[ "$matchMissingCases" != "false" ]]; then + echo "Test" echo "$matchMissingCases" addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') echo $addMissingCasesToArray >> input.json continue fi + echo "Test1" else continue fi @@ -435,7 +437,7 @@ jobs: if [[ "$missingCases" == "false" || "$missingCases" == "" ]]; then title="$addSpace [android]" matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') - if [[ "$matchMissingCases" != "" && "$matchMissingCases" != "false" ]]; then + if [[ "$matchMissingCases" != "false" ]]; then echo "$matchMissingCases" addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') echo $addMissingCasesToArray >> input.json From 3002b2e330a6fce8485d25ae331db4d47f289ea0 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Thu, 21 Nov 2024 08:33:52 -0600 Subject: [PATCH 63/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 695ab61c818..02549db004c 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -395,6 +395,7 @@ jobs: groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]') getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]') for y in ${{needs.output_detox_tests_to_run.outputs.output3}}; do + echo "$y" removeBracket=$(echo $y | tr -d '[') removeBracket=$(echo $removeBracket | tr -d ']') removeBracket=$(echo $removeBracket | tr -d ',') @@ -407,7 +408,6 @@ jobs: else missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'map(contains($testsTypedIn)) | .[]') fi - echo "removeBracket $missingCases" if [[ "$missingCases" == "false" || "$missingCases" == "" ]]; then if [[ "$removeBracket" == "Appointments" ]]; then @@ -420,25 +420,22 @@ jobs: matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') fi echo "" >> input.json - if [[ "$matchMissingCases" != "false" ]]; then - echo "Test" - echo "$matchMissingCases" + echo "$matchMissingCases" + if [[ "$matchMissingCases" != "" ]]; then addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') echo $addMissingCasesToArray >> input.json continue fi - echo "Test1" else continue fi missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$addSpace" 'map(contains($testsTypedIn)) | .[]') - echo "addSpace $missingCases" if [[ "$missingCases" == "false" || "$missingCases" == "" ]]; then title="$addSpace [android]" matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') - if [[ "$matchMissingCases" != "false" ]]; then - echo "$matchMissingCases" + echo "$matchMissingCases" + if [[ "$matchMissingCases" != "" ]]; then addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') echo $addMissingCasesToArray >> input.json continue @@ -449,11 +446,10 @@ jobs: for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g'); do missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$z" 'map(contains($testsTypedIn)) | .[]') - echo "goThroughWords $missingCases" if [[ "$missingCases" == "false" || "$missingCases" == "" ]]; then echo "$z" matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') - if [[ "$matchMissingCases" != "" && "$matchMissingCases" != "false" ]]; then + if [[ "$matchMissingCases" != "" ]]; then echo "$matchMissingCases" addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') echo $addMissingCasesToArray >> input.json From b37f92690be2e65c84c9b03ea0da2f4c55c6a237 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Thu, 21 Nov 2024 08:53:12 -0600 Subject: [PATCH 64/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 02549db004c..1362408f99a 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -404,20 +404,22 @@ jobs: if [[ "$removeBracket" == "Appeals" || "$removeBracket" == "Appointments" ]]; then missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" '.[] == $testsTypedIn') elif [[ "$removeBracket" == "VALetters" ]]; then - missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "VA Letters" 'map(contains($testsTypedIn)) | .[]') + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "VA Letters" '.[] | select(contains($testsTypedIn))') else - missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'map(contains($testsTypedIn)) | .[]') + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" '.[] | select(contains($testsTypedIn))') fi - if [[ "$missingCases" == "false" || "$missingCases" == "" ]]; then + if [[ "$missingCases" == "" ]]; then if [[ "$removeBracket" == "Appointments" ]]; then title="$removeBracket Screen [android]" matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') elif [[ "$removeBracket" == "VALetters" ]]; then matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "VA Letters [android]")') - else + elif [[ "$removeBracket" == "Appeals" ]]; then title="$removeBracket [android]" matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') + else + matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') fi echo "" >> input.json echo "$matchMissingCases" @@ -430,8 +432,8 @@ jobs: continue fi - missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$addSpace" 'map(contains($testsTypedIn)) | .[]') - if [[ "$missingCases" == "false" || "$missingCases" == "" ]]; then + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$addSpace" '.[] | select(contains($testsTypedIn))') + if [[ "$missingCases" == "" ]]; then title="$addSpace [android]" matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') echo "$matchMissingCases" @@ -445,8 +447,8 @@ jobs: fi for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g'); do - missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$z" 'map(contains($testsTypedIn)) | .[]') - if [[ "$missingCases" == "false" || "$missingCases" == "" ]]; then + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$z" '.[] | select(contains($testsTypedIn))') + if [[ "$missingCases" == "" ]]; then echo "$z" matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') if [[ "$matchMissingCases" != "" ]]; then From 278d30d9ac35ea42fa31849d7b7cbecb75bb9e59 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Thu, 21 Nov 2024 08:59:58 -0600 Subject: [PATCH 65/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 1362408f99a..b1f97543b94 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -419,7 +419,7 @@ jobs: title="$removeBracket [android]" matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') else - matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') + matchMissingCases=$(echo $getTest| jq --arg getCase "$removeBracket" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') fi echo "" >> input.json echo "$matchMissingCases" From ffb9be9a4ffaf41c78398b635373088ff50a38d9 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Thu, 21 Nov 2024 09:31:16 -0600 Subject: [PATCH 66/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index b1f97543b94..75eb77932e2 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -395,6 +395,7 @@ jobs: groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]') getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]') for y in ${{needs.output_detox_tests_to_run.outputs.output3}}; do + missingCases="" echo "$y" removeBracket=$(echo $y | tr -d '[') removeBracket=$(echo $removeBracket | tr -d ']') @@ -403,12 +404,13 @@ jobs: if [[ "$removeBracket" == "Appeals" || "$removeBracket" == "Appointments" ]]; then missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" '.[] == $testsTypedIn') + echo "$missingCases" elif [[ "$removeBracket" == "VALetters" ]]; then missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "VA Letters" '.[] | select(contains($testsTypedIn))') else missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" '.[] | select(contains($testsTypedIn))') fi - + if [[ "$missingCases" == "" ]]; then if [[ "$removeBracket" == "Appointments" ]]; then title="$removeBracket Screen [android]" @@ -457,7 +459,8 @@ jobs: echo $addMissingCasesToArray >> input.json break fi - fi + else + break done done getTestCaseNewName=$(jq --compact-output -s 'add' input.json) From 49e09f46540ea8141ce24297f06fba0e41c2c2ce Mon Sep 17 00:00:00 2001 From: rbontrager Date: Thu, 21 Nov 2024 09:36:27 -0600 Subject: [PATCH 67/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 75eb77932e2..dfeba1c23c4 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -434,6 +434,7 @@ jobs: continue fi + missingCases="" missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$addSpace" '.[] | select(contains($testsTypedIn))') if [[ "$missingCases" == "" ]]; then title="$addSpace [android]" @@ -449,6 +450,7 @@ jobs: fi for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g'); do + missingCases="" missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$z" '.[] | select(contains($testsTypedIn))') if [[ "$missingCases" == "" ]]; then echo "$z" @@ -461,6 +463,7 @@ jobs: fi else break + fi done done getTestCaseNewName=$(jq --compact-output -s 'add' input.json) From f51b1a6e4f2c1429c805616b37372a5bef56804a Mon Sep 17 00:00:00 2001 From: rbontrager Date: Thu, 21 Nov 2024 09:43:59 -0600 Subject: [PATCH 68/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index dfeba1c23c4..b4048e29639 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -403,7 +403,7 @@ jobs: addSpace=$(echo $removeBracket | sed 's/\([^[:blank:]]\)\([[:upper:]]\)/\1 \2/g') if [[ "$removeBracket" == "Appeals" || "$removeBracket" == "Appointments" ]]; then - missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" '.[] == $testsTypedIn') + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'select(.[] == "'"$testsTypedIn"'"')) echo "$missingCases" elif [[ "$removeBracket" == "VALetters" ]]; then missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "VA Letters" '.[] | select(contains($testsTypedIn))') From fae66255abd1f5cd0be232181bb96a7dd5ac0d9d Mon Sep 17 00:00:00 2001 From: rbontrager Date: Thu, 21 Nov 2024 09:53:13 -0600 Subject: [PATCH 69/74] Add logic to e2e_ios --- .github/workflows/e2e_android.yml | 2 +- .github/workflows/e2e_ios.yml | 79 ++++++++++++++++++++++++++++--- 2 files changed, 73 insertions(+), 8 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index b4048e29639..bb45d052263 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -403,7 +403,7 @@ jobs: addSpace=$(echo $removeBracket | sed 's/\([^[:blank:]]\)\([[:upper:]]\)/\1 \2/g') if [[ "$removeBracket" == "Appeals" || "$removeBracket" == "Appointments" ]]; then - missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'select(.[] == "'"$testsTypedIn"'"')) + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'select(.[] == "'"$testsTypedIn"'")') echo "$missingCases" elif [[ "$removeBracket" == "VALetters" ]]; then missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "VA Letters" '.[] | select(contains($testsTypedIn))') diff --git a/.github/workflows/e2e_ios.yml b/.github/workflows/e2e_ios.yml index 4d94049adcf..59ec57d964b 100644 --- a/.github/workflows/e2e_ios.yml +++ b/.github/workflows/e2e_ios.yml @@ -81,6 +81,7 @@ jobs: outputs: output1: ${{ steps.matrix_value.outputs.matrix }} output2: ${{ steps.matrix_value.outputs.individual_matrix}} + output3: ${{ steps.matrix_value.outputs.testRail_matrix}} steps: - name: Checkout uses: actions/checkout@v3 @@ -91,12 +92,15 @@ jobs: run: | if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]] || [[ "${{ inputs.tests_to_run}}" != "" ]] || [[ "${{ github.event.pull_request.user.login }}" == "dependabot[bot]" ]]; then if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]] || [[ "${{ github.event.pull_request.user.login }}" == "dependabot[bot]" ]]; then - e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]') echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT" + testRail=$(echo $e2eNames | tr ',' ' ') + testRail=$(echo $testRail | sed 's/\S*\(.e2e.ts\)\S*//g') + echo "testRail_matrix=$testRail" >> "$GITHUB_OUTPUT" echo "individual_matrix=" >> "$GITHUB_OUTPUT" else if [[ "${{ inputs.tests_to_run}}" != "" ]]; then echo "matrix=${{ toJson(inputs.tests_to_run)}}" >> "$GITHUB_OUTPUT" + echo "testRail_matrix=${{ inputs.tests_to_run}}" >> "$GITHUB_OUTPUT" echo "individual_matrix=true" >> "$GITHUB_OUTPUT" else echo "matrix=" >> "$GITHUB_OUTPUT" @@ -109,10 +113,14 @@ jobs: if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]] || [[ "${{ github.event.pull_request.user.login }}" == "dependabot[bot]" ]]; then e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]') echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT" + testRail=$(echo $e2eNames | tr ',' ' ') + testRail=$(echo $testRail | sed 's/\S*\(.e2e.ts\)\S*//g') + echo "testRail_matrix=$testRail" >> "$GITHUB_OUTPUT" echo "individual_matrix=" >> "$GITHUB_OUTPUT" else if [[ "${{ inputs.tests_to_run}}" != "" ]]; then echo "matrix=${{ toJson(inputs.tests_to_run)}}" >> "$GITHUB_OUTPUT" + echo "testRail_matrix=${{ inputs.tests_to_run}}" >> "$GITHUB_OUTPUT" echo "individual_matrix=true" >> "$GITHUB_OUTPUT" else echo "matrix=" >> "$GITHUB_OUTPUT" @@ -362,17 +370,74 @@ jobs: getTestCaseNewName=$(jq --compact-output -s 'add' input.json) groupTestCasesByTitle=$(echo $getTestCaseNewName | jq --compact-output '[group_by(.title)[] | [.[0].title, .[0].status_id, map(.id)[]]]') getFirstTestNewName=$(echo $groupTestCasesByTitle | jq --compact-output '[.[] | .[0]]') - for y in ${{ inputs.tests_to_run}}; do + for y in ${{needs.output_detox_tests_to_run.outputs.output3}}; do + missingCases="" + echo "$y" removeBracket=$(echo $y | tr -d '[') removeBracket=$(echo $removeBracket | tr -d ']') removeBracket=$(echo $removeBracket | tr -d ',') - for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g'); do - missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$z" 'map(select(index($testsTypedIn)))') - if [[ "$missingCases" == "[]" ]]; then - matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[ios]"))') - echo "" >> input.json + addSpace=$(echo $removeBracket | sed 's/\([^[:blank:]]\)\([[:upper:]]\)/\1 \2/g') + + if [[ "$removeBracket" == "Appeals" || "$removeBracket" == "Appointments" ]]; then + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'select(.[] == "'"$testsTypedIn"'")') + echo "$missingCases" + elif [[ "$removeBracket" == "VALetters" ]]; then + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "VA Letters" '.[] | select(contains($testsTypedIn))') + else + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" '.[] | select(contains($testsTypedIn))') + fi + + if [[ "$missingCases" == "" ]]; then + if [[ "$removeBracket" == "Appointments" ]]; then + title="$removeBracket Screen [ios]" + matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') + elif [[ "$removeBracket" == "VALetters" ]]; then + matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "VA Letters [ios]")') + elif [[ "$removeBracket" == "Appeals" ]]; then + title="$removeBracket [ios]" + matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') + else + matchMissingCases=$(echo $getTest| jq --arg getCase "$removeBracket" --compact-output 'select(.title | contains($getCase) and contains("[ios]"))') + fi + echo "" >> input.json + echo "$matchMissingCases" + if [[ "$matchMissingCases" != "" ]]; then + addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') + echo $addMissingCasesToArray >> input.json + continue + fi + else + continue + fi + + missingCases="" + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$addSpace" '.[] | select(contains($testsTypedIn))') + if [[ "$missingCases" == "" ]]; then + title="$addSpace [ios]" + matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') + echo "$matchMissingCases" + if [[ "$matchMissingCases" != "" ]]; then addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') echo $addMissingCasesToArray >> input.json + continue + fi + else + continue + fi + + for z in $(echo $removeBracket | sed 's/[A-Z]\+/\n&/g'); do + missingCases="" + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$z" '.[] | select(contains($testsTypedIn))') + if [[ "$missingCases" == "" ]]; then + echo "$z" + matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[ios]"))') + if [[ "$matchMissingCases" != "" ]]; then + echo "$matchMissingCases" + addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') + echo $addMissingCasesToArray >> input.json + break + fi + else break fi done From 4d5a4c6e0392dd1bdf4bbd18c4a26ee8994f641b Mon Sep 17 00:00:00 2001 From: rbontrager Date: Thu, 21 Nov 2024 10:06:44 -0600 Subject: [PATCH 70/74] Update e2e_android.yml --- .github/workflows/e2e_android.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index bb45d052263..8543737a940 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -402,24 +402,28 @@ jobs: removeBracket=$(echo $removeBracket | tr -d ',') addSpace=$(echo $removeBracket | sed 's/\([^[:blank:]]\)\([[:upper:]]\)/\1 \2/g') - if [[ "$removeBracket" == "Appeals" || "$removeBracket" == "Appointments" ]]; then - missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'select(.[] == "'"$testsTypedIn"'")') + if [[ "$removeBracket" == "Appointments" ]]; then + title="$removeBracket Screen [android]" + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$title" 'select(.[] == "'"$testsTypedIn"'")') echo "$missingCases" + elif [[ "$removeBracket" == "Appeals" ]]; then + title="$removeBracket [android]" + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$title" 'select(.[] == "'"$testsTypedIn"'")') elif [[ "$removeBracket" == "VALetters" ]]; then missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "VA Letters" '.[] | select(contains($testsTypedIn))') else - missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" '.[] | select(contains($testsTypedIn))') + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" '.[] | select(contains($testsTypedIn) and contains("[android]"))') fi if [[ "$missingCases" == "" ]]; then if [[ "$removeBracket" == "Appointments" ]]; then title="$removeBracket Screen [android]" - matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') + matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$getCase"'")') elif [[ "$removeBracket" == "VALetters" ]]; then matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "VA Letters [android]")') elif [[ "$removeBracket" == "Appeals" ]]; then title="$removeBracket [android]" - matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') + matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$getCase"'")') else matchMissingCases=$(echo $getTest| jq --arg getCase "$removeBracket" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') fi @@ -435,7 +439,7 @@ jobs: fi missingCases="" - missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$addSpace" '.[] | select(contains($testsTypedIn))') + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$addSpace" '.[] | select(contains($testsTypedIn) and contains("[android]"))') if [[ "$missingCases" == "" ]]; then title="$addSpace [android]" matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') From de343f15d2aa061cd27ebac5e1bf6a6ade7dd5ae Mon Sep 17 00:00:00 2001 From: rbontrager Date: Thu, 21 Nov 2024 10:24:32 -0600 Subject: [PATCH 71/74] Stop android error, update iOS logic --- .github/workflows/e2e_android.yml | 2 +- .github/workflows/e2e_ios.yml | 28 ++++++++++++++++------------ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 8543737a940..42dac061153 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -203,7 +203,7 @@ jobs: run: yarn env:staging - name: Bundle Android app - run: yarn e2e:android-build1 + run: yarn e2e:android-build - name: Run e2e tests for Android - Full Test id: run_e2e_tests diff --git a/.github/workflows/e2e_ios.yml b/.github/workflows/e2e_ios.yml index 59ec57d964b..851d2b5760b 100644 --- a/.github/workflows/e2e_ios.yml +++ b/.github/workflows/e2e_ios.yml @@ -378,26 +378,30 @@ jobs: removeBracket=$(echo $removeBracket | tr -d ',') addSpace=$(echo $removeBracket | sed 's/\([^[:blank:]]\)\([[:upper:]]\)/\1 \2/g') - if [[ "$removeBracket" == "Appeals" || "$removeBracket" == "Appointments" ]]; then - missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" 'select(.[] == "'"$testsTypedIn"'")') + if [[ "$removeBracket" == "Appointments" ]]; then + title="$removeBracket Screen [android]" + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$title" 'select(.[] == "'"$testsTypedIn"'")') echo "$missingCases" + elif [[ "$removeBracket" == "Appeals" ]]; then + title="$removeBracket [android]" + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$title" 'select(.[] == "'"$testsTypedIn"'")') elif [[ "$removeBracket" == "VALetters" ]]; then missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "VA Letters" '.[] | select(contains($testsTypedIn))') else - missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" '.[] | select(contains($testsTypedIn))') + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" '.[] | select(contains($testsTypedIn) and contains("[android]"))') fi if [[ "$missingCases" == "" ]]; then if [[ "$removeBracket" == "Appointments" ]]; then - title="$removeBracket Screen [ios]" - matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') + title="$removeBracket Screen [android]" + matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$getCase"'")') elif [[ "$removeBracket" == "VALetters" ]]; then - matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "VA Letters [ios]")') + matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "VA Letters [android]")') elif [[ "$removeBracket" == "Appeals" ]]; then - title="$removeBracket [ios]" - matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') + title="$removeBracket [android]" + matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$getCase"'")') else - matchMissingCases=$(echo $getTest| jq --arg getCase "$removeBracket" --compact-output 'select(.title | contains($getCase) and contains("[ios]"))') + matchMissingCases=$(echo $getTest| jq --arg getCase "$removeBracket" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') fi echo "" >> input.json echo "$matchMissingCases" @@ -411,9 +415,9 @@ jobs: fi missingCases="" - missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$addSpace" '.[] | select(contains($testsTypedIn))') + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$addSpace" '.[] | select(contains($testsTypedIn) and contains("[android]"))') if [[ "$missingCases" == "" ]]; then - title="$addSpace [ios]" + title="$addSpace [android]" matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') echo "$matchMissingCases" if [[ "$matchMissingCases" != "" ]]; then @@ -430,7 +434,7 @@ jobs: missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$z" '.[] | select(contains($testsTypedIn))') if [[ "$missingCases" == "" ]]; then echo "$z" - matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[ios]"))') + matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') if [[ "$matchMissingCases" != "" ]]; then echo "$matchMissingCases" addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') From 02d17e4833a6ad969d80a96245db929d46b556fc Mon Sep 17 00:00:00 2001 From: rbontrager Date: Thu, 21 Nov 2024 12:02:48 -0600 Subject: [PATCH 72/74] Update e2e_ios.yml --- .github/workflows/e2e_ios.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/e2e_ios.yml b/.github/workflows/e2e_ios.yml index 851d2b5760b..b00abaa5065 100644 --- a/.github/workflows/e2e_ios.yml +++ b/.github/workflows/e2e_ios.yml @@ -92,6 +92,7 @@ jobs: run: | if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]] || [[ "${{ inputs.tests_to_run}}" != "" ]] || [[ "${{ github.event.pull_request.user.login }}" == "dependabot[bot]" ]]; then if [[ "${{ inputs.run_full_test }}" == "true" ]] || [[ ${{ github.event_name }} == 'schedule' ]] || [[ "${{ github.event.pull_request.user.login }}" == "dependabot[bot]" ]]; then + e2eNames=$(gh api repos/department-of-veterans-affairs/va-mobile-app/contents/VAMobile/e2e/tests | jq --compact-output 'del(.[] | select(.name == "utils.ts")) | [.[].name]') echo "matrix=$e2eNames" >> "$GITHUB_OUTPUT" testRail=$(echo $e2eNames | tr ',' ' ') testRail=$(echo $testRail | sed 's/\S*\(.e2e.ts\)\S*//g') From be6f2b2db253c4dc089789d8c27a460dffb41254 Mon Sep 17 00:00:00 2001 From: rbontrager Date: Thu, 21 Nov 2024 13:27:06 -0600 Subject: [PATCH 73/74] Update e2e_ios.yml --- .github/workflows/e2e_ios.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/e2e_ios.yml b/.github/workflows/e2e_ios.yml index b00abaa5065..be06637d9ae 100644 --- a/.github/workflows/e2e_ios.yml +++ b/.github/workflows/e2e_ios.yml @@ -380,29 +380,29 @@ jobs: addSpace=$(echo $removeBracket | sed 's/\([^[:blank:]]\)\([[:upper:]]\)/\1 \2/g') if [[ "$removeBracket" == "Appointments" ]]; then - title="$removeBracket Screen [android]" + title="$removeBracket Screen [ios]" missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$title" 'select(.[] == "'"$testsTypedIn"'")') echo "$missingCases" elif [[ "$removeBracket" == "Appeals" ]]; then - title="$removeBracket [android]" + title="$removeBracket [ios]" missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$title" 'select(.[] == "'"$testsTypedIn"'")') elif [[ "$removeBracket" == "VALetters" ]]; then missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "VA Letters" '.[] | select(contains($testsTypedIn))') else - missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" '.[] | select(contains($testsTypedIn) and contains("[android]"))') + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" '.[] | select(contains($testsTypedIn) and contains("[ios]"))') fi if [[ "$missingCases" == "" ]]; then if [[ "$removeBracket" == "Appointments" ]]; then - title="$removeBracket Screen [android]" + title="$removeBracket Screen [ios]" matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$getCase"'")') elif [[ "$removeBracket" == "VALetters" ]]; then - matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "VA Letters [android]")') + matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "VA Letters [ios]")') elif [[ "$removeBracket" == "Appeals" ]]; then - title="$removeBracket [android]" + title="$removeBracket [ios]" matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$getCase"'")') else - matchMissingCases=$(echo $getTest| jq --arg getCase "$removeBracket" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') + matchMissingCases=$(echo $getTest| jq --arg getCase "$removeBracket" --compact-output 'select(.title | contains($getCase) and contains("[ios]"))') fi echo "" >> input.json echo "$matchMissingCases" @@ -416,9 +416,9 @@ jobs: fi missingCases="" - missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$addSpace" '.[] | select(contains($testsTypedIn) and contains("[android]"))') + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$addSpace" '.[] | select(contains($testsTypedIn) and contains("[ios]"))') if [[ "$missingCases" == "" ]]; then - title="$addSpace [android]" + title="$addSpace [ios]" matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$title"'")') echo "$matchMissingCases" if [[ "$matchMissingCases" != "" ]]; then @@ -435,7 +435,7 @@ jobs: missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$z" '.[] | select(contains($testsTypedIn))') if [[ "$missingCases" == "" ]]; then echo "$z" - matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[android]"))') + matchMissingCases=$(echo $getTest| jq --arg getCase "$z" --compact-output 'select(.title | contains($getCase) and contains("[ios]"))') if [[ "$matchMissingCases" != "" ]]; then echo "$matchMissingCases" addMissingCasesToArray=$(echo $getTestCaseNewName | jq --argjson testToAdd "$matchMissingCases" '. += [$testToAdd]') From d1418e078cd553073f95c52a282a95caadc0430e Mon Sep 17 00:00:00 2001 From: rbontrager Date: Fri, 22 Nov 2024 09:43:10 -0600 Subject: [PATCH 74/74] Account for AppointmentsExpanded Name Change in testRail --- .github/workflows/e2e_android.yml | 6 +++++- .github/workflows/e2e_ios.yml | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/e2e_android.yml b/.github/workflows/e2e_android.yml index 42dac061153..4d3b9084031 100644 --- a/.github/workflows/e2e_android.yml +++ b/.github/workflows/e2e_android.yml @@ -406,11 +406,13 @@ jobs: title="$removeBracket Screen [android]" missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$title" 'select(.[] == "'"$testsTypedIn"'")') echo "$missingCases" + elif [[ "$removeBracket" == "AppointmentsExpanded" ]]; then + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "Appointments Screen Expansion [android]" '.[] | select(contains($testsTypedIn))') elif [[ "$removeBracket" == "Appeals" ]]; then title="$removeBracket [android]" missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$title" 'select(.[] == "'"$testsTypedIn"'")') elif [[ "$removeBracket" == "VALetters" ]]; then - missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "VA Letters" '.[] | select(contains($testsTypedIn))') + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "VA Letters [android]" '.[] | select(contains($testsTypedIn))') else missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" '.[] | select(contains($testsTypedIn) and contains("[android]"))') fi @@ -419,6 +421,8 @@ jobs: if [[ "$removeBracket" == "Appointments" ]]; then title="$removeBracket Screen [android]" matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$getCase"'")') + elif [[ "$removeBracket" == "AppointmentsExpanded" ]]; then + matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == ":ios: Appointments Screen Expansion [android]")') elif [[ "$removeBracket" == "VALetters" ]]; then matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "VA Letters [android]")') elif [[ "$removeBracket" == "Appeals" ]]; then diff --git a/.github/workflows/e2e_ios.yml b/.github/workflows/e2e_ios.yml index be06637d9ae..4beb085ef8e 100644 --- a/.github/workflows/e2e_ios.yml +++ b/.github/workflows/e2e_ios.yml @@ -383,11 +383,13 @@ jobs: title="$removeBracket Screen [ios]" missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$title" 'select(.[] == "'"$testsTypedIn"'")') echo "$missingCases" + elif [[ "$removeBracket" == "AppointmentsExpanded" ]]; then + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "Appointments Screen Expansion [ios]" '.[] | select(contains($testsTypedIn))') elif [[ "$removeBracket" == "Appeals" ]]; then title="$removeBracket [ios]" missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$title" 'select(.[] == "'"$testsTypedIn"'")') elif [[ "$removeBracket" == "VALetters" ]]; then - missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "VA Letters" '.[] | select(contains($testsTypedIn))') + missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "VA Letters [ios]" '.[] | select(contains($testsTypedIn))') else missingCases=$(echo $getFirstTestNewName | jq --arg testsTypedIn "$removeBracket" '.[] | select(contains($testsTypedIn) and contains("[ios]"))') fi @@ -396,6 +398,8 @@ jobs: if [[ "$removeBracket" == "Appointments" ]]; then title="$removeBracket Screen [ios]" matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "'"$getCase"'")') + elif [[ "$removeBracket" == "AppointmentsExpanded" ]]; then + matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == ":ios: Appointments Screen Expansion [ios]")') elif [[ "$removeBracket" == "VALetters" ]]; then matchMissingCases=$(echo $getTest| jq --arg getCase "$title" --compact-output 'select(.title == "VA Letters [ios]")') elif [[ "$removeBracket" == "Appeals" ]]; then