-
-
Notifications
You must be signed in to change notification settings - Fork 4
109 lines (108 loc) · 4.26 KB
/
Copy pathplaywright-local.yml
File metadata and controls
109 lines (108 loc) · 4.26 KB
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
102
103
104
105
106
107
108
109
name: Playwright tests - local instance
on:
repository_dispatch:
types: [trigger-e2e-tests]
push:
branches: [ testing_branch, local_testing_branch, main ]
jobs:
run_tests:
runs-on: ubuntu-latest
steps:
- name: Clone CryptPad repository
env:
PA_TOKEN: ${{ secrets.PAT_SECRET }}
run: git clone "https://"$PA_TOKEN"@github.com/cryptpad/cryptpad.git" -b 2025.6_seed
shell: bash
- name: Seed database
working-directory: cryptpad
run: unzip -o database_seed_2025.6.zip
if: always()
- name: Checkout branch
working-directory: cryptpad
run: |
git checkout 2025.6-test
git branch
- name: Install dependencies
run: npm install --prefix cryptpad
- name: Install components 1
run: npm ci --prefix cryptpad
- name: Install components 2
run: npm run install:components --prefix cryptpad
- name: Install OnlyOffice
run: cryptpad/install-onlyoffice.sh -a
if: always()
- name: Run local server
timeout-minutes: 180
run: nohup npm run dev --prefix cryptpad &
- name: Clone test repository
env:
PA_TOKEN: ${{ secrets.PAT_SECRET }}
run: git clone "https://"$PA_TOKEN"@github.com/cryptpad/e2e-test-suite.git"
shell: bash
- name: Install dependencies
run: npm ci --prefix e2e-test-suite
- name: Install dependencies 2
run: npm exec playwright install --with-deps --prefix e2e-test-suite
- name: Install dependencies 3
run: npm exec playwright install-deps --prefix e2e-test-suite
- name: Install test reporter
run: npm install playwright-ctrf-json-reporter --prefix e2e-test-suite
- name: Calibrate Playwright screenshot tests (anon)
working-directory: e2e-test-suite
run: npx playwright test -g "screenshot anon" --config=playwright.config.js --project='chrome' --workers=2
env:
PW_URL: ${{ vars.PW_URL }}
if: always()
- name: Run Playwright tests (anon)
working-directory: e2e-test-suite
run: npx playwright test anon --config=playwright.config.js --project='chrome' --retries=1 --workers=2
env:
PW_URL: ${{ vars.PW_URL }}
if: always()
- name: Publish Test Report (anon)
uses: ctrf-io/github-test-reporter@v1
with:
report-path: 'e2e-test-suite/ctrf/*.json'
title: 'Test results - anonymous'
if: always()
- name: Create auth files
working-directory: e2e-test-suite
run: |
mkdir auth
cd auth
touch mainuser.json testuser.json testuser2.json testuser3.json
if: always()
- name: Authenticate users
working-directory: e2e-test-suite
run: |
npx playwright test auth --config=playwright.config.js --project='chrome' --workers=1
env:
PW_URL: ${{ vars.PW_URL }}
MAINACCOUNTPASSWORD: ${{ vars.MAINACCOUNTPASSWORD }}
TESTUSERPASSWORD: ${{ vars.TESTUSERPASSWORD }}
TESTUSER2PASSWORD: ${{ vars.TESTUSER2PASSWORD }}
TESTUSER3PASSWORD: ${{ vars.TESTUSER3PASSWORD }}
if: always()
- name: Calibrate Playwright screenshot tests (logged in users)
working-directory: e2e-test-suite
run: npx playwright test -g "screenshot loggedin" --config=playwright.config.js --project='chrome' --workers=2
env:
PW_URL: ${{ vars.PW_URL }}
if: always()
- name: Run Playwright tests (logged in users)
working-directory: e2e-test-suite
run: npx playwright test loggedin --config=playwright.config.js --project='chrome' --workers=1 --retries=3
env:
PW_URL: ${{ vars.PW_URL }}
MAINACCOUNTPASSWORD: ${{ vars.MAINACCOUNTPASSWORD }}
TESTUSERPASSWORD: ${{ vars.TESTUSERPASSWORD }}
TESTUSER2PASSWORD: ${{ vars.TESTUSER2PASSWORD }}
TESTUSER3PASSWORD: ${{ vars.TESTUSER3PASSWORD }}
# DEBUG: pw:api
if: always()
- name: Publish Test Report (logged in users)
uses: ctrf-io/github-test-reporter@v1
with:
report-path: 'e2e-test-suite/ctrf/*.json'
title: 'Test results - logged in users'
if: always()