-
Notifications
You must be signed in to change notification settings - Fork 90
Expand file tree
/
Copy pathcross-browser-test.sh
More file actions
executable file
·65 lines (58 loc) · 3.05 KB
/
Copy pathcross-browser-test.sh
File metadata and controls
executable file
·65 lines (58 loc) · 3.05 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
#!/usr/bin/env bash
# ──────────────────────────────────────────────────────────────────────────────
# Cross-browser test matrix for the wallet frontend.
#
# Runs the unit suite and wallet smoke flow across Chromium, Firefox, and WebKit.
# Engine-specific failures are tracked by Playwright project name in the HTML
# report.
#
# Prerequisites:
# cd frontend && npm install && npx playwright install
#
# Usage:
# ./scripts/cross-browser-test.sh # run all three engines
# ./scripts/cross-browser-test.sh --chromium # Chromium only
# ./scripts/cross-browser-test.sh --firefox # Firefox only
# ./scripts/cross-browser-test.sh --webkit # WebKit only
#
# Results: frontend/playwright-report/
# ──────────────────────────────────────────────────────────────────────────────
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
FRONTEND_DIR="$REPO_ROOT/frontend"
REPORT_DIR="$FRONTEND_DIR/playwright-report"
cd "$FRONTEND_DIR"
echo ""
echo "══════════════════════════════════════════════════════════════════"
echo " Step 1: Unit tests (vitest)"
echo "══════════════════════════════════════════════════════════════════"
npm test
echo ""
echo "══════════════════════════════════════════════════════════════════"
echo " Step 2: Cross-browser smoke tests (Playwright)"
echo "══════════════════════════════════════════════════════════════════"
MODE="${1:---all}"
case "$MODE" in
--chromium)
npx playwright test --project=chromium
;;
--firefox)
npx playwright test --project=firefox
;;
--webkit)
npx playwright test --project=webkit
;;
--all)
npx playwright test
;;
*)
echo "Usage: $0 [--chromium | --firefox | --webkit | --all]" >&2
exit 1
;;
esac
echo ""
echo "══════════════════════════════════════════════════════════════════"
echo " Cross-browser matrix complete."
echo " HTML report: $REPORT_DIR/index.html"
echo "══════════════════════════════════════════════════════════════════"