diff --git a/commands/web/playwright b/commands/web/playwright index feb5b0a..6232083 100755 --- a/commands/web/playwright +++ b/commands/web/playwright @@ -6,5 +6,5 @@ cd test/playwright || exit 1 if [ -f yarn.lock ]; then yarn && yarn playwright "$@" else - npx playwright "$@" + npm ci && npx playwright "$@" fi diff --git a/web-build/disabled.Dockerfile.playwright b/web-build/disabled.Dockerfile.playwright index 6283f72..536abc3 100644 --- a/web-build/disabled.Dockerfile.playwright +++ b/web-build/disabled.Dockerfile.playwright @@ -36,11 +36,15 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ && chown -R $username:$username /dot-cache \ && sudo -u $username ln -s /dot-cache /home/$username/.cache \ && cd /var/www/html/test/playwright \ - && ([ -f yarn.lock ] && export JS_PKG_MANAGER=yarn || export JS_PKG_MANAGER=npx \ - && sudo -u $username $JS_PKG_MANAGER \ - && sudo -u $username $JS_PKG_MANAGER playwright install-deps \ - && sudo -u $username $JS_PKG_MANAGER playwright install \ - ) \ + && if [ -f yarn.lock ]; then \ + export JS_PKG_MANAGER=yarn; \ + sudo -u $username $JS_PKG_MANAGER; \ + else \ + export JS_PKG_MANAGER=npx; \ + sudo -u $username npm install; \ + fi \ + && sudo -u $username $JS_PKG_MANAGER playwright install-deps \ + && sudo -u $username $JS_PKG_MANAGER playwright install \ && rm -rf /var/www/html/test/playwright \ && rm /home/$username/.cache \ && sudo -u $username mkdir -p /home/$username/.cache \