From db74ddc47c7fa06bccfa7bf4ab18e5ea5c0bcfff Mon Sep 17 00:00:00 2001 From: Ken Kunz Date: Mon, 16 Dec 2024 08:17:58 -0600 Subject: [PATCH 1/3] add GH action step to check fonts (temp) --- .github/workflows/javascript.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/javascript.yml b/.github/workflows/javascript.yml index 7d42b66e9..3fd02cc19 100644 --- a/.github/workflows/javascript.yml +++ b/.github/workflows/javascript.yml @@ -48,6 +48,8 @@ jobs: run: npm ci - name: Setup submodules run: bash scripts/build-deps.sh + - name: Check fonts + run: ls -l static/fonts/NeueHaasGrotesk* - name: Install Playwright run: npx playwright install chromium --with-deps # use separate build step to avoid playwright timeout issue From b554301384b11292eabe99b4efde9878baa8d9ef Mon Sep 17 00:00:00 2001 From: Ken Kunz Date: Mon, 16 Dec 2024 09:47:09 -0600 Subject: [PATCH 2/3] upload playwright snapshot artifacts on test failure --- .github/workflows/javascript.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/javascript.yml b/.github/workflows/javascript.yml index 3fd02cc19..4b42db78e 100644 --- a/.github/workflows/javascript.yml +++ b/.github/workflows/javascript.yml @@ -48,8 +48,6 @@ jobs: run: npm ci - name: Setup submodules run: bash scripts/build-deps.sh - - name: Check fonts - run: ls -l static/fonts/NeueHaasGrotesk* - name: Install Playwright run: npx playwright install chromium --with-deps # use separate build step to avoid playwright timeout issue @@ -58,6 +56,16 @@ jobs: # skip build in test step - name: Run Tests run: npm run test --skip-build + - name: Upload Test Results + if: failure() + uses: actions/upload-artifact@v4 + with: + name: playwright-test-results + path: | + test-results/ + tests/integration/**/*-snapshots/ + retention-days: 7 + compression-level: 0 # Skip compression since PNGs are already compressed build: runs-on: ubuntu-latest From 6bcc6fbe21029c839495177a35b1e519e0a88b3c Mon Sep 17 00:00:00 2001 From: Ken Kunz Date: Mon, 16 Dec 2024 10:32:32 -0600 Subject: [PATCH 3/3] update snapshot assertion with maxDiffPixels --- tests/integration/index.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/index.test.ts b/tests/integration/index.test.ts index c07bf2037..261e5c758 100644 --- a/tests/integration/index.test.ts +++ b/tests/integration/index.test.ts @@ -10,7 +10,7 @@ test.describe('home page', () => { // $ ./scripts/update-test-screenshots.sh test('hero banner looks correct', async ({ page }) => { const header = page.getByTestId('home-hero-banner'); - await expect(header).toHaveScreenshot(); + await expect(header).toHaveScreenshot({ maxDiffPixels: 150 }); }); test('home page has impressive numbers', async ({ page }) => {