diff --git a/.github/workflows/.tests.yml b/.github/workflows/.tests.yml deleted file mode 100644 index 03042531b..000000000 --- a/.github/workflows/.tests.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: Test Workflow - -on: - workflow_call: - inputs: - ### Required - target: - description: 'PR number, test or prod.' - required: true - type: string - -jobs: - integration-tests: - name: Integration Tests - runs-on: ubuntu-22.04 - timeout-minutes: 1 - steps: - - uses: actions/checkout@v4 - - id: cache-npm - uses: actions/cache@v4 - with: - path: ~/.npm - key: ${{ runner.os }}-build-cache-node-modules-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-cache-node-modules- - ${{ runner.os }}-build- - ${{ runner.os }}- - - - name: Integration tests - env: - API_NAME: nest - BASE_URL: https://${{ github.event.repository.name }}-${{ inputs.target }}-frontend.apps.silver.devops.gov.bc.ca - run: | - cd integration-tests - npm ci - node src/main.js - - cypress-e2e: - name: E2E Tests - runs-on: ubuntu-22.04 - defaults: - run: - working-directory: frontend - strategy: - matrix: - browser: [chrome, firefox, edge] - timeout-minutes: 5 - steps: - - uses: actions/checkout@v4 - - id: cache-npm - uses: actions/cache@v4 - with: - path: ~/.npm - key: ${{ runner.os }}-build-cache-node-modules-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-build-cache-node-modules- - ${{ runner.os }}-build- - ${{ runner.os }}- - - - uses: cypress-io/github-action@v6 - name: Cypress run - env: - CYPRESS_baseUrl: https://${{ github.event.repository.name }}-${{ inputs.target }}-frontend.apps.silver.devops.gov.bc.ca/ - with: - config: pageLoadTimeout=10000 - working-directory: ./frontend - browser: ${{ matrix.browser }} - - - uses: actions/upload-artifact@v4 - if: failure() - with: - name: cypress-screenshots - path: ./cypress/screenshots - if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn` diff --git a/.github/workflows/e2e-regression-tests.yml b/.github/workflows/e2e-regression-tests.yml new file mode 100644 index 000000000..c72c6b8df --- /dev/null +++ b/.github/workflows/e2e-regression-tests.yml @@ -0,0 +1,91 @@ +name: E2E Regression Tests + +on: + workflow_run: + workflows: ['PR Opened'] + types: [completed] + workflow_dispatch: + inputs: + ### Required + target: + description: 'PR number, test, uat or prod.' + default: 'test' + required: true + type: string + +jobs: + vars: + name: Set Variables + outputs: + target: ${{ steps.env.outputs.target }} + environment: ${{ steps.env.outputs.environment }} + runs-on: ubuntu-22.04 + steps: + - name: env + id: env + run: | + pr="${{github.event.workflow_run.pull_requests[0].number}}" + if [[pr]]; then + target="$pr" + environment="dev" + else + target=${{inputs.target}} + environment=${{inputs.target}} + fi + echo target=$target | tee $GITHUB_OUTPUT + echo environment=$environment | tee $GITHUB_OUTPUT + + ${{matrix.test}}: + name: ${{matrix.test}} + needs: [vars] + environment: ${{needs.vars.outputs.environment}} + runs-on: ubuntu-22.04 + defaults: + run: + working-directory: tests/ + strategy: + matrix: + browser: + - chrome + - edge + - firefox + test: + - 'bceid-crud-power-units.cy.js' + - 'bceid-crud-trailers.cy.js' + - 'bceid-new-term-oversize.cy.js' + - 'bceid-new-term-overweight.cy.js' + - 'bceid-update-term-oversize.cy.js' + - 'idir-amend-term-oversize.cy.js' + - 'idir-void-term-oversize.cy.js' + + timeout-minutes: 10 + steps: + - uses: actions/checkout@v4 + + - uses: cypress-io/github-action@v6.7.7 + name: Cypress run + env: + CYPRESS_baseUrl: https://${{ github.event.repository.name }}-${{ needs.vars.outputs.target || 'test' }}-frontend.apps.silver.devops.gov.bc.ca/ + CYPRESS_bceid_username: ${{vars.BCEID_USERNAME}} + CYPRESS_bceid_password: ${{secrets.BCEID_PASSWORD}} + with: + browser: ${{ matrix.browser }} + config: pageLoadTimeout=10000,video=true + spec: cypress/e2e/${{matrix.test}} + working-directory: tests + + - uses: actions/upload-artifact@v4 + if: always() + with: + name: ${{matrix.test}} screenshot + path: tests/cypress/screenshots/ + if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn` + + - uses: actions/upload-artifact@v4 + if: always() + with: + name: ${{matrix.test}} video + path: tests/cypress/videos/ + overwrite: true + if-no-files-found: ignore # 'warn' or 'error' are also available, defaults to `warn` + diff --git a/.github/workflows/experiment.yml b/.github/workflows/experiment.yml deleted file mode 100644 index 23b964858..000000000 --- a/.github/workflows/experiment.yml +++ /dev/null @@ -1,15 +0,0 @@ -on: - workflow_run: - workflows: ['PR Opened'] - types: [completed, requested] - branches: ["fix/loadtests9"] - -jobs: - on-success: - runs-on: ubuntu-latest - steps: - - run: | - echo "${{toJSON(github.event.workflow_run)}}" - echo "${{toJSON(github.event.workflow_run.pull_requests)}}" - echo "${{toJSON(github.event.workflow_run.pull_requests[0])}}" - echo "${{github.event.workflow_run.pull_requests[0].number}}" diff --git a/.github/workflows/notifications.yml b/.github/workflows/notifications.yml index 116e5c09a..baf93aa6c 100644 --- a/.github/workflows/notifications.yml +++ b/.github/workflows/notifications.yml @@ -1,7 +1,7 @@ name: Notifications on: workflow_run: - workflows: [PR,Merge] + workflows: ['PR Opened',Merge] types: - completed jobs: