Skip to content

Commit 5340cc1

Browse files
committed
fix: Added to pipeline to update snapshot
1 parent bfccb89 commit 5340cc1

File tree

2 files changed

+27
-12
lines changed

2 files changed

+27
-12
lines changed

.github/workflows/playwright.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ on:
1212
jobs:
1313
playwright:
1414
name: Run Playwright
15-
runs-on: macos-latest
15+
runs-on: ubuntu-latest
1616
steps:
1717
# Checkout the repository so the workflow has access to the code
1818
- name: Checkout code
@@ -27,16 +27,28 @@ jobs:
2727
- name: Install Playwright browsers
2828
run: npx playwright install --with-deps
2929
- name: Run Playwright tests
30+
id: test-visual
3031
run: make tests
3132
- uses: actions/upload-artifact@v4
32-
if: ${{ !cancelled() }}
33+
if: !cancelled() && failure() && steps.test-visual.conclusion == 'failure'
3334
with:
3435
name: playwright-report
3536
path: tests/playwright-report/
36-
retention-days: 30
37+
retention-days: 3
3738
- uses: actions/upload-artifact@v4
38-
if: ${{ !cancelled() }}
39+
if: !cancelled() && failure() && steps.test-visual.conclusion == 'failure'
3940
with:
4041
name: test-results
4142
path: tests/test-results/
42-
retention-days: 30
43+
retention-days: 3
44+
- name: Update the screenshots based on Ubuntu env on GH
45+
id: test-visual-update
46+
if: failure() && steps.test-visual.conclusion == 'failure'
47+
run: make tests-update-screenshots
48+
- name: Upload updated Playwright screenshots
49+
uses: actions/upload-artifact@v4
50+
if: failure() && steps.test-visual-update.conclusion == 'success'
51+
with:
52+
name: playwright-screenshots-updated
53+
path: tests/src/__screenshots__/**/*.png
54+
retention-days: 3

Makefile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,17 @@ WRITE_FLAG := --write
66
list help::
77
$(info Available Make targets:)
88
@echo "<COMMON>"
9-
@echo " list | help: Print these available make targets"
9+
@echo " list | help: Print these available make targets"
1010
@echo "<LINTING AND FORMATTING>"
11-
@echo " biome-format: Runs the biome formatter."
12-
@echo " biome-lint: Runs the biome linter."
13-
@echo " biome-all: Runs both the lint and formatting commands."
11+
@echo " biome-format: Runs the biome formatter."
12+
@echo " biome-lint: Runs the biome linter."
13+
@echo " biome-all: Runs both the lint and formatting commands."
1414
@echo " (Set BIOME_ARGS to add additional arguments to biome command (ex: make biome-all BIOME_ARGS=write))"
1515
@echo "<PRE-COMMIT>"
16-
@echo " setup-pre-commit: Sets up pre-commit (assuming it is installed)"
16+
@echo " setup-pre-commit: Sets up pre-commit (assuming it is installed)"
1717
@echo "<PLAYWRIGHT TESTS>"
18-
@echo " test: Runs playwright against the old theme."
18+
@echo " test: Runs playwright against the old theme."
19+
@echo " tests-update-screenshots: Runs playwright against the old theme."
1920

2021
.PHONY: biome-format biome-lint biome-all setup-pre-commit tests
2122
FLAG :=
@@ -41,4 +42,6 @@ setup-pre-commit:
4142
fi
4243

4344
tests:
44-
cd tests && npx playwright test
45+
cd tests && npx playwright test
46+
tests-update-screenshots:
47+
cd tests && npx playwright test --update-snapshots

0 commit comments

Comments
 (0)