Skip to content

Commit d3f873c

Browse files
committed
Add workflow for Playwright tests
1 parent e707402 commit d3f873c

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/playwright.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Playwright Tests
2+
#on:
3+
# pull_request:
4+
# branches:
5+
# - main
6+
jobs:
7+
playwright:
8+
timeout-minutes: 90
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-node@v4
13+
with:
14+
node-version: '20'
15+
- name: Install dependencies
16+
run: npm ci
17+
working-directory: ./playwright
18+
- name: Install Playwright browsers
19+
run: npx playwright install --with-deps
20+
working-directory: ./playwright
21+
- name: Create baseline screenshots
22+
run: npx playwright test --project=production --update-snapshots
23+
working-directory: ./playwright
24+
env:
25+
PROD_URL: ${{ vars.PROD_URL }}
26+
- name: Run Playwright tests
27+
continue-on-error: true
28+
run: npx playwright test --project=test
29+
working-directory: ./playwright
30+
env:
31+
TEST_URL: ${{ vars.TEST_URL }}
32+
TEST_USERNAME: ${{ secrets.TEST_USERNAME }}
33+
TEST_PASSWORD: ${{ secrets.TEST_PASSWORD }}
34+
- name: Upload HTML report
35+
if: always()
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: playwright-report
39+
path: playwright/playwright-report/
40+
retention-days: 30

0 commit comments

Comments
 (0)