-
Notifications
You must be signed in to change notification settings - Fork 120
76 lines (64 loc) · 1.97 KB
/
test-playwright.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
name: Visual Regression Tests
on:
pull_request:
branches:
- patch
concurrency: ${{ github.workflow }}-${{ github.ref || github.run_id }}
jobs:
visual-tests:
name: Test for accordion --single
runs-on: macos-13
steps:
- name: Checkout Repo
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: Install Dependencies and build the project
run: |
yarn
yarn playwright install --with-deps
yarn build
- name: Create storybook build
run: |
cd example/storybook
yarn build-storybook
- name: Run test
run: |
cd example/storybook
yarn test:screenshot --accordion=single
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: example/storybook/playwright-report/
overwrite: true
retention-days: 10
- name: Download artifact
if: failure()
uses: actions/download-artifact@v2
with:
name: playwright-report
- name: Extract files
if: failure()
run: unzip playwright-report.zip
- name: Push to GitHub Pages
if: failure()
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./playwright-report
- name: Comment PR
if: failure()
uses: actions/github-script@v4
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const issueComment = `Playwright report is available [here](https://${{ github.repository }}.github.io/playwright-report/index.html)`
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: issueComment,
})