Skip to content

Playwright Tests

Playwright Tests #11

Workflow file for this run

name: Playwright Tests
on:
pull_request:
branches: [main]
workflow_dispatch:
jobs:
setup:
runs-on: ubuntu-latest
outputs:
playwright-version: ${{ steps.get-version.outputs.playwright-version }}
steps:
- id: get-version
name: Get playwright version
run: |
version = npm list playwright --json | jq ".dependencies[].dependencies.playwright.version"
echo "playwright-version=${version}" >> $GITHUB_OUTPUT
test:
timeout-minutes: 5
strategy:
matrix:
playwright-image: 'mcr.microsoft.com/playwright:v${{ needs.setup.outputs.playwright-version }}-jammy'
runs-on: ubuntu-latest
needs: setup
container:
image: ${{matrix.playwright-image}}
env:
CI: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
- name: Install dependencies
run: npm ci
- name: Run Playwright tests
run: npx playwright test --project=ci
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30