From e941cc2c74e5816efe47a8ab18a1ab187a338ce9 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Tue, 30 Apr 2024 13:43:38 +0200 Subject: [PATCH 01/18] chore: add e2e smoke job --- .github/workflows/dhis2-verify-app.yml | 16 ++- .github/workflows/e2e-smoke.yaml | 131 +++++++++++++++++++++++++ 2 files changed, 146 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/e2e-smoke.yaml diff --git a/.github/workflows/dhis2-verify-app.yml b/.github/workflows/dhis2-verify-app.yml index 28f4c4b7a..638468e40 100644 --- a/.github/workflows/dhis2-verify-app.yml +++ b/.github/workflows/dhis2-verify-app.yml @@ -83,9 +83,23 @@ jobs: BRANCH_NAME: ${{ github.head_ref || github.ref_name }} PR_TITLE: ${{ github.event_name == 'pull_request' && github.event.pull_request.title || format('Direct push to {0}', github.ref_name) }} - call-workflow-e2e-prod: + call-workflow-e2e-smoke: if: "!contains(github.event.head_commit.message, '[skip ci]')" needs: [build, lint, test] + uses: ./.github/workflows/e2e-smoke.yaml + with: + should_record: ${{ contains(github.event.head_commit.message, '[e2e record]') || contains(join(github.event.pull_request.labels.*.name), 'e2e record')}} + secrets: + username: ${{ secrets.CYPRESS_DHIS2_USERNAME }} + password: ${{ secrets.CYPRESS_DHIS2_PASSWORD }} + # recordkey: ${{ secrets.CYPRESS_RECORD_KEY }} + # reportportal_api_key: ${{ secrets.REPORTPORTAL_API_KEY }} + # reportportal_endpoint: ${{ vars.REPORTPORTAL_ENDPOINT }} + # reportportal_project: ${{ vars.REPORTPORTAL_PROJECT }} + + call-workflow-e2e-prod: + if: "!contains(github.event.head_commit.message, '[skip ci]')" + needs: [call-workflow-e2e-smoke] uses: dhis2/workflows/.github/workflows/analytics-e2e-tests-prod.yml@master with: should_record: ${{ contains(github.event.head_commit.message, '[e2e record]') || contains(join(github.event.pull_request.labels.*.name), 'e2e record')}} diff --git a/.github/workflows/e2e-smoke.yaml b/.github/workflows/e2e-smoke.yaml new file mode 100644 index 000000000..5307db978 --- /dev/null +++ b/.github/workflows/e2e-smoke.yaml @@ -0,0 +1,131 @@ +name: 'e2e-prod' + +# Requirements: +# +# - Customize environment variables: +# BASE_URL_INSTANCES: Set the base url for the instances, e.g. https://test.e2e.dhis2.org +# NAME_PATTERN_PROD_INSTANCES: Set the name pattern for your instances. {version} will be replaced by "[majorVersion].[minorVersion]" +# +# - Other optional customizations: +# containers: Set the matrix containers array for the e2e-prod job. The number of parallel Cypress instances running for each backend version will equal the array length. +# +# - Set status check as required: +# We recommend setting "e2e-tests-success" as a required step in your workflow. + +on: + workflow_call: + inputs: + should_record: + required: false + type: boolean + default: false + secrets: + username: + required: true + password: + required: true + # recordkey: + # required: true + # reportportal_api_key: + # required: false + # reportportal_endpoint: + # required: false + # reportportal_project: + # required: false + +env: + BASE_URL_INSTANCES: https://test.e2e.dhis2.org + NAME_PATTERN_PROD_INSTANCES: 'analytics-{version}' + +concurrency: + group: e2e-prod-${{ github.workflow}}-${{ github.ref }} + cancel-in-progress: true + +defaults: + run: + shell: bash + +jobs: + compute-prod-versions: + runs-on: ubuntu-latest + outputs: + versions: ${{ steps.prod-versions.outputs.versions }} + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Output prod version urls + id: prod-versions + uses: dhis2/action-supported-legacy-versions@v1 + with: + instance-url-latest: https://test.e2e.dhis2.org/analytics-dev # can be removed if maxDHIS2Version has been specified + username: ${{ secrets.username }} + password: ${{ secrets.password }} + + e2e-smoke-tests: + needs: compute-prod-versions + runs-on: ubuntu-latest + env: + CI_BUILD_ID: ${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }} + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + PR_TITLE: ${{ github.event.pull_request.title }} + DHIS2_VERSION: ${{ matrix.versions }} + strategy: + fail-fast: false + matrix: + versions: ${{ fromJSON(needs.compute-prod-versions.outputs.versions) }} + containers: [1, 2, 3, 4] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18.x + - uses: browser-actions/setup-chrome@v1 + with: + chrome-version: stable + - run: | + echo "BROWSER_PATH=$(which chrome)" >> $GITHUB_ENV + + - name: Compute prod instance url + id: instance-url + run: | + url=${BASE_URL_INSTANCES%/}/${NAME_PATTERN_PROD_INSTANCES/"{version}"/$version} + echo "url=$url" >> $GITHUB_OUTPUT + echo "url: $url" + env: + version: ${{ matrix.versions }} + + - name: Run e2e smoke tests + uses: cypress-io/github-action@v5 + with: + spec: cypress/integration/spec1.cy.js + start: yarn d2-app-scripts start + wait-on: 'http://localhost:3000' + wait-on-timeout: 300 + record: ${{ inputs.should_record }} + parallel: ${{ inputs.should_record }} + browser: chrome + group: ${{ inputs.should_record && format('e2e-chrome-parallel-{0}', matrix.versions) }} + ci-build-id: ${{ inputs.should_record && github.run_id }} + env: + CI: true + BROWSER: none + CYPRESS_RECORD_KEY: ${{ secrets.recordkey }} + CYPRESS_dhis2BaseUrl: ${{ steps.instance-url.outputs.url }} + CYPRESS_dhis2InstanceVersion: ${{matrix.versions}} + CYPRESS_dhis2Username: ${{ secrets.username }} + CYPRESS_dhis2Password: ${{ secrets.password }} + CYPRESS_networkMode: live + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # REPORTPORTAL_API_KEY: ${{ secrets.reportportal_api_key }} + # REPORTPORTAL_ENDPOINT: ${{ secrets.reportportal_endpoint }} + # REPORTPORTAL_PROJECT: ${{ secrets.reportportal_project }} + + e2e-smoke-success: + needs: e2e-smoke-tests + if: ${{ success() || failure() }} + runs-on: ubuntu-latest + steps: + - run: if [ $result != 'success' ]; then exit 1; fi; + env: + result: ${{ needs.e2e-smoke-tests.result }} From 5767750e655ecbb6231542c0450b78722f70c763 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Tue, 30 Apr 2024 14:40:42 +0200 Subject: [PATCH 02/18] chore: fix syntax error --- .github/workflows/dhis2-verify-app.yml | 6 +----- cypress/integration/smoke.cy.js | 8 ++++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dhis2-verify-app.yml b/.github/workflows/dhis2-verify-app.yml index 638468e40..4317fd048 100644 --- a/.github/workflows/dhis2-verify-app.yml +++ b/.github/workflows/dhis2-verify-app.yml @@ -83,7 +83,7 @@ jobs: BRANCH_NAME: ${{ github.head_ref || github.ref_name }} PR_TITLE: ${{ github.event_name == 'pull_request' && github.event.pull_request.title || format('Direct push to {0}', github.ref_name) }} - call-workflow-e2e-smoke: + call-workflow-e2e-smoke: if: "!contains(github.event.head_commit.message, '[skip ci]')" needs: [build, lint, test] uses: ./.github/workflows/e2e-smoke.yaml @@ -92,10 +92,6 @@ jobs: secrets: username: ${{ secrets.CYPRESS_DHIS2_USERNAME }} password: ${{ secrets.CYPRESS_DHIS2_PASSWORD }} - # recordkey: ${{ secrets.CYPRESS_RECORD_KEY }} - # reportportal_api_key: ${{ secrets.REPORTPORTAL_API_KEY }} - # reportportal_endpoint: ${{ vars.REPORTPORTAL_ENDPOINT }} - # reportportal_project: ${{ vars.REPORTPORTAL_PROJECT }} call-workflow-e2e-prod: if: "!contains(github.event.head_commit.message, '[skip ci]')" diff --git a/cypress/integration/smoke.cy.js b/cypress/integration/smoke.cy.js index 005b0975e..bcdf5d04f 100644 --- a/cypress/integration/smoke.cy.js +++ b/cypress/integration/smoke.cy.js @@ -17,4 +17,12 @@ describe('Smoke Test', () => { .should('be.visible') .and('contain', TEST_AO.name) }) + + it('system and user settings are correct', () => { + cy.request('GET', 'systemSettings').then((response) => { + // response.body is automatically serialized into JSON + cy.log('response.body', response.body) + // expect(response.body).to.have.property('name', 'Jane') // true + }) + }) }) From a1b3224c73a5f10dfcf94936fa1c3dccc28e1525 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Tue, 30 Apr 2024 15:01:00 +0200 Subject: [PATCH 03/18] chore: add user and sys settings check --- .github/workflows/e2e-smoke.yaml | 2 +- cypress/integration/smoke.cy.js | 19 +++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.github/workflows/e2e-smoke.yaml b/.github/workflows/e2e-smoke.yaml index 5307db978..a10cf9d39 100644 --- a/.github/workflows/e2e-smoke.yaml +++ b/.github/workflows/e2e-smoke.yaml @@ -98,7 +98,7 @@ jobs: - name: Run e2e smoke tests uses: cypress-io/github-action@v5 with: - spec: cypress/integration/spec1.cy.js + spec: cypress/integration/smoke.cy.js start: yarn d2-app-scripts start wait-on: 'http://localhost:3000' wait-on-timeout: 300 diff --git a/cypress/integration/smoke.cy.js b/cypress/integration/smoke.cy.js index bcdf5d04f..e355dac21 100644 --- a/cypress/integration/smoke.cy.js +++ b/cypress/integration/smoke.cy.js @@ -19,10 +19,21 @@ describe('Smoke Test', () => { }) it('system and user settings are correct', () => { - cy.request('GET', 'systemSettings').then((response) => { - // response.body is automatically serialized into JSON - cy.log('response.body', response.body) - // expect(response.body).to.have.property('name', 'Jane') // true + cy.intercept('**userSettings**').as('userSettings') + cy.intercept('**systemSettings**').as('systemSettings') + goToStartPage() + cy.wait('@userSettings').then((interception) => { + cy.log('userSettings', interception.response.body) + expect(interception.response.body.keyUiLocale).to.equal('en') + expect( + interception.response.body.keyAnalysisDisplayProperty + ).to.equal('name') + }) + cy.wait('@systemSettings').then((interception) => { + cy.log('systemsettings', interception.response.body) + expect( + interception.response.body.keyAnalysisRelativePeriod + ).to.equal('LAST_12_MONTHS') }) }) }) From 945114626531e93fc22feaa1d6fa43b3255f06ca Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Tue, 30 Apr 2024 16:14:10 +0200 Subject: [PATCH 04/18] chore: try adding a step to e2e-prod --- .github/workflows/dhis2-verify-app.yml | 24 ++-- .github/workflows/e2e-prod.yml | 150 +++++++++++++++++++++++++ 2 files changed, 163 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/e2e-prod.yml diff --git a/.github/workflows/dhis2-verify-app.yml b/.github/workflows/dhis2-verify-app.yml index 4317fd048..02e9d1a64 100644 --- a/.github/workflows/dhis2-verify-app.yml +++ b/.github/workflows/dhis2-verify-app.yml @@ -83,20 +83,22 @@ jobs: BRANCH_NAME: ${{ github.head_ref || github.ref_name }} PR_TITLE: ${{ github.event_name == 'pull_request' && github.event.pull_request.title || format('Direct push to {0}', github.ref_name) }} - call-workflow-e2e-smoke: - if: "!contains(github.event.head_commit.message, '[skip ci]')" - needs: [build, lint, test] - uses: ./.github/workflows/e2e-smoke.yaml - with: - should_record: ${{ contains(github.event.head_commit.message, '[e2e record]') || contains(join(github.event.pull_request.labels.*.name), 'e2e record')}} - secrets: - username: ${{ secrets.CYPRESS_DHIS2_USERNAME }} - password: ${{ secrets.CYPRESS_DHIS2_PASSWORD }} + # call-workflow-e2e-smoke: + # if: "!contains(github.event.head_commit.message, '[skip ci]')" + # needs: [build, lint, test] + # uses: ./.github/workflows/e2e-smoke.yaml + # with: + # should_record: false + # secrets: + # username: ${{ secrets.CYPRESS_DHIS2_USERNAME }} + # password: ${{ secrets.CYPRESS_DHIS2_PASSWORD }} call-workflow-e2e-prod: if: "!contains(github.event.head_commit.message, '[skip ci]')" - needs: [call-workflow-e2e-smoke] - uses: dhis2/workflows/.github/workflows/analytics-e2e-tests-prod.yml@master + # needs: [call-workflow-e2e-smoke] + # uses: dhis2/workflows/.github/workflows/analytics-e2e-tests-prod.yml@master + needs: [build, lint, test] + uses: ./.github/workflows/e2e-prod.yml with: should_record: ${{ contains(github.event.head_commit.message, '[e2e record]') || contains(join(github.event.pull_request.labels.*.name), 'e2e record')}} secrets: diff --git a/.github/workflows/e2e-prod.yml b/.github/workflows/e2e-prod.yml new file mode 100644 index 000000000..7faef287c --- /dev/null +++ b/.github/workflows/e2e-prod.yml @@ -0,0 +1,150 @@ +name: 'e2e-prod' + +# Requirements: +# +# - Customize environment variables: +# BASE_URL_INSTANCES: Set the base url for the instances, e.g. https://test.e2e.dhis2.org +# NAME_PATTERN_PROD_INSTANCES: Set the name pattern for your instances. {version} will be replaced by "[majorVersion].[minorVersion]" +# +# - Other optional customizations: +# containers: Set the matrix containers array for the e2e-prod job. The number of parallel Cypress instances running for each backend version will equal the array length. +# +# - Set status check as required: +# We recommend setting "e2e-tests-success" as a required step in your workflow. + +on: + workflow_call: + inputs: + should_record: + required: false + type: boolean + default: false + secrets: + username: + required: true + password: + required: true + recordkey: + required: true + reportportal_api_key: + required: false + reportportal_endpoint: + required: false + reportportal_project: + required: false + +env: + BASE_URL_INSTANCES: https://test.e2e.dhis2.org + NAME_PATTERN_PROD_INSTANCES: 'analytics-{version}' + +concurrency: + group: e2e-prod-${{ github.workflow}}-${{ github.ref }} + cancel-in-progress: true + +defaults: + run: + shell: bash + +jobs: + compute-prod-versions: + runs-on: ubuntu-latest + outputs: + versions: ${{ steps.prod-versions.outputs.versions }} + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Output prod version urls + id: prod-versions + uses: dhis2/action-supported-legacy-versions@v1 + with: + instance-url-latest: https://test.e2e.dhis2.org/analytics-dev # can be removed if maxDHIS2Version has been specified + username: ${{ secrets.username }} + password: ${{ secrets.password }} + + e2e-prod: + needs: compute-prod-versions + runs-on: ubuntu-latest + env: + CI_BUILD_ID: ${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }} + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + PR_TITLE: ${{ github.event.pull_request.title }} + DHIS2_VERSION: ${{ matrix.versions }} + strategy: + fail-fast: false + matrix: + versions: ${{ fromJSON(needs.compute-prod-versions.outputs.versions) }} + containers: [1, 2, 3, 4] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18.x + - uses: browser-actions/setup-chrome@v1 + with: + chrome-version: stable + - run: | + echo "BROWSER_PATH=$(which chrome)" >> $GITHUB_ENV + + - name: Compute prod instance url + id: instance-url + run: | + url=${BASE_URL_INSTANCES%/}/${NAME_PATTERN_PROD_INSTANCES/"{version}"/$version} + echo "url=$url" >> $GITHUB_OUTPUT + echo "url: $url" + env: + version: ${{ matrix.versions }} + + - name: Run e2e smoke tests + uses: cypress-io/github-action@v5 + with: + spec: cypress/integration/smoke.cy.js + start: yarn d2-app-scripts start + wait-on: 'http://localhost:3000' + wait-on-timeout: 300 + record: false + parallel: false + browser: chrome + env: + CI: true + BROWSER: none + CYPRESS_dhis2BaseUrl: ${{ steps.instance-url.outputs.url }} + CYPRESS_dhis2InstanceVersion: ${{matrix.versions}} + CYPRESS_dhis2Username: ${{ secrets.username }} + CYPRESS_dhis2Password: ${{ secrets.password }} + CYPRESS_networkMode: live + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Run e2e tests + uses: cypress-io/github-action@v5 + with: + start: yarn d2-app-scripts start + wait-on: 'http://localhost:3000' + wait-on-timeout: 300 + record: ${{ inputs.should_record }} + parallel: ${{ inputs.should_record }} + browser: chrome + group: ${{ inputs.should_record && format('e2e-chrome-parallel-{0}', matrix.versions) }} + ci-build-id: ${{ inputs.should_record && github.run_id }} + env: + CI: true + BROWSER: none + CYPRESS_RECORD_KEY: ${{ secrets.recordkey }} + CYPRESS_dhis2BaseUrl: ${{ steps.instance-url.outputs.url }} + CYPRESS_dhis2InstanceVersion: ${{matrix.versions}} + CYPRESS_dhis2Username: ${{ secrets.username }} + CYPRESS_dhis2Password: ${{ secrets.password }} + CYPRESS_networkMode: live + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + REPORTPORTAL_API_KEY: ${{ secrets.reportportal_api_key }} + REPORTPORTAL_ENDPOINT: ${{ secrets.reportportal_endpoint }} + REPORTPORTAL_PROJECT: ${{ secrets.reportportal_project }} + + e2e-tests-success: + needs: e2e-prod + if: ${{ success() || failure() }} + runs-on: ubuntu-latest + steps: + - run: if [ $result != 'success' ]; then exit 1; fi; + env: + result: ${{ needs.e2e-prod.result }} From 828a17b8f120d12b4aca7280880b8c80ab313b4a Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Tue, 30 Apr 2024 16:37:51 +0200 Subject: [PATCH 05/18] chore: make test fail --- cypress/integration/smoke.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/integration/smoke.cy.js b/cypress/integration/smoke.cy.js index e355dac21..55637e4b6 100644 --- a/cypress/integration/smoke.cy.js +++ b/cypress/integration/smoke.cy.js @@ -33,7 +33,7 @@ describe('Smoke Test', () => { cy.log('systemsettings', interception.response.body) expect( interception.response.body.keyAnalysisRelativePeriod - ).to.equal('LAST_12_MONTHS') + ).to.equal('LAST_6_MONTHS') }) }) }) From ef537f0382cd4ee315860c6a9e23ffc59cb09e94 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Tue, 30 Apr 2024 17:21:32 +0200 Subject: [PATCH 06/18] chore: make test pass --- .github/workflows/dhis2-verify-app.yml | 12 --- .github/workflows/e2e-smoke.yaml | 131 ------------------------- cypress/integration/smoke.cy.js | 2 +- 3 files changed, 1 insertion(+), 144 deletions(-) delete mode 100644 .github/workflows/e2e-smoke.yaml diff --git a/.github/workflows/dhis2-verify-app.yml b/.github/workflows/dhis2-verify-app.yml index 02e9d1a64..d268dc443 100644 --- a/.github/workflows/dhis2-verify-app.yml +++ b/.github/workflows/dhis2-verify-app.yml @@ -83,20 +83,8 @@ jobs: BRANCH_NAME: ${{ github.head_ref || github.ref_name }} PR_TITLE: ${{ github.event_name == 'pull_request' && github.event.pull_request.title || format('Direct push to {0}', github.ref_name) }} - # call-workflow-e2e-smoke: - # if: "!contains(github.event.head_commit.message, '[skip ci]')" - # needs: [build, lint, test] - # uses: ./.github/workflows/e2e-smoke.yaml - # with: - # should_record: false - # secrets: - # username: ${{ secrets.CYPRESS_DHIS2_USERNAME }} - # password: ${{ secrets.CYPRESS_DHIS2_PASSWORD }} - call-workflow-e2e-prod: if: "!contains(github.event.head_commit.message, '[skip ci]')" - # needs: [call-workflow-e2e-smoke] - # uses: dhis2/workflows/.github/workflows/analytics-e2e-tests-prod.yml@master needs: [build, lint, test] uses: ./.github/workflows/e2e-prod.yml with: diff --git a/.github/workflows/e2e-smoke.yaml b/.github/workflows/e2e-smoke.yaml deleted file mode 100644 index a10cf9d39..000000000 --- a/.github/workflows/e2e-smoke.yaml +++ /dev/null @@ -1,131 +0,0 @@ -name: 'e2e-prod' - -# Requirements: -# -# - Customize environment variables: -# BASE_URL_INSTANCES: Set the base url for the instances, e.g. https://test.e2e.dhis2.org -# NAME_PATTERN_PROD_INSTANCES: Set the name pattern for your instances. {version} will be replaced by "[majorVersion].[minorVersion]" -# -# - Other optional customizations: -# containers: Set the matrix containers array for the e2e-prod job. The number of parallel Cypress instances running for each backend version will equal the array length. -# -# - Set status check as required: -# We recommend setting "e2e-tests-success" as a required step in your workflow. - -on: - workflow_call: - inputs: - should_record: - required: false - type: boolean - default: false - secrets: - username: - required: true - password: - required: true - # recordkey: - # required: true - # reportportal_api_key: - # required: false - # reportportal_endpoint: - # required: false - # reportportal_project: - # required: false - -env: - BASE_URL_INSTANCES: https://test.e2e.dhis2.org - NAME_PATTERN_PROD_INSTANCES: 'analytics-{version}' - -concurrency: - group: e2e-prod-${{ github.workflow}}-${{ github.ref }} - cancel-in-progress: true - -defaults: - run: - shell: bash - -jobs: - compute-prod-versions: - runs-on: ubuntu-latest - outputs: - versions: ${{ steps.prod-versions.outputs.versions }} - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Output prod version urls - id: prod-versions - uses: dhis2/action-supported-legacy-versions@v1 - with: - instance-url-latest: https://test.e2e.dhis2.org/analytics-dev # can be removed if maxDHIS2Version has been specified - username: ${{ secrets.username }} - password: ${{ secrets.password }} - - e2e-smoke-tests: - needs: compute-prod-versions - runs-on: ubuntu-latest - env: - CI_BUILD_ID: ${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }} - BRANCH_NAME: ${{ github.head_ref || github.ref_name }} - PR_TITLE: ${{ github.event.pull_request.title }} - DHIS2_VERSION: ${{ matrix.versions }} - strategy: - fail-fast: false - matrix: - versions: ${{ fromJSON(needs.compute-prod-versions.outputs.versions) }} - containers: [1, 2, 3, 4] - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 18.x - - uses: browser-actions/setup-chrome@v1 - with: - chrome-version: stable - - run: | - echo "BROWSER_PATH=$(which chrome)" >> $GITHUB_ENV - - - name: Compute prod instance url - id: instance-url - run: | - url=${BASE_URL_INSTANCES%/}/${NAME_PATTERN_PROD_INSTANCES/"{version}"/$version} - echo "url=$url" >> $GITHUB_OUTPUT - echo "url: $url" - env: - version: ${{ matrix.versions }} - - - name: Run e2e smoke tests - uses: cypress-io/github-action@v5 - with: - spec: cypress/integration/smoke.cy.js - start: yarn d2-app-scripts start - wait-on: 'http://localhost:3000' - wait-on-timeout: 300 - record: ${{ inputs.should_record }} - parallel: ${{ inputs.should_record }} - browser: chrome - group: ${{ inputs.should_record && format('e2e-chrome-parallel-{0}', matrix.versions) }} - ci-build-id: ${{ inputs.should_record && github.run_id }} - env: - CI: true - BROWSER: none - CYPRESS_RECORD_KEY: ${{ secrets.recordkey }} - CYPRESS_dhis2BaseUrl: ${{ steps.instance-url.outputs.url }} - CYPRESS_dhis2InstanceVersion: ${{matrix.versions}} - CYPRESS_dhis2Username: ${{ secrets.username }} - CYPRESS_dhis2Password: ${{ secrets.password }} - CYPRESS_networkMode: live - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # REPORTPORTAL_API_KEY: ${{ secrets.reportportal_api_key }} - # REPORTPORTAL_ENDPOINT: ${{ secrets.reportportal_endpoint }} - # REPORTPORTAL_PROJECT: ${{ secrets.reportportal_project }} - - e2e-smoke-success: - needs: e2e-smoke-tests - if: ${{ success() || failure() }} - runs-on: ubuntu-latest - steps: - - run: if [ $result != 'success' ]; then exit 1; fi; - env: - result: ${{ needs.e2e-smoke-tests.result }} diff --git a/cypress/integration/smoke.cy.js b/cypress/integration/smoke.cy.js index 55637e4b6..e355dac21 100644 --- a/cypress/integration/smoke.cy.js +++ b/cypress/integration/smoke.cy.js @@ -33,7 +33,7 @@ describe('Smoke Test', () => { cy.log('systemsettings', interception.response.body) expect( interception.response.body.keyAnalysisRelativePeriod - ).to.equal('LAST_6_MONTHS') + ).to.equal('LAST_12_MONTHS') }) }) }) From fe29545e0a7f6a38a8ff5b0460ecb4376f9ea1c3 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Thu, 2 May 2024 10:12:45 +0200 Subject: [PATCH 07/18] chore: consolidate to 2 tests and insert failure for testing --- cypress/integration/smoke.cy.js | 34 ++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/cypress/integration/smoke.cy.js b/cypress/integration/smoke.cy.js index e355dac21..145518f1e 100644 --- a/cypress/integration/smoke.cy.js +++ b/cypress/integration/smoke.cy.js @@ -4,24 +4,12 @@ import { goToStartPage } from '../helpers/startScreen.js' import { EXTENDED_TIMEOUT } from '../support/util.js' describe('Smoke Test', () => { - it('loads', () => { - goToStartPage() - cy.contains('Getting started', EXTENDED_TIMEOUT).should('be.visible') - cy.title().should('equal', 'Line Listing | DHIS2') - }) - - it('loads with visualization id', () => { - goToAO(TEST_AO.id) - - cy.getBySel('titlebar', EXTENDED_TIMEOUT) - .should('be.visible') - .and('contain', TEST_AO.name) - }) - - it('system and user settings are correct', () => { + it('app loads with correct system and user settings', () => { cy.intercept('**userSettings**').as('userSettings') cy.intercept('**systemSettings**').as('systemSettings') + goToStartPage() + cy.log('Check user settings') cy.wait('@userSettings').then((interception) => { cy.log('userSettings', interception.response.body) expect(interception.response.body.keyUiLocale).to.equal('en') @@ -29,11 +17,27 @@ describe('Smoke Test', () => { interception.response.body.keyAnalysisDisplayProperty ).to.equal('name') }) + cy.log('Check system settings') cy.wait('@systemSettings').then((interception) => { cy.log('systemsettings', interception.response.body) expect( interception.response.body.keyAnalysisRelativePeriod ).to.equal('LAST_12_MONTHS') + expect( + interception.response.body.keyAnalysisDigitGroupSeparator + ).to.equal('COMMA') }) + + cy.log('Check app is loaded') + cy.contains('Getting started', EXTENDED_TIMEOUT).should('be.visible') + cy.title().should('equal', 'Line Listing | DHIS2') + }) + + it('loads with visualization id', () => { + goToAO(TEST_AO.id) + + cy.getBySel('titlebar', EXTENDED_TIMEOUT) + .should('be.visible') + .and('contain', TEST_AO.name) }) }) From d7602247f15c7bcb4b3256c009ef46d65d7b2413 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Thu, 2 May 2024 10:48:32 +0200 Subject: [PATCH 08/18] chore: fix broken test --- cypress/integration/smoke.cy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cypress/integration/smoke.cy.js b/cypress/integration/smoke.cy.js index 145518f1e..305385a9d 100644 --- a/cypress/integration/smoke.cy.js +++ b/cypress/integration/smoke.cy.js @@ -25,7 +25,7 @@ describe('Smoke Test', () => { ).to.equal('LAST_12_MONTHS') expect( interception.response.body.keyAnalysisDigitGroupSeparator - ).to.equal('COMMA') + ).to.equal('SPACE') }) cy.log('Check app is loaded') From 42638c374cc754437a5a0b0a444213dd681e72de Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Thu, 2 May 2024 12:53:06 +0200 Subject: [PATCH 09/18] chore: additional checks for analytics request --- cypress/integration/smoke.cy.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cypress/integration/smoke.cy.js b/cypress/integration/smoke.cy.js index 305385a9d..a79e3e2c7 100644 --- a/cypress/integration/smoke.cy.js +++ b/cypress/integration/smoke.cy.js @@ -34,10 +34,23 @@ describe('Smoke Test', () => { }) it('loads with visualization id', () => { + cy.intercept('**/api/*/analytics/**').as('getAnalytics') goToAO(TEST_AO.id) + cy.wait('@getAnalytics').then((interception) => { + cy.log('analytics', interception.response) + expect(interception.response.status).to.equal(200) + expect(interception.response.body.rows).to.be.an('array') + }) + cy.getBySel('titlebar', EXTENDED_TIMEOUT) .should('be.visible') .and('contain', TEST_AO.name) + + cy.getBySel('line-list-table') + .findBySel('table-body') + .find('tr') + .its('length') + .should('be.gte', 0) }) }) From aea09c749bb252802ca849a5e6bf01a7879752fe Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Fri, 3 May 2024 13:28:20 +0200 Subject: [PATCH 10/18] chore: statusCode not status --- cypress/integration/smoke.cy.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cypress/integration/smoke.cy.js b/cypress/integration/smoke.cy.js index a79e3e2c7..421a7279b 100644 --- a/cypress/integration/smoke.cy.js +++ b/cypress/integration/smoke.cy.js @@ -38,8 +38,7 @@ describe('Smoke Test', () => { goToAO(TEST_AO.id) cy.wait('@getAnalytics').then((interception) => { - cy.log('analytics', interception.response) - expect(interception.response.status).to.equal(200) + expect(interception.response.statusCode).to.equal(200) expect(interception.response.body.rows).to.be.an('array') }) From ce4a7127a7381dbf4eb9ec7a4e48693666418956 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Mon, 6 May 2024 14:11:22 +0200 Subject: [PATCH 11/18] fix: record cypress [e2e record] From 08cef8d60841c967282b338ab67d5ce7accac64b Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Mon, 6 May 2024 15:07:17 +0200 Subject: [PATCH 12/18] chore: remove smoke test to see if it is the culprit --- .github/workflows/e2e-prod.yml | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/.github/workflows/e2e-prod.yml b/.github/workflows/e2e-prod.yml index 7faef287c..63ddfaa1b 100644 --- a/.github/workflows/e2e-prod.yml +++ b/.github/workflows/e2e-prod.yml @@ -95,26 +95,6 @@ jobs: env: version: ${{ matrix.versions }} - - name: Run e2e smoke tests - uses: cypress-io/github-action@v5 - with: - spec: cypress/integration/smoke.cy.js - start: yarn d2-app-scripts start - wait-on: 'http://localhost:3000' - wait-on-timeout: 300 - record: false - parallel: false - browser: chrome - env: - CI: true - BROWSER: none - CYPRESS_dhis2BaseUrl: ${{ steps.instance-url.outputs.url }} - CYPRESS_dhis2InstanceVersion: ${{matrix.versions}} - CYPRESS_dhis2Username: ${{ secrets.username }} - CYPRESS_dhis2Password: ${{ secrets.password }} - CYPRESS_networkMode: live - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Run e2e tests uses: cypress-io/github-action@v5 with: From 5aa763719dc9a5074ebb88adb55dd298e4b59695 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Mon, 6 May 2024 16:05:13 +0200 Subject: [PATCH 13/18] chore: add smoke tests in again --- .github/workflows/e2e-prod.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/e2e-prod.yml b/.github/workflows/e2e-prod.yml index 63ddfaa1b..7faef287c 100644 --- a/.github/workflows/e2e-prod.yml +++ b/.github/workflows/e2e-prod.yml @@ -95,6 +95,26 @@ jobs: env: version: ${{ matrix.versions }} + - name: Run e2e smoke tests + uses: cypress-io/github-action@v5 + with: + spec: cypress/integration/smoke.cy.js + start: yarn d2-app-scripts start + wait-on: 'http://localhost:3000' + wait-on-timeout: 300 + record: false + parallel: false + browser: chrome + env: + CI: true + BROWSER: none + CYPRESS_dhis2BaseUrl: ${{ steps.instance-url.outputs.url }} + CYPRESS_dhis2InstanceVersion: ${{matrix.versions}} + CYPRESS_dhis2Username: ${{ secrets.username }} + CYPRESS_dhis2Password: ${{ secrets.password }} + CYPRESS_networkMode: live + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Run e2e tests uses: cypress-io/github-action@v5 with: From 0ef8746a4cc694a7b3de7db8fe1b1a65b1f016a1 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Wed, 8 May 2024 14:51:55 +0200 Subject: [PATCH 14/18] chore: try using different gh jobs --- .github/workflows/dhis2-verify-app.yml | 14 ++- .github/workflows/e2e-smoke.yml | 119 +++++++++++++++++++++++++ 2 files changed, 131 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/e2e-smoke.yml diff --git a/.github/workflows/dhis2-verify-app.yml b/.github/workflows/dhis2-verify-app.yml index d268dc443..a5ab02954 100644 --- a/.github/workflows/dhis2-verify-app.yml +++ b/.github/workflows/dhis2-verify-app.yml @@ -83,10 +83,20 @@ jobs: BRANCH_NAME: ${{ github.head_ref || github.ref_name }} PR_TITLE: ${{ github.event_name == 'pull_request' && github.event.pull_request.title || format('Direct push to {0}', github.ref_name) }} - call-workflow-e2e-prod: + call-workflow-e2e-smoke: if: "!contains(github.event.head_commit.message, '[skip ci]')" needs: [build, lint, test] - uses: ./.github/workflows/e2e-prod.yml + uses: ./.github/workflows/e2e-smoke.yaml + with: + should_record: false + secrets: + username: ${{ secrets.CYPRESS_DHIS2_USERNAME }} + password: ${{ secrets.CYPRESS_DHIS2_PASSWORD }} + + call-workflow-e2e-prod: + if: "!contains(github.event.head_commit.message, '[skip ci]')" + needs: [call-workflow-e2e-smoke] + uses: dhis2/workflows/.github/workflows/analytics-e2e-tests-prod.yml@master with: should_record: ${{ contains(github.event.head_commit.message, '[e2e record]') || contains(join(github.event.pull_request.labels.*.name), 'e2e record')}} secrets: diff --git a/.github/workflows/e2e-smoke.yml b/.github/workflows/e2e-smoke.yml new file mode 100644 index 000000000..502ba53d6 --- /dev/null +++ b/.github/workflows/e2e-smoke.yml @@ -0,0 +1,119 @@ +name: 'e2e-smoke' + +# Requirements: +# +# - Customize environment variables: +# BASE_URL_INSTANCES: Set the base url for the instances, e.g. https://test.e2e.dhis2.org +# NAME_PATTERN_PROD_INSTANCES: Set the name pattern for your instances. {version} will be replaced by "[majorVersion].[minorVersion]" +# +# - Other optional customizations: +# containers: Set the matrix containers array for the e2e-prod job. The number of parallel Cypress instances running for each backend version will equal the array length. +# +# - Set status check as required: +# We recommend setting "e2e-tests-success" as a required step in your workflow. + +on: + workflow_call: + inputs: + should_record: + required: false + type: boolean + default: false + secrets: + username: + required: true + password: + required: true + +env: + BASE_URL_INSTANCES: https://test.e2e.dhis2.org + NAME_PATTERN_PROD_INSTANCES: 'analytics-{version}' + +concurrency: + group: e2e-smoke-${{ github.workflow}}-${{ github.ref }} + cancel-in-progress: true + +defaults: + run: + shell: bash + +jobs: + compute-prod-versions: + runs-on: ubuntu-latest + outputs: + versions: ${{ steps.prod-versions.outputs.versions }} + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Output prod version urls + id: prod-versions + uses: dhis2/action-supported-legacy-versions@v1 + with: + instance-url-latest: https://test.e2e.dhis2.org/analytics-dev # can be removed if maxDHIS2Version has been specified + username: ${{ secrets.username }} + password: ${{ secrets.password }} + + e2e-smoke-tests: + needs: compute-prod-versions + runs-on: ubuntu-latest + env: + CI_BUILD_ID: ${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }} + BRANCH_NAME: ${{ github.head_ref || github.ref_name }} + PR_TITLE: ${{ github.event.pull_request.title }} + DHIS2_VERSION: ${{ matrix.versions }} + strategy: + fail-fast: false + matrix: + versions: ${{ fromJSON(needs.compute-prod-versions.outputs.versions) }} + containers: [1, 2, 3, 4] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: 18.x + - uses: browser-actions/setup-chrome@v1 + with: + chrome-version: stable + - run: | + echo "BROWSER_PATH=$(which chrome)" >> $GITHUB_ENV + - name: Compute prod instance url + id: instance-url + run: | + url=${BASE_URL_INSTANCES%/}/${NAME_PATTERN_PROD_INSTANCES/"{version}"/$version} + echo "url=$url" >> $GITHUB_OUTPUT + echo "url: $url" + env: + version: ${{ matrix.versions }} + + - name: Run e2e smoke tests + uses: cypress-io/github-action@v5 + with: + spec: cypress/integration/smoke.cy.js + start: yarn d2-app-scripts start + wait-on: 'http://localhost:3000' + wait-on-timeout: 300 + record: false + parallel: false + browser: chrome + # group: ${{ inputs.should_record && format('e2e-chrome-parallel-{0}', matrix.versions) }} + # ci-build-id: ${{ inputs.should_record && github.run_id }} + env: + CI: true + BROWSER: none + CYPRESS_RECORD_KEY: ${{ secrets.recordkey }} + CYPRESS_dhis2BaseUrl: ${{ steps.instance-url.outputs.url }} + CYPRESS_dhis2InstanceVersion: ${{matrix.versions}} + CYPRESS_dhis2Username: ${{ secrets.username }} + CYPRESS_dhis2Password: ${{ secrets.password }} + CYPRESS_networkMode: live + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + e2e-smoke-success: + needs: e2e-smoke-tests + if: ${{ success() || failure() }} + runs-on: ubuntu-latest + steps: + - run: if [ $result != 'success' ]; then exit 1; fi; + env: + result: ${{ needs.e2e-smoke-tests.result }} From 25f66c94e8558a4a9cbc0a3e2845bf157ee92bbd Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Wed, 8 May 2024 15:12:57 +0200 Subject: [PATCH 15/18] chore: wrong filename --- .github/workflows/dhis2-verify-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dhis2-verify-app.yml b/.github/workflows/dhis2-verify-app.yml index a5ab02954..d79fea6f5 100644 --- a/.github/workflows/dhis2-verify-app.yml +++ b/.github/workflows/dhis2-verify-app.yml @@ -86,7 +86,7 @@ jobs: call-workflow-e2e-smoke: if: "!contains(github.event.head_commit.message, '[skip ci]')" needs: [build, lint, test] - uses: ./.github/workflows/e2e-smoke.yaml + uses: ./.github/workflows/e2e-smoke.yml with: should_record: false secrets: From d700aa36e7d78e4ccdbcb0f72f6c4eb122972146 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Wed, 8 May 2024 15:19:44 +0200 Subject: [PATCH 16/18] chore: lint --- .github/workflows/e2e-smoke.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/e2e-smoke.yml b/.github/workflows/e2e-smoke.yml index 502ba53d6..d979bc51b 100644 --- a/.github/workflows/e2e-smoke.yml +++ b/.github/workflows/e2e-smoke.yml @@ -96,8 +96,6 @@ jobs: record: false parallel: false browser: chrome - # group: ${{ inputs.should_record && format('e2e-chrome-parallel-{0}', matrix.versions) }} - # ci-build-id: ${{ inputs.should_record && github.run_id }} env: CI: true BROWSER: none From 4e479755e61de197561e453cf96a834d8b49fd5d Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Wed, 8 May 2024 15:32:24 +0200 Subject: [PATCH 17/18] chore: only 1 container needed for smoke tests --- .github/workflows/e2e-smoke.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/e2e-smoke.yml b/.github/workflows/e2e-smoke.yml index d979bc51b..1640ef379 100644 --- a/.github/workflows/e2e-smoke.yml +++ b/.github/workflows/e2e-smoke.yml @@ -66,7 +66,7 @@ jobs: fail-fast: false matrix: versions: ${{ fromJSON(needs.compute-prod-versions.outputs.versions) }} - containers: [1, 2, 3, 4] + containers: [1] steps: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 From c0b97c7d58b05a84c6f56be5dc1e05dda2477180 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Mon, 13 May 2024 10:37:14 +0200 Subject: [PATCH 18/18] chore: not needed --- .github/workflows/e2e-prod.yml | 150 --------------------------------- 1 file changed, 150 deletions(-) delete mode 100644 .github/workflows/e2e-prod.yml diff --git a/.github/workflows/e2e-prod.yml b/.github/workflows/e2e-prod.yml deleted file mode 100644 index 7faef287c..000000000 --- a/.github/workflows/e2e-prod.yml +++ /dev/null @@ -1,150 +0,0 @@ -name: 'e2e-prod' - -# Requirements: -# -# - Customize environment variables: -# BASE_URL_INSTANCES: Set the base url for the instances, e.g. https://test.e2e.dhis2.org -# NAME_PATTERN_PROD_INSTANCES: Set the name pattern for your instances. {version} will be replaced by "[majorVersion].[minorVersion]" -# -# - Other optional customizations: -# containers: Set the matrix containers array for the e2e-prod job. The number of parallel Cypress instances running for each backend version will equal the array length. -# -# - Set status check as required: -# We recommend setting "e2e-tests-success" as a required step in your workflow. - -on: - workflow_call: - inputs: - should_record: - required: false - type: boolean - default: false - secrets: - username: - required: true - password: - required: true - recordkey: - required: true - reportportal_api_key: - required: false - reportportal_endpoint: - required: false - reportportal_project: - required: false - -env: - BASE_URL_INSTANCES: https://test.e2e.dhis2.org - NAME_PATTERN_PROD_INSTANCES: 'analytics-{version}' - -concurrency: - group: e2e-prod-${{ github.workflow}}-${{ github.ref }} - cancel-in-progress: true - -defaults: - run: - shell: bash - -jobs: - compute-prod-versions: - runs-on: ubuntu-latest - outputs: - versions: ${{ steps.prod-versions.outputs.versions }} - steps: - - name: Checkout - uses: actions/checkout@v3 - - - name: Output prod version urls - id: prod-versions - uses: dhis2/action-supported-legacy-versions@v1 - with: - instance-url-latest: https://test.e2e.dhis2.org/analytics-dev # can be removed if maxDHIS2Version has been specified - username: ${{ secrets.username }} - password: ${{ secrets.password }} - - e2e-prod: - needs: compute-prod-versions - runs-on: ubuntu-latest - env: - CI_BUILD_ID: ${{ github.sha }}-${{ github.workflow }}-${{ github.event_name }} - BRANCH_NAME: ${{ github.head_ref || github.ref_name }} - PR_TITLE: ${{ github.event.pull_request.title }} - DHIS2_VERSION: ${{ matrix.versions }} - strategy: - fail-fast: false - matrix: - versions: ${{ fromJSON(needs.compute-prod-versions.outputs.versions) }} - containers: [1, 2, 3, 4] - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: 18.x - - uses: browser-actions/setup-chrome@v1 - with: - chrome-version: stable - - run: | - echo "BROWSER_PATH=$(which chrome)" >> $GITHUB_ENV - - - name: Compute prod instance url - id: instance-url - run: | - url=${BASE_URL_INSTANCES%/}/${NAME_PATTERN_PROD_INSTANCES/"{version}"/$version} - echo "url=$url" >> $GITHUB_OUTPUT - echo "url: $url" - env: - version: ${{ matrix.versions }} - - - name: Run e2e smoke tests - uses: cypress-io/github-action@v5 - with: - spec: cypress/integration/smoke.cy.js - start: yarn d2-app-scripts start - wait-on: 'http://localhost:3000' - wait-on-timeout: 300 - record: false - parallel: false - browser: chrome - env: - CI: true - BROWSER: none - CYPRESS_dhis2BaseUrl: ${{ steps.instance-url.outputs.url }} - CYPRESS_dhis2InstanceVersion: ${{matrix.versions}} - CYPRESS_dhis2Username: ${{ secrets.username }} - CYPRESS_dhis2Password: ${{ secrets.password }} - CYPRESS_networkMode: live - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Run e2e tests - uses: cypress-io/github-action@v5 - with: - start: yarn d2-app-scripts start - wait-on: 'http://localhost:3000' - wait-on-timeout: 300 - record: ${{ inputs.should_record }} - parallel: ${{ inputs.should_record }} - browser: chrome - group: ${{ inputs.should_record && format('e2e-chrome-parallel-{0}', matrix.versions) }} - ci-build-id: ${{ inputs.should_record && github.run_id }} - env: - CI: true - BROWSER: none - CYPRESS_RECORD_KEY: ${{ secrets.recordkey }} - CYPRESS_dhis2BaseUrl: ${{ steps.instance-url.outputs.url }} - CYPRESS_dhis2InstanceVersion: ${{matrix.versions}} - CYPRESS_dhis2Username: ${{ secrets.username }} - CYPRESS_dhis2Password: ${{ secrets.password }} - CYPRESS_networkMode: live - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - REPORTPORTAL_API_KEY: ${{ secrets.reportportal_api_key }} - REPORTPORTAL_ENDPOINT: ${{ secrets.reportportal_endpoint }} - REPORTPORTAL_PROJECT: ${{ secrets.reportportal_project }} - - e2e-tests-success: - needs: e2e-prod - if: ${{ success() || failure() }} - runs-on: ubuntu-latest - steps: - - run: if [ $result != 'success' ]; then exit 1; fi; - env: - result: ${{ needs.e2e-prod.result }}