20 lines
517 B
Bash
Executable File
20 lines
517 B
Bash
Executable File
#!/bin/sh
|
|
# Screenshot the harness with headless Firefox.
|
|
# tests/shot.sh [output.png] [width,height] [#hash]
|
|
# A dedicated profile is used so it never collides with the running browser.
|
|
set -eu
|
|
|
|
cd "$(dirname "$0")"
|
|
out=${1:-shot.png}
|
|
size=${2:-1600,1000}
|
|
hash=${3:-}
|
|
|
|
profile=${TMPDIR:-/tmp}/pgt-ff-profile
|
|
mkdir -p "$profile"
|
|
|
|
timeout 120 firefox --headless --no-remote --profile "$profile" \
|
|
--screenshot "$PWD/$out" --window-size "$size" \
|
|
"file://$PWD/harness.html$hash" >/dev/null 2>&1
|
|
|
|
echo "$PWD/$out"
|