From 9803108de2143b2d5b32420864254a8ae2d3d886 Mon Sep 17 00:00:00 2001 From: kyy Date: Fri, 5 Jun 2026 20:42:59 +0900 Subject: [PATCH] =?UTF-8?q?adminfront-tests=20Playwright=20CLI=20=EA=B2=BD?= =?UTF-8?q?=EB=A1=9C=20=ED=95=98=EB=93=9C=EC=BD=94=EB=94=A9=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/run_adminfront_ci_tests.sh | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/scripts/run_adminfront_ci_tests.sh b/scripts/run_adminfront_ci_tests.sh index 8b18f035..986eaadd 100755 --- a/scripts/run_adminfront_ci_tests.sh +++ b/scripts/run_adminfront_ci_tests.sh @@ -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