From 228af7ef516c48249b3df8769f42b5167b3d0d72 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 23 Nov 2025 05:29:16 +0000 Subject: [PATCH 1/2] Fix linux-e2e: ensure WebKitWebDriver is in PATH The webkit2gtk-driver package on Ubuntu 24.04 may install WebKitWebDriver to a versioned library directory that's not on PATH by default. This causes tauri-driver to fail with 'can not find binary WebKitWebDriver in the PATH'. This fix: - Checks if webkit2gtk-driver package is installed - Verifies WebKitWebDriver is callable from PATH - If not, locates the binary using dpkg -L and creates a symlink to /usr/local/bin - Validates the symlink works before proceeding This ensures tauri-driver can find WebKitWebDriver regardless of where the package installs it. Co-Authored-By: yujonglee --- scripts/setup-desktop-e2e.sh | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/scripts/setup-desktop-e2e.sh b/scripts/setup-desktop-e2e.sh index 8b01bfb0b7..ec4bea9e6a 100755 --- a/scripts/setup-desktop-e2e.sh +++ b/scripts/setup-desktop-e2e.sh @@ -21,13 +21,38 @@ else echo "tauri-driver already installed" fi -# Install WebKitWebDriver if not already installed -if ! command -v WebKitWebDriver >/dev/null 2>&1; then - echo "Installing WebKitWebDriver..." +# Install WebKitWebDriver package if not already installed +if ! dpkg -l | grep -q webkit2gtk-driver; then + echo "Installing webkit2gtk-driver package..." sudo apt-get update sudo apt-get install -y webkit2gtk-driver else - echo "WebKitWebDriver already installed" + echo "webkit2gtk-driver package already installed" +fi + +# Ensure WebKitWebDriver is actually callable from PATH +if ! command -v WebKitWebDriver >/dev/null 2>&1; then + echo "WebKitWebDriver not on PATH, trying to locate binary from webkit2gtk-driver package..." + DRIVER_PATH=$(dpkg -L webkit2gtk-driver | grep -E 'WebKitWebDriver$' | head -n 1 || true) + + if [[ -z "${DRIVER_PATH}" ]]; then + echo "Error: Could not find WebKitWebDriver binary in webkit2gtk-driver package" + exit 1 + fi + + echo "Found WebKitWebDriver at: ${DRIVER_PATH}" + echo "Creating symlink at /usr/local/bin/WebKitWebDriver (requires sudo)..." + sudo ln -sf "${DRIVER_PATH}" /usr/local/bin/WebKitWebDriver + + # Verify the symlink works + if ! command -v WebKitWebDriver >/dev/null 2>&1; then + echo "Error: WebKitWebDriver still not found in PATH after creating symlink" + exit 1 + fi + + echo "WebKitWebDriver successfully linked to PATH" +else + echo "WebKitWebDriver already available in PATH" fi echo "Desktop E2E test environment setup complete" From 7dc460495a1bdc9f476624d35641bd03a21000cd Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Sun, 23 Nov 2025 06:00:17 +0000 Subject: [PATCH 2/2] Fix tauri-driver GTK initialization by wrapping with xvfb-run in CI The previous fix ensured WebKitWebDriver was in PATH, which worked. However, tauri-driver itself needs GTK/X11 to initialize its event loop. In CI, tauri-driver was starting in onPrepare before xvfb was initialized, causing GTK initialization to fail with 'Failed to initialize gtk backend'. This fix wraps tauri-driver with xvfb-run when running in CI (detected via CI env var), providing a virtual display before tauri-driver starts. Local development is unaffected (no xvfb-run wrapper). Co-Authored-By: yujonglee --- apps/desktop-e2e/wdio.conf.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/desktop-e2e/wdio.conf.js b/apps/desktop-e2e/wdio.conf.js index 09b10e205a..367a9058b5 100644 --- a/apps/desktop-e2e/wdio.conf.js +++ b/apps/desktop-e2e/wdio.conf.js @@ -37,7 +37,15 @@ export const config = { onPrepare: function () { return new Promise((resolve, reject) => { - tauriDriver = spawn("tauri-driver", [], { + // In CI, wrap tauri-driver with xvfb-run to provide a virtual display + // This is needed because tauri-driver initializes GTK which requires X11 + const useXvfb = !!process.env.CI; + const cmd = useXvfb ? "xvfb-run" : "tauri-driver"; + const args = useXvfb ? ["-a", "tauri-driver"] : []; + + console.log(`Starting tauri-driver${useXvfb ? " with xvfb-run" : ""}...`); + + tauriDriver = spawn(cmd, args, { stdio: ["ignore", "pipe", "pipe"], });