forked from ag-grid/ag-grid
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocs-e2e.sh
More file actions
executable file
·96 lines (84 loc) · 2.95 KB
/
docs-e2e.sh
File metadata and controls
executable file
·96 lines (84 loc) · 2.95 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/env bash
# Runs docs Playwright e2e tests directly, bypassing Nx.
# All arguments are forwarded to playwright. Defaults to chromium only.
#
# Usage:
# ./docs-e2e.sh # Run all tests (chromium)
# ./docs-e2e.sh "file-pattern" # Run tests matching pattern
# ./docs-e2e.sh "file-pattern" --grep "name" # Run specific test by name
# ./docs-e2e.sh --all-browsers # Run all browsers
# ./docs-e2e.sh --framework react # Run with specific framework
# ./docs-e2e.sh --url https://localhost:4610 # Run against specific URL
# ./docs-e2e.sh --headed # Run in headed mode
# ./docs-e2e.sh --ui # Open Playwright UI mode
# ./docs-e2e.sh --debug # Debug mode
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
usage() {
cat <<'EOF'
Usage: ./docs-e2e.sh [options] [playwright-args]
Runs docs Playwright e2e tests directly, bypassing Nx. Defaults to chromium only.
Any unrecognised arguments are forwarded directly to playwright test.
Options:
--all-browsers Run all browsers (chromium, firefox, webkit)
--framework <name> Set FRAMEWORK env var (e.g. react, angular, vue)
--url <url> Set BASE_URL env var (default: https://localhost:4610)
--help Show this help message
Playwright options (forwarded as-is):
"file-pattern" Run tests matching pattern
--grep <name> Run tests matching name
--project <browser> Run specific browser project
--headed Run in headed mode
--ui Open Playwright UI mode
--debug Debug mode
Examples:
./docs-e2e.sh
./docs-e2e.sh "toolbar"
./docs-e2e.sh "toolbar" --grep "Quick filter"
./docs-e2e.sh --all-browsers
./docs-e2e.sh --framework react
./docs-e2e.sh --url https://localhost:4610
./docs-e2e.sh --headed
./docs-e2e.sh --ui
EOF
}
ALL_BROWSERS=false
args=()
while [[ $# -gt 0 ]]; do
case "$1" in
--help|-h)
usage
exit 0
;;
--all-browsers)
ALL_BROWSERS=true
shift
;;
--framework=*)
export FRAMEWORK="${1#--framework=}"
shift
;;
--framework)
export FRAMEWORK="$2"
shift 2
;;
--url=*)
export BASE_URL="${1#--url=}"
shift
;;
--url)
export BASE_URL="$2"
shift 2
;;
*)
args+=("$1")
shift
;;
esac
done
# Default to chromium unless --all-browsers or --project already specified
if [ "$ALL_BROWSERS" = false ] && [[ ! " ${args[*]+"${args[*]}"} " =~ "--project" ]]; then
args+=("--project=chromium")
fi
cd "$SCRIPT_DIR/documentation/ag-grid-docs"
exec npx playwright test "${args[@]+"${args[@]}"}"