From 819c43943d83d9ac82385d469308e62e1814d4e2 Mon Sep 17 00:00:00 2001 From: tatilepizs Date: Tue, 3 Dec 2024 13:43:26 -0600 Subject: [PATCH] final changes --- .github/workflows/build.yml | 444 +++++++++--------- .../default/login/login.wdio.page.js | 3 +- 2 files changed, 223 insertions(+), 224 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8e7915a59b..62fda31519 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,62 +26,62 @@ jobs: timeout-minutes: 60 steps: - - name: Install bats - run: | - sudo apt-get update - sudo apt-get install -y bats - - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ env.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - if: ${{ env.INTERNAL_CONTRIBUTOR }} - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.ECR_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.ECR_SECRET_ACCESS_KEY }} - aws-region: eu-west-2 - if: ${{ env.INTERNAL_CONTRIBUTOR }} - - - name: Login to Amazon ECR - id: login-ecr - if: ${{ env.INTERNAL_CONTRIBUTOR }} - uses: aws-actions/amazon-ecr-login@v2 - with: - mask-password: 'true' - - - uses: actions/checkout@v4 - - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - - name: Create logs directory - run: mkdir tests/logs - - run: npm ci - - name: Compile - run: npm run ci-compile - - name: Setup QEMU - if: ${{ env.INTERNAL_CONTRIBUTOR }} - uses: docker/setup-qemu-action@v3 - - name: Setup Buildx - if: ${{ env.INTERNAL_CONTRIBUTOR }} - uses: docker/setup-buildx-action@v3 - - name: Publish for testing - run: npm run publish-for-testing - - name: Upload docker images as artifacts - uses: actions/upload-artifact@v4 - with: - name: cht-images - path: images/ - if: ${{ !env.INTERNAL_CONTRIBUTOR }} - - name: Search-Replace PR Body - if: ${{ env.INTERNAL_CONTRIBUTOR && github.event_name == 'pull_request' }} - uses: ./.github/actions/update-staging-url-placeholders - with: - token: ${{ secrets.GITHUB_TOKEN }} + - name: Install bats + run: | + sudo apt-get update + sudo apt-get install -y bats + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ env.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + if: ${{ env.INTERNAL_CONTRIBUTOR }} + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.ECR_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.ECR_SECRET_ACCESS_KEY }} + aws-region: eu-west-2 + if: ${{ env.INTERNAL_CONTRIBUTOR }} + + - name: Login to Amazon ECR + id: login-ecr + if: ${{ env.INTERNAL_CONTRIBUTOR }} + uses: aws-actions/amazon-ecr-login@v2 + with: + mask-password: 'true' + + - uses: actions/checkout@v4 + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + - name: Create logs directory + run: mkdir tests/logs + - run: npm ci + - name: Compile + run: npm run ci-compile + - name: Setup QEMU + if: ${{ env.INTERNAL_CONTRIBUTOR }} + uses: docker/setup-qemu-action@v3 + - name: Setup Buildx + if: ${{ env.INTERNAL_CONTRIBUTOR }} + uses: docker/setup-buildx-action@v3 + - name: Publish for testing + run: npm run publish-for-testing + - name: Upload docker images as artifacts + uses: actions/upload-artifact@v4 + with: + name: cht-images + path: images/ + if: ${{ !env.INTERNAL_CONTRIBUTOR }} + - name: Search-Replace PR Body + if: ${{ env.INTERNAL_CONTRIBUTOR && github.event_name == 'pull_request' }} + uses: ./.github/actions/update-staging-url-placeholders + with: + token: ${{ secrets.GITHUB_TOKEN }} config-tests: needs: build @@ -95,15 +95,15 @@ jobs: cmd: ['test-config-default'] steps: - - uses: actions/checkout@v4 - - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - - run: sudo apt-get install -y xsltproc - - run: npm ci - - name: Run Tests - run: npm run ${{ matrix.cmd }} + - uses: actions/checkout@v4 + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + - run: sudo apt-get install -y xsltproc + - run: npm ci + - name: Run Tests + run: npm run ${{ matrix.cmd }} test-cht-form: needs: build @@ -252,122 +252,122 @@ jobs: - cmd: ci-webdriver-default-mobile chrome-version: 90 steps: - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ env.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - if: ${{ env.INTERNAL_CONTRIBUTOR }} - - - name: Configure AWS credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.ECR_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.ECR_SECRET_ACCESS_KEY }} - aws-region: eu-west-2 - if: ${{ env.INTERNAL_CONTRIBUTOR }} - - - name: Login to Amazon ECR - id: login-ecr - if: ${{ env.INTERNAL_CONTRIBUTOR }} - uses: aws-actions/amazon-ecr-login@v2 - with: - mask-password: 'true' - - - name: Use Node.js ${{ env.NODE_VERSION }} - uses: actions/setup-node@v4 - with: - node-version: ${{ env.NODE_VERSION }} - - uses: actions/checkout@v4 - - name: Download docker images artifacts - uses: actions/download-artifact@v4 - with: - name: cht-images - path: images/ - if: ${{ !env.INTERNAL_CONTRIBUTOR }} - - name: Load docker images - run: ls -1 *.tar | xargs --no-run-if-empty -L 1 docker load -i - working-directory: images/ - if: ${{ !env.INTERNAL_CONTRIBUTOR }} - - - name: Create logs directory - run: mkdir tests/logs - - name: Install pyxform - run: python -m pip install git+https://github.com/medic/pyxform.git@medic-conf-1.17#egg=pyxform-medic - - name: Install cht-conf - run: npm install -g cht-conf - - run: npm ci - - name: Fetch allure history - uses: actions/checkout@v4 - with: - repository: 'medic/build-history-data' - path: 'build-history-data' - persist-credentials: false - - name: Copy allure history - run: | - mkdir -p allure-results/history - cp -r build-history-data/cht-core/allure/${{ env.JOB_NAME }}/allure-report/history allure-results | true - - name: Install Chrome 90 - if: ${{matrix.chrome-version=='90'}} - run: | - wget -O "google-chrome-stable_current_amd64.deb" https://www.slimjet.com/chrome/download-chrome.php?file=files/90.0.4430.72/google-chrome-stable_current_amd64.deb - sudo dpkg -i "google-chrome-stable_current_amd64.deb" - npm install chromedriver@^90.0.1 - - name: Run tests ${{ matrix.cmd }}-${{ matrix.suite }} on Chrome ${{ matrix.chrome-version }} - run: npm run ${{ matrix.cmd }} -- --suite=${{ matrix.suite }} - - - name: Fetch allure history - if: always() - uses: actions/checkout@v4 - with: - repository: 'medic/build-history-data' - path: 'build-history-data-new' - persist-credentials: false - - name: Copy new allure history - if: always() - run: | - mkdir -p build-history-data-new/cht-core/allure/${{ env.JOB_NAME }}/history - cp -r allure-report/history build-history-data-new/cht-core/allure/${{ env.JOB_NAME }}/allure-report | true - - name: Upload allure report history - if: always() && github.ref == 'refs/heads/master' # whether pass or fail, but only on master - continue-on-error: true # don't fail the build if git push fails - uses: actions-js/push@master - with: - github_token: ${{ secrets.BUILD_HISTORY_DATA_PUSH_TOKEN }} - directory: 'build-history-data-new' - repository: 'medic/build-history-data' - force: true - - name: Fetch report repo - if: always() - uses: actions/checkout@v4 - with: - repository: 'medic/build-history' - path: 'build-history' - persist-credentials: false - - name: Copy new report - if: always() - run: | - mkdir -p build-history/cht-core/allure/${{ env.JOB_NAME }} - cp -r allure-report build-history/cht-core/allure/${{ env.JOB_NAME }} | true - - name: Upload allure report - if: always() && github.ref == 'refs/heads/master' # whether pass or fail, but only on master - continue-on-error: true # don't fail the build if git push fails - uses: actions-js/push@master - with: - github_token: ${{ secrets.BUILD_HISTORY_DATA_PUSH_TOKEN }} - directory: 'build-history' - repository: 'medic/build-history' - force: true - - name: Archive Results - uses: actions/upload-artifact@v4 - with: - name: ${{ env.JOB_NAME }} - path: | - allure-results - allure-report - tests/logs - tests/results/ - if: ${{ failure() }} + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ env.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + if: ${{ env.INTERNAL_CONTRIBUTOR }} + + - name: Configure AWS credentials + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.ECR_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.ECR_SECRET_ACCESS_KEY }} + aws-region: eu-west-2 + if: ${{ env.INTERNAL_CONTRIBUTOR }} + + - name: Login to Amazon ECR + id: login-ecr + if: ${{ env.INTERNAL_CONTRIBUTOR }} + uses: aws-actions/amazon-ecr-login@v2 + with: + mask-password: 'true' + + - name: Use Node.js ${{ env.NODE_VERSION }} + uses: actions/setup-node@v4 + with: + node-version: ${{ env.NODE_VERSION }} + - uses: actions/checkout@v4 + - name: Download docker images artifacts + uses: actions/download-artifact@v4 + with: + name: cht-images + path: images/ + if: ${{ !env.INTERNAL_CONTRIBUTOR }} + - name: Load docker images + run: ls -1 *.tar | xargs --no-run-if-empty -L 1 docker load -i + working-directory: images/ + if: ${{ !env.INTERNAL_CONTRIBUTOR }} + + - name: Create logs directory + run: mkdir tests/logs + - name: Install pyxform + run: python -m pip install git+https://github.com/medic/pyxform.git@medic-conf-1.17#egg=pyxform-medic + - name: Install cht-conf + run: npm install -g cht-conf + - run: npm ci + - name: Fetch allure history + uses: actions/checkout@v4 + with: + repository: 'medic/build-history-data' + path: 'build-history-data' + persist-credentials: false + - name: Copy allure history + run: | + mkdir -p allure-results/history + cp -r build-history-data/cht-core/allure/${{ env.JOB_NAME }}/allure-report/history allure-results | true + - name: Install Chrome 90 + if: ${{matrix.chrome-version=='90'}} + run: | + wget -O "google-chrome-stable_current_amd64.deb" https://www.slimjet.com/chrome/download-chrome.php?file=files/90.0.4430.72/google-chrome-stable_current_amd64.deb + sudo dpkg -i "google-chrome-stable_current_amd64.deb" + npm install chromedriver@^90.0.1 + - name: Run tests ${{ matrix.cmd }}-${{ matrix.suite }} on Chrome ${{ matrix.chrome-version }} + run: npm run ${{ matrix.cmd }} -- --suite=${{ matrix.suite }} + + - name: Fetch allure history + if: always() + uses: actions/checkout@v4 + with: + repository: 'medic/build-history-data' + path: 'build-history-data-new' + persist-credentials: false + - name: Copy new allure history + if: always() + run: | + mkdir -p build-history-data-new/cht-core/allure/${{ env.JOB_NAME }}/history + cp -r allure-report/history build-history-data-new/cht-core/allure/${{ env.JOB_NAME }}/allure-report | true + - name: Upload allure report history + if: always() && github.ref == 'refs/heads/master' # whether pass or fail, but only on master + continue-on-error: true # don't fail the build if git push fails + uses: actions-js/push@master + with: + github_token: ${{ secrets.BUILD_HISTORY_DATA_PUSH_TOKEN }} + directory: 'build-history-data-new' + repository: 'medic/build-history-data' + force: true + - name: Fetch report repo + if: always() + uses: actions/checkout@v4 + with: + repository: 'medic/build-history' + path: 'build-history' + persist-credentials: false + - name: Copy new report + if: always() + run: | + mkdir -p build-history/cht-core/allure/${{ env.JOB_NAME }} + cp -r allure-report build-history/cht-core/allure/${{ env.JOB_NAME }} | true + - name: Upload allure report + if: always() && github.ref == 'refs/heads/master' # whether pass or fail, but only on master + continue-on-error: true # don't fail the build if git push fails + uses: actions-js/push@master + with: + github_token: ${{ secrets.BUILD_HISTORY_DATA_PUSH_TOKEN }} + directory: 'build-history' + repository: 'medic/build-history' + force: true + - name: Archive Results + uses: actions/upload-artifact@v4 + with: + name: ${{ env.JOB_NAME }} + path: | + allure-results + allure-report + tests/logs + tests/results/ + if: ${{ failure() }} publish: needs: [tests, config-tests, test-cht-form, translations] @@ -378,47 +378,47 @@ jobs: if: ${{ github.event_name != 'pull_request' }} steps: - - name: Install regctl - if: ${{ env.INTERNAL_CONTRIBUTOR }} - uses: regclient/actions/regctl-installer@main - - - name: Configure AWS credentials - if: ${{ env.INTERNAL_CONTRIBUTOR }} - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.ECR_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.ECR_SECRET_ACCESS_KEY }} - aws-region: eu-west-2 - - name: Login to Amazon ECR - if: ${{ env.INTERNAL_CONTRIBUTOR }} - id: login-ecr - uses: aws-actions/amazon-ecr-login@v2 - with: - mask-password: 'true' - - - name: Configure AWS credentials Public - if: ${{ env.INTERNAL_CONTRIBUTOR }} - uses: aws-actions/configure-aws-credentials@v4 - with: - aws-access-key-id: ${{ secrets.ECR_ACCESS_KEY_ID }} - aws-secret-access-key: ${{ secrets.ECR_SECRET_ACCESS_KEY }} - aws-region: us-east-1 - - name: Login to Public Amazon ECR - if: ${{ env.INTERNAL_CONTRIBUTOR }} - id: login-ecr-public - uses: aws-actions/amazon-ecr-login@v2 - with: - registry-type: public - mask-password: 'true' - - - uses: actions/checkout@v4 - - name: Publish - if: ${{ env.INTERNAL_CONTRIBUTOR }} - run: | - npm ci - cd scripts/ci - node ./publish.js - node ./tag-docker-images.js + - name: Install regctl + if: ${{ env.INTERNAL_CONTRIBUTOR }} + uses: regclient/actions/regctl-installer@main + + - name: Configure AWS credentials + if: ${{ env.INTERNAL_CONTRIBUTOR }} + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.ECR_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.ECR_SECRET_ACCESS_KEY }} + aws-region: eu-west-2 + - name: Login to Amazon ECR + if: ${{ env.INTERNAL_CONTRIBUTOR }} + id: login-ecr + uses: aws-actions/amazon-ecr-login@v2 + with: + mask-password: 'true' + + - name: Configure AWS credentials Public + if: ${{ env.INTERNAL_CONTRIBUTOR }} + uses: aws-actions/configure-aws-credentials@v4 + with: + aws-access-key-id: ${{ secrets.ECR_ACCESS_KEY_ID }} + aws-secret-access-key: ${{ secrets.ECR_SECRET_ACCESS_KEY }} + aws-region: us-east-1 + - name: Login to Public Amazon ECR + if: ${{ env.INTERNAL_CONTRIBUTOR }} + id: login-ecr-public + uses: aws-actions/amazon-ecr-login@v2 + with: + registry-type: public + mask-password: 'true' + + - uses: actions/checkout@v4 + - name: Publish + if: ${{ env.INTERNAL_CONTRIBUTOR }} + run: | + npm ci + cd scripts/ci + node ./publish.js + node ./tag-docker-images.js publish-generated-docs: needs: [publish] diff --git a/tests/page-objects/default/login/login.wdio.page.js b/tests/page-objects/default/login/login.wdio.page.js index 3788ad445d..7bc89d3580 100644 --- a/tests/page-objects/default/login/login.wdio.page.js +++ b/tests/page-objects/default/login/login.wdio.page.js @@ -128,8 +128,7 @@ const changeLocale = async locale => { if (!locale) { return; } - await (await localeByName(locale)).waitForClickable(); - await (await localeByName(locale)).click(); + return (await localeByName(locale)).click(); }; const changeLanguage = async (languageCode, userTranslation) => {