From 2926d3bd5bc2f5232134bdde86e433b01a3d30b7 Mon Sep 17 00:00:00 2001 From: Nicolas Giard Date: Wed, 21 Sep 2022 15:36:07 -0400 Subject: [PATCH] ci: add playwright tests to PR checks --- .github/workflows/ci-run-tests.yml | 40 ++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-run-tests.yml b/.github/workflows/ci-run-tests.yml index 7fef30465..c65a527d4 100644 --- a/.github/workflows/ci-run-tests.yml +++ b/.github/workflows/ci-run-tests.yml @@ -10,8 +10,8 @@ on: - 'package.json' jobs: - tests: - name: Run Tests + tests-python: + name: Run Tests (Python) runs-on: ubuntu-latest container: ghcr.io/ietf-tools/datatracker-app-base:latest @@ -69,3 +69,39 @@ jobs: with: name: coverage path: coverage.json + + tests-playwright: + name: Run Tests (Playwright) + runs-on: macos-latest + strategy: + fail-fast: false + matrix: + project: [chromium, firefox] + + steps: + - uses: actions/checkout@v3 + + - uses: actions/setup-node@v2 + with: + node-version: '18' + + - name: Run all tests + run: | + echo "Installing dependencies..." + yarn + echo "Installing Playwright..." + cd playwright + mkdir test-results + npm ci + npx playwright install --with-deps ${{ matrix.project }} + echo "Running tests..." + npx playwright test --project=${{ matrix.project }} + + - name: Upload Report + uses: actions/upload-artifact@v3.0.0 + if: ${{ always() }} + continue-on-error: true + with: + name: playwright-results-${{ matrix.project }} + path: playwright/test-results/ + if-no-files-found: ignore