-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathplaywright.sh
More file actions
executable file
·36 lines (30 loc) · 989 Bytes
/
Copy pathplaywright.sh
File metadata and controls
executable file
·36 lines (30 loc) · 989 Bytes
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
#!/usr/bin/env bash
#MISE description="Setup Playwright for e2e testing (install browsers and dependencies)"
set -euo pipefail
echo "Setting up Playwright for e2e testing..."
echo ""
# Install npm dependencies if needed
if [ ! -d node_modules ]; then
echo "Step 1: Installing npm dependencies..."
npm install
else
echo "✓ npm dependencies already installed"
fi
# Check if Playwright browsers are installed
if [ ! -d ~/.cache/ms-playwright ] || [ -z "$(ls -A ~/.cache/ms-playwright 2>/dev/null)" ]; then
echo ""
echo "Step 2: Installing Playwright browsers..."
npx playwright install chromium
else
echo "✓ Playwright browsers already installed"
fi
# Install system dependencies (requires sudo)
echo ""
echo "Step 3: Installing Playwright system dependencies..."
echo "(This may prompt for sudo password)"
npx playwright install-deps chromium
echo ""
echo "✅ Playwright setup complete!"
echo ""
echo "You can now:"
echo " - Run e2e tests: MISE_ENV=dev mise run test:e2e"