Bump playwright and @playwright/test #117
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Playwright Tests for Web Reader | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| test: | |
| name: Run tests | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version-file: '.nvmrc' | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Install Playwright Browsers | |
| run: npx playwright install --with-deps | |
| - name: Build app and run tests | |
| id: run-tests | |
| run: | | |
| npm run test:ci:integration > >(tee output.txt) | |
| continue-on-error: true | |
| - name: Test results # extracts test results between "failed" and "passed" | |
| id: test-results | |
| run: | | |
| output=$(cat output.txt) | |
| if [ -z "$extracted" ]; then | |
| extracted=$(perl -0777 -ne 'print $1 if /(\b\d{2,3}\sfailed.*?passed)/s' output.txt) | |
| fi | |
| echo "Test results: $extracted" | |
| echo "extracted<<EOF" >> $GITHUB_OUTPUT | |
| echo "$extracted" >> $GITHUB_OUTPUT | |
| echo "EOF" >> $GITHUB_OUTPUT | |
| - name: Set failure workflow status 🚨 | |
| if: steps.run-tests.outcome != 'success' | |
| run: exit 1 | |
| - name: Set successful workflow status ✅ | |
| if: steps.run-tests.outcome == 'success' | |
| run: exit 0 | |
| - name: Upload Playwright report | |
| uses: actions/upload-artifact@v4 | |
| if: ${{ !cancelled() }} | |
| with: | |
| name: playwright-report | |
| path: playwright-report/ | |
| retention-days: 30 |