diff --git a/.github/workflows/e2e-browser.yml b/.github/workflows/e2e-browser.yml new file mode 100644 index 0000000..e3a85e4 --- /dev/null +++ b/.github/workflows/e2e-browser.yml @@ -0,0 +1,58 @@ +name: End-to-end Tests (Browser) + +on: + push: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true +jobs: + e2e-browser: + # Ensure we timeout reasonably quickly: + timeout-minutes: 30 + runs-on: ${{ matrix.os }} + environment: + name: ${{ matrix.environment-name }} + continue-on-error: ${{ matrix.experimental }} + strategy: + matrix: + # Available OS's: https://help.github.com/en/actions/reference/virtual-environments-for-github-hosted-runners + os: [ubuntu-latest, windows-latest] + # PodSpaces doesn't support error descriptions yet. + environment-name: ["ESS Dev-2-3"] + experimental: [false] + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + cache: "npm" + cache-dependency-path: "**/package-lock.json" + # install + - run: npm ci --ignore-scripts + - run: npx playwright install --with-deps + # build + - run: npm run build + # setup + - run: npm run test:e2e:browser:build + # test + - # Dependabot cannot access secrets, so it doesn't have a token to authenticate to ESS. + # We want jobs in this workflow to be gating PRs, so the whole matrix must + # run even for dependabot so that the matrixed jobs are skipped, instead + # of the whole pipeline. + if: ${{ github.actor != 'dependabot[bot]' }} + run: npm run test:e2e:browser + env: + E2E_TEST_ENVIRONMENT: ${{ matrix.environment-name }} + E2E_TEST_POD: ${{ secrets.E2E_TEST_POD }} + E2E_TEST_IDP: ${{ secrets.E2E_TEST_IDP }} + E2E_TEST_USER: ${{ secrets.E2E_TEST_USER }} + E2E_TEST_PASSWORD: ${{ secrets.E2E_TEST_PASSWORD }} + - name: Archive browser-based end-to-end test request logs + uses: actions/upload-artifact@v4 + if: failure() + continue-on-error: true + with: + name: playwright-output + path: test-results/