Skip to content

Commit 8732a9a

Browse files
committed
e2e: ci tests
1 parent 731fcc0 commit 8732a9a

File tree

2 files changed

+93
-72
lines changed

2 files changed

+93
-72
lines changed
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Wallet Tests (Playwright Action)
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
paths:
7+
- 'e2e/specs/wallets/**'
8+
- '.github/workflows/test-wallet-playwright.yaml'
9+
10+
env:
11+
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
12+
13+
jobs:
14+
wallets-playwright-action:
15+
name: wallets (Using Playwright Action)
16+
timeout-minutes: 20
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Setup pnpm
22+
uses: pnpm/action-setup@v4
23+
with:
24+
version: 9.3.0
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 20
30+
cache: 'pnpm'
31+
32+
- name: Install dependencies
33+
run: pnpm install --frozen-lockfile
34+
35+
- name: Setup Playwright using official action
36+
uses: microsoft/playwright-github-action@v1
37+
with:
38+
browsers: chromium
39+
40+
- name: Setup virtual display
41+
run: |
42+
sudo apt-get update
43+
sudo apt-get install -y xvfb
44+
export DISPLAY=:99
45+
Xvfb :99 -screen 0 1920x1080x24 > /dev/null 2>&1 &
46+
echo "DISPLAY=:99" >> $GITHUB_ENV
47+
48+
- name: Verify Playwright installation
49+
run: |
50+
echo "Checking Playwright installation..."
51+
pnpm exec playwright --version
52+
53+
echo "Checking browser installations..."
54+
pnpm exec playwright show-report || true
55+
56+
echo "Cache contents:"
57+
ls -la ~/.cache/ms-playwright/ || echo "No cache found"
58+
59+
# Test that we can actually launch chromium
60+
echo "Testing chromium launch..."
61+
cat > test-launch.js << 'EOF'
62+
const { chromium } = require('@playwright/test');
63+
(async () => {
64+
console.log('Attempting to launch chromium...');
65+
const browser = await chromium.launch({ headless: true });
66+
console.log('✅ Chromium launched successfully!');
67+
await browser.close();
68+
process.exit(0);
69+
})().catch(err => {
70+
console.error('❌ Failed to launch chromium:', err);
71+
process.exit(1);
72+
});
73+
EOF
74+
node test-launch.js
75+
76+
- name: Run wallet tests
77+
run: |
78+
parallel --lb --halt now,success=1,fail=1 ::: \
79+
"pnpm dev" \
80+
"pnpm wait-on http://localhost:3000 && pnpm e2e:wallet --headed"
81+
env:
82+
SECRET_WORDS: ${{ secrets.SECRET_WORDS }}
83+
DISPLAY: :99
84+
85+
- uses: actions/upload-artifact@v4
86+
if: always()
87+
with:
88+
name: wallets-report-playwright-action
89+
path: |
90+
playwright-report/
91+
test-results/
92+
*.png
93+
retention-days: 30

.github/workflows/test.yaml

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -183,76 +183,4 @@ jobs:
183183
path: playwright-report/
184184
retention-days: 30
185185

186-
wallets:
187-
name: wallets (headed)
188-
timeout-minutes: 15
189-
# Use more powerful instance for browser automation with MetaMask
190-
# Options:
191-
# - blacksmith-8vcpu-ubuntu-2404 (8 vCPUs)
192-
# - blacksmith-16vcpu-ubuntu-2404 (16 vCPUs)
193-
# - ubuntu-latest-8-cores (GitHub hosted)
194-
# - ubuntu-latest-16-cores (GitHub hosted)
195-
runs-on: blacksmith-8vcpu-ubuntu-2404
196-
steps:
197-
- uses: actions/checkout@v4
198-
- uses: ./.github/actions/setup-base
199-
200-
- name: Setup virtual display
201-
run: |
202-
sudo apt-get update
203-
sudo apt-get install -y xvfb
204-
export DISPLAY=:99
205-
Xvfb :99 -screen 0 1280x720x24 > /dev/null 2>&1 &
206186

207-
- name: Setup Playwright for wallet tests
208-
run: |
209-
echo "Cleaning Playwright cache..."
210-
rm -rf ~/.cache/ms-playwright || true
211-
212-
echo "Checking Playwright version..."
213-
pnpm exec playwright --version
214-
215-
echo "Installing system dependencies..."
216-
pnpm exec playwright install-deps chromium
217-
218-
echo "Installing Playwright browsers..."
219-
pnpm exec playwright install chromium
220-
221-
echo "Verifying installation..."
222-
# List what was actually installed
223-
echo "Playwright cache contents:"
224-
ls -la ~/.cache/ms-playwright/ 2>/dev/null || echo "Cache directory not found"
225-
226-
# Find the actual chromium executable
227-
CHROMIUM_PATH=$(find ~/.cache/ms-playwright -name "chrome" -type f -executable 2>/dev/null | head -1)
228-
if [ -z "$CHROMIUM_PATH" ]; then
229-
echo "ERROR: Chromium executable not found!"
230-
echo "Contents of Playwright cache:"
231-
find ~/.cache/ms-playwright -type f -name "*chrome*" 2>/dev/null || echo "No chrome files found"
232-
233-
echo "Forcing reinstall with explicit version..."
234-
# Install with the exact same version that's in the project
235-
npx playwright@$(node -pe "require('./package.json').devDependencies['@playwright/test']") install chromium --force
236-
else
237-
echo "✅ Chromium found at: $CHROMIUM_PATH"
238-
ls -la "$CHROMIUM_PATH"
239-
fi
240-
241-
# - name: Rebuild native dependencies
242-
# run: pnpm rebuild -r
243-
244-
- name: Run wallet tests
245-
run: |
246-
parallel --lb --halt now,success=1,fail=1 ::: \
247-
"pnpm dev" \
248-
"pnpm wait-on http://localhost:3000 && DISPLAY=:99 pnpm e2e:wallet --headed"
249-
env:
250-
SECRET_WORDS: ${{ secrets.SECRET_WORDS }}
251-
DISPLAY: :99
252-
253-
- uses: actions/upload-artifact@v4
254-
if: always()
255-
with:
256-
name: wallets-report
257-
path: playwright-report/
258-
retention-days: 30

0 commit comments

Comments
 (0)