-
-
Notifications
You must be signed in to change notification settings - Fork 5
101 lines (95 loc) · 2.84 KB
/
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
name: Playwright Tests
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
setup:
name: Get Vercel preview url
runs-on: ubuntu-latest
outputs:
preview_url: ${{ steps.waitForVercelPreviewDeployment.outputs.url }}
steps:
- name: Wait for Vercel preview deployment to be ready
uses: patrickedqvist/wait-for-vercel-preview@v1.3.1
id: waitForVercelPreviewDeployment
with:
token: ${{ secrets.GITHUB_TOKEN }}
max_timeout: 300
test:
needs: setup
name: Run Playwright tests
timeout-minutes: 60
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Cache node modules
uses: actions/cache@v3
with:
path: node_modules
key: ${{ runner.OS }}-node-${{ hashFiles('client/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node-
- name: Install dependencies
working-directory: ./client
run: yarn
- name: Cache Playwright browsers
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright/
key: ${{ runner.OS }}-pw-browsers-${{ hashFiles('client/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-pw-browsers-
- name: Install Playwright Browsers
working-directory: ./client
run: yarn playwright install --with-deps
- name: Run Playwright tests
working-directory: ./client
run: yarn playwright test
env:
PLAYWRIGHT_TEST_BASE_URL: ${{ needs.setup.outputs.preview_url }}
TEST_USER_EMAIL: platica.ciprian+user@gmail.com
TEST_USER_PASSWORD: Hello12345
TEST_MENTOR_EMAIL: platica.ciprian+mentor@gmail.com
TEST_MENTOR_PASSWORD: Hello12345
TEST_ADMIN_EMAIL: platica.ciprian+admin@gmail.com
TEST_ADMIN_PASSWORD: Hello12345
- name: Upload Artifact
uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: client/playwright-report/
retention-days: 30
deploy:
needs: test
name: Deploy report to GitHub pages
if: always()
runs-on: ubuntu-latest
steps:
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Download artifact
uses: actions/download-artifact@v2
with:
name: playwright-report
- name: Upload artifact to pages
uses: actions/upload-pages-artifact@v2
with:
path: "."
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2