-
Notifications
You must be signed in to change notification settings - Fork 2
61 lines (51 loc) · 1.55 KB
/
ci-ui-tests.yaml
File metadata and controls
61 lines (51 loc) · 1.55 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
name: UI Tests
on:
push:
#branches: [ main ]
pull_request:
branches: [main]
workflow_dispatch:
jobs:
test:
timeout-minutes: 60
runs-on: ubuntu-latest
defaults:
run:
working-directory: application/CohortManager/src/Web
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "22"
cache: "npm"
cache-dependency-path: application/CohortManager/src/Web/package-lock.json
- name: Install dependencies
run: npm ci
- name: Install Playwright browsers
run: npx playwright install --with-deps
- name: Start application and run tests
env:
AUTH_SECRET: ${{ secrets.AUTH_SECRET }}
SERVICE_NAME: ${{ vars.SERVICE_NAME }}
NEXTAUTH_URL: ${{ vars.NEXTAUTH_URL }}
EXCEPTIONS_API_URL: ${{ vars.EXCEPTIONS_API_URL }}
COHORT_MANAGER_USERS: ${{ vars.COHORT_MANAGER_USERS }}
run: |
# Start the app in background
npm run dev:secure &
# Wait for the app to be ready
while ! curl -s https://localhost:3000 > /dev/null; do
echo "Waiting for app to start..."
sleep 5
done
# Run the tests
npx bddgen
npx playwright test
- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results
path: application/CohortManager/src/Web/test-results/
retention-days: 30