forked from baron/baron-sso
adminfront-tests Playwright CLI 경로 하드코딩 제거
This commit is contained in:
@@ -128,9 +128,8 @@ run_with_retry() {
|
||||
return "$exit_code"
|
||||
}
|
||||
|
||||
playwright_cli="$repo_root/node_modules/.pnpm/@playwright+test@1.60.0/node_modules/@playwright/test/cli.js"
|
||||
playwright_install_cmd=(node "$playwright_cli" install)
|
||||
playwright_install_desc="node $playwright_cli install"
|
||||
playwright_install_cmd=(pnpm exec playwright install)
|
||||
playwright_install_desc="pnpm exec playwright install"
|
||||
playwright_project_args=()
|
||||
|
||||
has_webkit_host_dependencies() {
|
||||
@@ -180,21 +179,21 @@ has_webkit_host_dependencies() {
|
||||
}
|
||||
|
||||
if [ "$(id -u)" -eq 0 ]; then
|
||||
playwright_install_cmd=(node "$playwright_cli" install --with-deps)
|
||||
playwright_install_desc="node $playwright_cli install --with-deps"
|
||||
playwright_install_cmd=(pnpm exec playwright install --with-deps)
|
||||
playwright_install_desc="pnpm exec playwright install --with-deps"
|
||||
elif command -v sudo >/dev/null 2>&1 && sudo -n true >/dev/null 2>&1; then
|
||||
playwright_install_cmd=(node "$playwright_cli" install --with-deps)
|
||||
playwright_install_desc="node $playwright_cli install --with-deps"
|
||||
playwright_install_cmd=(pnpm exec playwright install --with-deps)
|
||||
playwright_install_desc="pnpm exec playwright install --with-deps"
|
||||
elif ! has_webkit_host_dependencies; then
|
||||
playwright_install_cmd=(node "$playwright_cli" install chromium firefox)
|
||||
playwright_install_desc="node $playwright_cli install chromium firefox"
|
||||
playwright_install_cmd=(pnpm exec playwright install chromium firefox)
|
||||
playwright_install_desc="pnpm exec playwright install chromium firefox"
|
||||
playwright_project_args=(--project=chromium --project=firefox)
|
||||
{
|
||||
echo "# Adminfront WebKit Skipped"
|
||||
echo
|
||||
echo "- Reason: WebKit host dependencies are not installed and this user cannot run passwordless sudo."
|
||||
echo "- Action: Running Chromium and Firefox projects only."
|
||||
echo "- To enable WebKit locally: run \`cd adminfront && node $playwright_cli install-deps webkit\` with sudo privileges."
|
||||
echo "- To enable WebKit locally: run \`cd adminfront && pnpm exec playwright install-deps webkit\` with sudo privileges."
|
||||
} > reports/adminfront-webkit-skipped.md
|
||||
fi
|
||||
|
||||
@@ -296,11 +295,10 @@ if ! is_port_available "$port"; then
|
||||
port="$fallback_port"
|
||||
fi
|
||||
echo "==> adminfront using PORT=$port"
|
||||
playwright_test_cli="$tmp_dir/adminfront/node_modules/.pnpm/@playwright+test@1.60.0/node_modules/@playwright/test/cli.js"
|
||||
(
|
||||
cd "$tmp_dir/adminfront"
|
||||
CI=true PORT="$port" PLAYWRIGHT_WORKERS="${PLAYWRIGHT_WORKERS:-1}" \
|
||||
node "$playwright_test_cli" test --max-failures=1 "${playwright_project_args[@]}"
|
||||
pnpm exec playwright test --max-failures=1 "${playwright_project_args[@]}"
|
||||
) 2>&1 | tee reports/adminfront-test.log
|
||||
test_exit_code=${PIPESTATUS[0]}
|
||||
set -e
|
||||
|
||||
Reference in New Issue
Block a user