Repository navigation
91 lines (75 loc) · 2.66 KB
/
Copy pathe2e.yml
File metadata and controls
91 lines (75 loc) · 2.66 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
name: E2E Tests
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
permissions:
contents: read
jobs:
e2e:
name: Playwright E2E Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Setup .NET 10 SDK
uses: actions/setup-dotnet@v6
with:
dotnet-version: '10.0.x'
- name: Restore packages
run: dotnet restore
- name: Build solution (Release)
run: dotnet build --no-restore --configuration Release
- name: Start full stack
run: docker compose --profile full up --build -d
env:
POSTGRES_PASSWORD: ci_test_password
API__KEY: ci-test-api-key-not-for-production
- name: Wait for API health
run: |
echo "Waiting for API /alive..."
timeout 120 bash -c 'until curl -sf http://localhost:5001/alive > /dev/null; do echo " still waiting..."; sleep 3; done'
echo "API healthy."
- name: Wait for Web health
run: |
echo "Waiting for Web UI..."
timeout 90 bash -c 'until curl -sf http://localhost:5002/ > /dev/null; do echo " still waiting..."; sleep 3; done'
echo "Web healthy."
- name: Install Playwright browsers (Chromium only)
run: |
# Build puts playwright.ps1 next to the test dll
pwsh tests/FlowLedger.E2E.Tests/bin/Release/net10.0/playwright.ps1 install --with-deps chromium
- name: Run E2E tests (headless, CI-only)
run: >
dotnet test tests/FlowLedger.E2E.Tests
--no-build
--configuration Release
--filter "Category=E2E"
--logger "trx;LogFileName=e2e-results.trx"
--results-directory ./artifacts/tests
env:
E2E_BASE_URL: http://localhost:5002
E2E_API_URL: http://localhost:5001
E2E_API_KEY: ci-test-api-key-not-for-production
E2E_TENANT_ID: "00000000-0000-0000-0000-000000000001"
- name: Publish E2E test results
if: always()
uses: dorny/test-reporter@v3
with:
name: E2E Test Results
path: artifacts/tests/**/*.trx
reporter: dotnet-trx
- name: Upload Playwright traces / screenshots on failure
if: failure()
uses: actions/upload-artifact@v7
with:
name: playwright-artifacts
path: test-results/
if-no-files-found: ignore
- name: Show compose logs on failure
if: failure()
run: docker compose --profile full logs --tail=100
- name: Tear down stack
if: always()
run: docker compose --profile full down -v