Integrate Playwright for UI Testing #6
Workflow file for this run
This file contains 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 | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
jobs: | |
test: | |
timeout-minutes: 60 | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout the code under test | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
path: 'helioviewer.org' | |
- name: Checkout the latest Helioviewer API | |
uses: actions/checkout@v4 | |
with: | |
repository: 'Helioviewer-Project/api' | |
path: 'api' | |
# See https://github.com/actions/checkout?tab=readme-ov-file#fetch-only-a-single-file | |
- name: Checkout the Dockerfile for local Helioviewer | |
uses: actions/checkout@v4 | |
with: | |
repository: 'Helioviewer-Project/helioviewer.org-docker' | |
path: 'compose' | |
sparse-checkout: | | |
compose.yaml | |
sparse-checkout-cone-mode: false | |
- name: Print current directory | |
run: | | |
echo $(pwd) | |
echo $(ls) | |
- name: Start local Helioviewer environment | |
run: docker compose -f compose/compose.yaml up -d --wait | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: lts/* | |
- name: Install Playwright Browsers | |
run: npx playwright install --with-deps | |
- name: Install dependencies | |
run: | | |
cd helioviewer.org | |
npm ci | |
- name: Run Playwright tests | |
run: | | |
cd helioviewer.org | |
npx playwright test | |
- uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: playwright-report | |
path: helioviewer.org/playwright-report/ | |
retention-days: 30 |