Files
gitea/tools/playwright.sh
T
silverwind 1f51d2c318 test: run e2e tests in WebKit on Linux (#40152)
WebKit was removed from the e2e tests in
https://github.com/go-gitea/gitea/pull/37315 because Linux WebKit kept
crashing. The crashes came from a use-after-free in the libsoup bundled
with WebKit, which killed the network process and surfaced as `WebKit
encountered an internal error`. macOS WebKit never had them because it
does not use libsoup. Playwright 1.64 bundles libsoup 3.6.6 with the fix
(https://github.com/microsoft/playwright/issues/42803), so WebKit now
runs on all platforms. Builds on
https://github.com/go-gitea/gitea/pull/40140.

The e2e job ran 50 times on `ubuntu-latest` with WebKit enabled, and all
runs passed without WebKit errors. The third browser adds about 1.5 to 2
minutes per run.

1. Playwright installs its system dependencies on GitHub runners too,
which only come with the Chromium and Firefox libraries
1. The passkey test skips Linux WebKit, which has no WebAuthn,
Playwright only stubs `PublicKeyCredential` there

---------

Signed-off-by: silverwind <me@silverwind.io>
2026-11-01 15:24:41 +00:00

15 lines
628 B
Bash
Executable File

#!/bin/bash
set -euo pipefail
# playwright only supports ubuntu/debian officially
if [ "$(uname -s)" = "Linux" ] && grep -qE '^ID(_LIKE)?=.*(ubuntu|debian)' /etc/os-release 2>/dev/null; then
if [ "$(id -u)" = 0 ] || { command -v sudo >/dev/null 2>&1 && sudo -n true >/dev/null 2>&1; }; then # Avoid Playwright's interactive su fallback.
pnpm exec playwright install --with-deps "$@"
else
pnpm exec playwright install "$@"
echo "Skipped playwright system dependencies (not root and no passwordless sudo), install them with: pnpm exec playwright install-deps" >&2
fi
else
pnpm exec playwright install "$@"
fi