-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (54 loc) · 1.92 KB
/
test-electron-app.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
name: Test Electron App
on:
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-22.04
timeout-minutes: 15
strategy:
matrix:
node-version: [20]
services:
xvfb:
image: mcr.microsoft.com/playwright:focal
steps:
- name: Checkout code
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- uses: pnpm/action-setup@fe02b34f77f8bc703788d5817da081398fad5dd2
- name: Build packages
uses: ./.github/actions/build
with:
packages-only: true
node-version: ${{ matrix.node-version }}
# Caching browser binaries is not recommended, since the amount of time it takes to restore the cache is comparable to the time it takes to download the binaries.
- name: Install chromium browser
run: npx playwright install chromium
- name: Install Playwright dependencies
run: npx playwright install-deps
- name: Check whether appFiles are there
run: ls -R ./packages/scalar-app/dist
- name: Start Xvfb
run: |
Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
echo "DISPLAY=:99" >> $GITHUB_ENV
- name: Run e2e tests
run: CI=1 DEBUG=pw:browser* pnpm test:e2e:electron
env:
DISPLAY: ':99'
- if: failure()
name: Show stack traces and debug info
working-directory: playwright
run: |
echo "=== Playwright Logs ==="
cat ~/.cache/ms-playwright/browser_logs/*.log || true
echo "=== Test Results ==="
ls -la test-results/ || true
echo "=== Trace Information ==="
for trace_file in test-results/*/trace.zip; do
if [ -f "$trace_file" ]; then
echo -e "\nAttempting to show trace: $trace_file"
timeout 30 pnpm exec playwright show-trace "$trace_file" || echo "Trace viewing timed out"
fi
done