Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

fix: Force Puppeteer to use Playwright's Chromium instead of Chrome

LearningCircuit6bc4aeedc1bc
diff --git a/Dockerfile b/Dockerfile
index ae54501d74..78a04cde82 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -65,31 +65,35 @@ RUN apt-get update && apt-get install -y \
&& apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
-# Set up Puppeteer environment
-ENV PUPPETEER_CACHE_DIR=/app/puppeteer-cache
-ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=false
+# Install Playwright first to get Chromium
+RUN playwright install --with-deps chromium
+
+# Find Chromium executable and set it as environment variable
+RUN export CHROMIUM_PATH=$(find /root/.cache/ms-playwright -name chrome -type f | head -1) && \
+ echo "Found Chromium at: $CHROMIUM_PATH" && \
+ echo "ENV PUPPETEER_EXECUTABLE_PATH=$CHROMIUM_PATH" >> /tmp/env.txt
+
+# Set up Puppeteer to skip download and use Playwright's Chromium
+ENV PUPPETEER_SKIP_DOWNLOAD=true
+# This will be replaced with actual path during build
+RUN export CHROMIUM_PATH=$(find /root/.cache/ms-playwright -name chrome -type f | head -1) && \
+ echo "export PUPPETEER_EXECUTABLE_PATH=$CHROMIUM_PATH" > /etc/profile.d/puppeteer.sh
-# Create puppeteer cache directory with proper permissions
-RUN mkdir -p /app/puppeteer-cache && chmod -R 777 /app/puppeteer-cache
+# For non-interactive shells, set it directly
+ENV PUPPETEER_EXECUTABLE_PATH=/root/.cache/ms-playwright/chromium-1148/chrome-linux/chrome
# Copy test package files
COPY tests/api_tests_with_login/package.json /install/tests/api_tests_with_login/
COPY tests/ui_tests/package.json /install/tests/ui_tests/
-# Install npm packages (Puppeteer will download Chromium automatically)
+# Install npm packages (skip Puppeteer download)
WORKDIR /install/tests/api_tests_with_login
RUN npm install
WORKDIR /install/tests/ui_tests
RUN npm install
-# Ensure Chromium binaries have correct permissions
-RUN chmod -R 755 /app/puppeteer-cache
-
WORKDIR /install
-# Install browser automation tools and dependencies for Playwright
-RUN playwright install --with-deps chromium
-
# Install the package using PDM
RUN pdm install --check --no-editable
# Configure path to default to the venv python.
diff --git a/tests/api_tests_with_login/puppeteer_config.js b/tests/api_tests_with_login/puppeteer_config.js
index 00e92a2f95..dbfcb6e3b9 100644
--- a/tests/api_tests_with_login/puppeteer_config.js
+++ b/tests/api_tests_with_login/puppeteer_config.js
@@ -16,7 +16,10 @@ function getPuppeteerLaunchOptions(additionalOptions = {}) {
]
};
- // Remove --single-process as it can cause issues with some operations
+ // Use custom executable path if provided
+ if (process.env.PUPPETEER_EXECUTABLE_PATH) {
+ defaultOptions.executablePath = process.env.PUPPETEER_EXECUTABLE_PATH;
+ }
return { ...defaultOptions, ...additionalOptions };
}
diff --git a/tests/ui_tests/puppeteer_config.js b/tests/ui_tests/puppeteer_config.js
index 41ecb9dd1a..516dd8d078 100644
--- a/tests/ui_tests/puppeteer_config.js
+++ b/tests/ui_tests/puppeteer_config.js
@@ -16,7 +16,10 @@ function getPuppeteerLaunchOptions(additionalOptions = {}) {
]
};
- // Remove --single-process as it can cause issues with some operations
+ // Use custom executable path if provided
+ if (process.env.PUPPETEER_EXECUTABLE_PATH) {
+ defaultOptions.executablePath = process.env.PUPPETEER_EXECUTABLE_PATH;
+ }
return { ...defaultOptions, ...additionalOptions };
}