From b15dd81244716ec0f66b3e16a03b166a01f9bfb4 Mon Sep 17 00:00:00 2001 From: Tim Yao <31641325+tim-yao@users.noreply.github.com> Date: Wed, 1 Apr 2026 15:19:14 +1100 Subject: [PATCH 1/5] Update E2E workflow to use new image and steps --- .github/workflows/run_e2e_be.yml | 62 +++++++++++++------------------- 1 file changed, 24 insertions(+), 38 deletions(-) diff --git a/.github/workflows/run_e2e_be.yml b/.github/workflows/run_e2e_be.yml index b7fd8e0..28ded1a 100644 --- a/.github/workflows/run_e2e_be.yml +++ b/.github/workflows/run_e2e_be.yml @@ -107,61 +107,47 @@ jobs: name: run_e2e_be runs-on: ${{ inputs.runner }} container: - image: docker://sdptestautomation/e2e:${{ inputs.tag }} + image: ghcr.io/${{ github.repository_owner }}/sdp-testing-playwright:${{ inputs.tag }} credentials: - username: ${{ secrets.E2E_DOCKERHUB_USERNAME }} - password: ${{ secrets.E2E_DOCKERHUB_PASSWORD }} + username: ${{ secrets.REGISTRY_USER }} + password: ${{ secrets.REGISTRY_TOKEN }} steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Check browsers - run: | - node --version - google-chrome --version - printenv - name: Set up Environment variables run: | - echo 'BE_BASE_URL=${{ inputs.be_url }}' >> $GITHUB_ENV - echo 'PROJECT=${{ inputs.project }}' >> $GITHUB_ENV + echo 'TEST_BE_BASE_URL=${{ inputs.be_url }}' >> $GITHUB_ENV + echo 'TEST_PROJECT=${{ inputs.project }}' >> $GITHUB_ENV - name: Check test environment urls run: | - echo $BE_BASE_URL - echo $PROJECT + echo $TEST_BE_BASE_URL + echo $TEST_PROJECT - name: "Wait up servers in case they are idle" run: | curl ${BE_BASE_URL} -s -S --max-time 1000 --write-out '%{http_code}' --output /dev/null; - - - name: Install chrome driver - run: /app/node_modules/selenium-webdriver/bin/linux/selenium-manager --browser chrome - shell: bash - name: Run Backend tests run: | - cd /app - Xvfb :99 -screen 0 1920x1080x24 & - NIGHTWATCH_BROWSER="${{ inputs.browser }}" npm run cucumber:${{ inputs.app }} -- --tags "${{ inputs.tags }}" --retry "${{ inputs.retry }}" --parallel "${{ inputs.parallel }}" - - - name: Report test results + npm run e2e:backend + - uses: actions/upload-artifact@v6 + if: ${{ !cancelled() }} + with: + name: playwright-report-backend + path: /app/playwright-report/ + retention-days: 30 + - name: Publish Test Report (summary-report) + uses: ctrf-io/github-test-reporter@v1 + with: + report-path: '/app/ctrf/*.json' + summary-report: true if: always() - uses: dpc-sdp/github-actions/.github/actions/test-report@main + - name: Publish Test Report (file-report) + uses: ctrf-io/github-test-reporter@v1 with: - report_name: 'test-reports-${{ inputs.name }}' - - - name: 'Add failed test result status to CMS' - if: inputs.test_status && failure() - run: | - cd /app - TEST_STATUS=fail node -r ts-node/register -r tsconfig-paths/register scripts/addTestResult.ts - - - name: 'Add succeeded test result status to CMS' - if: inputs.test_status && success() - run: | - cd /app - TEST_STATUS=pass node -r ts-node/register -r tsconfig-paths/register scripts/addTestResult.ts + report-path: '/app/ctrf/*.json' + file-report: true + if: always() notify_slack: uses: ./.github/workflows/notify_slack.yml if: | From e1b36fa9f75f25034692f72e5791f19b0b2b197f Mon Sep 17 00:00:00 2001 From: Tim Yao <31641325+tim-yao@users.noreply.github.com> Date: Wed, 1 Apr 2026 15:58:20 +1100 Subject: [PATCH 2/5] Update backend test URL in workflow --- .github/workflows/run_e2e_be.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/run_e2e_be.yml b/.github/workflows/run_e2e_be.yml index 28ded1a..28e8603 100644 --- a/.github/workflows/run_e2e_be.yml +++ b/.github/workflows/run_e2e_be.yml @@ -125,7 +125,7 @@ jobs: - name: "Wait up servers in case they are idle" run: | - curl ${BE_BASE_URL} -s -S --max-time 1000 --write-out '%{http_code}' --output /dev/null; + curl ${TEST_BE_BASE_URL} -s -S --max-time 1000 --write-out '%{http_code}' --output /dev/null; - name: Run Backend tests run: | From eccba1bf985d794d74ab5f44ace20ade18eacc06 Mon Sep 17 00:00:00 2001 From: Tim Yao <31641325+tim-yao@users.noreply.github.com> Date: Wed, 1 Apr 2026 16:06:01 +1100 Subject: [PATCH 3/5] Add defaults for run job in E2E workflow --- .github/workflows/run_e2e_be.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/run_e2e_be.yml b/.github/workflows/run_e2e_be.yml index 28e8603..b4a75b4 100644 --- a/.github/workflows/run_e2e_be.yml +++ b/.github/workflows/run_e2e_be.yml @@ -106,6 +106,9 @@ jobs: run_e2e_be: name: run_e2e_be runs-on: ${{ inputs.runner }} + defaults: + run: + working-directory: /app container: image: ghcr.io/${{ github.repository_owner }}/sdp-testing-playwright:${{ inputs.tag }} credentials: From 2e18683f77055b26e3fc59291fe538adba94f72a Mon Sep 17 00:00:00 2001 From: Tim Yao <31641325+tim-yao@users.noreply.github.com> Date: Wed, 1 Apr 2026 16:13:15 +1100 Subject: [PATCH 4/5] Add TEST_FE_BASE_URL to environment variables --- .github/workflows/run_e2e_be.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run_e2e_be.yml b/.github/workflows/run_e2e_be.yml index b4a75b4..3f11711 100644 --- a/.github/workflows/run_e2e_be.yml +++ b/.github/workflows/run_e2e_be.yml @@ -120,6 +120,7 @@ jobs: run: | echo 'TEST_BE_BASE_URL=${{ inputs.be_url }}' >> $GITHUB_ENV echo 'TEST_PROJECT=${{ inputs.project }}' >> $GITHUB_ENV + echo 'TEST_FE_BASE_URL=https://develop.reference-sdp-vic-gov-au.sdp.delivery' >> $GITHUB_ENV - name: Check test environment urls run: | From 90731a3fea72aa24595235a0f5f0784dce43d8eb Mon Sep 17 00:00:00 2001 From: Tim Yao <31641325+tim-yao@users.noreply.github.com> Date: Wed, 1 Apr 2026 16:34:13 +1100 Subject: [PATCH 5/5] Refactor environment variables in run_e2e_be.yml Updated environment variables for end-to-end tests by commenting out old variables and adding new ones for testing. --- .github/workflows/run_e2e_be.yml | 35 +++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/.github/workflows/run_e2e_be.yml b/.github/workflows/run_e2e_be.yml index 3f11711..feb83b0 100644 --- a/.github/workflows/run_e2e_be.yml +++ b/.github/workflows/run_e2e_be.yml @@ -78,18 +78,29 @@ on: env: # Test users - BE_ADMIN_USER: ${{ secrets.TEST_BE_ADMIN_USER }} - BE_ADMIN_PASS: ${{ secrets.TEST_BE_ADMIN_PASS }} - BE_APPROVER_USER: ${{ secrets.TEST_BE_APPROVER_USER }} - BE_APPROVER_PASS: ${{ secrets.TEST_BE_APPROVER_PASS }} - BE_EDITOR_USER: ${{ secrets.TEST_BE_EDITOR_USER }} - BE_EDITOR_PASS: ${{ secrets.TEST_BE_EDITOR_PASS }} - BE_DATAIMPORTER_USER: ${{ secrets.TEST_BE_DATAIMPORTER_USER }} - BE_DATAIMPORTER_PASS: ${{ secrets.TEST_BE_DATAIMPORTER_PASS }} - BE_SITE_ADMIN_USER: ${{ secrets.TEST_BE_SITE_ADMIN_USER }} - BE_SITE_ADMIN_PASS: ${{ secrets.TEST_BE_SITE_ADMIN_PASS }} - BE_CONTRIBUTOR_USER: ${{ secrets.TEST_BE_CONTRIBUTOR_USER }} - BE_CONTRIBUTOR_PASS: ${{ secrets.TEST_BE_CONTRIBUTOR_PASS }} + # BE_ADMIN_USER: ${{ secrets.TEST_BE_ADMIN_USER }} + # BE_ADMIN_PASS: ${{ secrets.TEST_BE_ADMIN_PASS }} + # BE_APPROVER_USER: ${{ secrets.TEST_BE_APPROVER_USER }} + # BE_APPROVER_PASS: ${{ secrets.TEST_BE_APPROVER_PASS }} + # BE_EDITOR_USER: ${{ secrets.TEST_BE_EDITOR_USER }} + # BE_EDITOR_PASS: ${{ secrets.TEST_BE_EDITOR_PASS }} + # BE_DATAIMPORTER_USER: ${{ secrets.TEST_BE_DATAIMPORTER_USER }} + # BE_DATAIMPORTER_PASS: ${{ secrets.TEST_BE_DATAIMPORTER_PASS }} + # BE_SITE_ADMIN_USER: ${{ secrets.TEST_BE_SITE_ADMIN_USER }} + # BE_SITE_ADMIN_PASS: ${{ secrets.TEST_BE_SITE_ADMIN_PASS }} + # BE_CONTRIBUTOR_USER: ${{ secrets.TEST_BE_CONTRIBUTOR_USER }} + # BE_CONTRIBUTOR_PASS: ${{ secrets.TEST_BE_CONTRIBUTOR_PASS }} + TEST_HTTP_AUTH_USER: ${{ secrets.TEST_HTTP_AUTH_USER }} + TEST_HTTP_AUTH_PASS: ${{ secrets.TEST_HTTP_AUTH_PASS }} + TEST_BE_ADMIN_USER: ${{ secrets.TEST_BE_ADMIN_USER }} + TEST_BE_ADMIN_PASS: ${{ secrets.TEST_BE_ADMIN_PASS }} + TEST_BE_EDITOR_USER: ${{ secrets.TEST_BE_EDITOR_USER }} + TEST_BE_EDITOR_PASS: ${{ secrets.TEST_BE_EDITOR_PASS }} + TEST_BE_APPROVER_USER: ${{ secrets.TEST_BE_APPROVER_USER }} + TEST_BE_APPROVER_PASS: ${{ secrets.TEST_BE_APPROVER_PASS }} + TEST_BE_PREVIEWER_USER: ${{ secrets.TEST_BE_PREVIEWER_USER }} + TEST_BE_PREVIEWER_PASS: ${{ secrets.TEST_BE_PREVIEWER_PASS }} + TEST_APPLITOOLS_API_KEY: ${{ secrets.TEST_APPLITOOLS_API_KEY }} # Project secrets PREMIER_MAILGUN_DEV_TOKEN: ${{ secrets.TEST_PREMIER_MAILGUN_DEV_TOKEN }} # Keys