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: Resolve responsive UI test authentication issues in CI

LearningCircuit26f741d5e90f
diff --git a/tests/ui_tests/auth_helper.js b/tests/ui_tests/auth_helper.js
index 0ed9976c82..c18506e73f 100644
--- a/tests/ui_tests/auth_helper.js
+++ b/tests/ui_tests/auth_helper.js
@@ -192,7 +192,7 @@ class AuthHelper {
// Check if there's an error message on the page (with timeout protection)
try {
const errorElement = await Promise.race([
- this.page.$('.alert-danger, .error-message'),
+ this.page.$('.alert-danger, .error-message, .flash-message'),
new Promise(resolve => setTimeout(() => resolve(null), 2000))
]);
if (errorElement) {
@@ -205,6 +205,13 @@ class AuthHelper {
}
// Otherwise ignore the error check failure
}
+
+ // In CI mode, give up after 5 attempts if we're still on login page
+ // This likely means the user doesn't exist
+ if (i >= 5 && currentUrl && currentUrl.includes('/auth/login')) {
+ console.log(' Login not succeeding after 5 attempts, user likely does not exist');
+ throw new Error('Login failed - user does not exist');
+ }
}
if (!redirected) {
diff --git a/tests/ui_tests/test_responsive_ui_comprehensive.js b/tests/ui_tests/test_responsive_ui_comprehensive.js
index fe3101bde4..a930354894 100644
--- a/tests/ui_tests/test_responsive_ui_comprehensive.js
+++ b/tests/ui_tests/test_responsive_ui_comprehensive.js
@@ -5,6 +5,7 @@
const puppeteer = require('puppeteer');
const AuthHelper = require('./auth_helper');
+const { getPuppeteerLaunchOptions } = require('./puppeteer_config');
// Viewport configurations
const VIEWPORTS = {
@@ -35,17 +36,48 @@ class ResponsiveUITester {
}
async init() {
- this.browser = await puppeteer.launch({
- headless: process.env.HEADLESS !== 'false',
- args: ['--no-sandbox', '--disable-setuid-sandbox']
- });
+ console.log('Launching browser...');
+ this.browser = await puppeteer.launch(getPuppeteerLaunchOptions());
+ console.log('Creating new page...');
this.page = await this.browser.newPage();
await this.page.setViewport(VIEWPORTS[this.viewport]);
- // Authenticate
+ // Authenticate with timeout protection
+ console.log('Authenticating...');
const auth = new AuthHelper(this.page, this.baseUrl);
- await auth.ensureAuthenticated();
+
+ // Use a reasonable timeout for authentication
+ const authTimeout = new Promise((_, reject) =>
+ setTimeout(() => reject(new Error('Authentication timeout')), 30000)
+ );
+
+ try {
+ // For CI, we need to use specific test credentials
+ if (process.env.CI) {
+ const testUser = {
+ username: `responsive_test_${Date.now()}`,
+ password: 'Test@Pass123!' // pragma: allowlist secret
+ };
+ console.log(`Creating test user: ${testUser.username}`);
+ await Promise.race([
+ auth.ensureAuthenticated(testUser.username, testUser.password),
+ authTimeout
+ ]);
+ // In CI mode, after registration, auth_helper creates a new page
+ // Update our reference to use the new page
+ this.page = auth.page;
+ } else {
+ await Promise.race([
+ auth.ensureAuthenticated(),
+ authTimeout
+ ]);
+ }
+ console.log('Authentication successful');
+ } catch (error) {
+ console.error('Authentication failed:', error.message);
+ throw error;
+ }
}
async testPage(pageInfo) {