Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI

on:
pull_request:
branches:
- master
push:
branches:
- master

jobs:
build-and-e2e:
runs-on: ubuntu-latest
timeout-minutes: 25

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 22
cache: npm

- name: Install dependencies
run: npm ci

- name: Build
run: npm run build

- name: Install Playwright browser
run: npx playwright install --with-deps chromium

- name: Run integration tests
run: npm run test:e2e:ci

- name: Upload Playwright artifacts (failure only)
if: failure()
uses: actions/upload-artifact@v4
with:
name: playwright-artifacts
path: |
playwright-report
test-results
if-no-files-found: ignore
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@
"build": "vite build",
"preview": "vite preview",
"test:e2e": "playwright test",
"test:e2e:ci": "playwright test tests/odontogram.e2e.spec.js",
"test:e2e:headed": "playwright test --headed",
"test:e2e:ui": "playwright test --ui"
"test:e2e:ui": "playwright test --ui",
"screenshots:refresh": "CAPTURE_PR_SCREENSHOTS=1 playwright test tests/pr-screenshots.spec.js"
},
"repository": {
"type": "git",
Expand Down
5 changes: 5 additions & 0 deletions tests/pr-screenshots.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { test } from "@playwright/test";

test.skip(
!process.env.CAPTURE_PR_SCREENSHOTS,
"Utility test only used when refreshing PR screenshots.",
);

test("capture PR screenshots", async ({ page }) => {
await page.addInitScript(() => {
window.localStorage.clear();
Expand Down