Skip to content

Commit 1a970c5

Browse files
committed
add show-all-reports cmd to justfile
1 parent 2878560 commit 1a970c5

1 file changed

Lines changed: 41 additions & 0 deletions

File tree

e2e/justfile

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,47 @@ list-envs:
9090
show-report env_name:
9191
npx playwright show-report "playwright-report-{{env_name}}"
9292

93+
# Show all reports from all environments
94+
show-all-reports:
95+
#!/usr/bin/env bash
96+
set -euo pipefail
97+
98+
# Find all playwright report directories
99+
report_dirs=$(find . -maxdepth 1 -type d -name "playwright-report-*" | sort)
100+
101+
if [ -z "$report_dirs" ]; then
102+
echo "No HTML reports found. Run 'just test-all-envs' first."
103+
exit 1
104+
fi
105+
106+
echo "Available reports:"
107+
port=9323
108+
for report_dir in $report_dirs; do
109+
env_name=$(basename "$report_dir" | sed 's/playwright-report-//')
110+
echo "- $env_name: $report_dir (will serve on port $port)"
111+
((port++))
112+
done
113+
echo ""
114+
115+
# Open each report in browser with different ports
116+
port=9323
117+
pids=()
118+
for report_dir in $report_dirs; do
119+
env_name=$(basename "$report_dir" | sed 's/playwright-report-//')
120+
echo "Opening report for environment: $env_name on port $port"
121+
npx playwright show-report "$report_dir" --port "$port" &
122+
pids+=($!)
123+
((port++))
124+
sleep 1 # Small delay to prevent browser overwhelm
125+
done
126+
127+
echo "All reports opened in browser"
128+
echo "Press Ctrl+C to stop all report servers"
129+
130+
# Wait for all background processes and handle cleanup
131+
trap 'echo "Stopping all report servers..."; kill ${pids[@]} 2>/dev/null; exit' INT TERM
132+
wait
133+
93134
# Run tests in headed mode for a specific environment
94135
test-env-headed env_file *args="":
95136
#!/usr/bin/env bash

0 commit comments

Comments
 (0)