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 authentication test login 400 error

LearningCircuite8775d61efbd
diff --git a/tests/ui_tests/auth_helper.js b/tests/ui_tests/auth_helper.js
index a97108e8eb..89195cc6fd 100644
--- a/tests/ui_tests/auth_helper.js
+++ b/tests/ui_tests/auth_helper.js
@@ -125,12 +125,20 @@ class AuthHelper {
// Fill in credentials
console.log(' Filling in credentials...');
+
+ // Clear fields first to ensure clean state
+ await this.page.$eval('input[name="username"]', el => el.value = '');
+ await this.page.$eval('input[name="password"]', el => el.value = '');
+
+ // Type credentials
await this.page.type('input[name="username"]', username);
await this.page.type('input[name="password"]', password);
// Check form values before submit
const usernameValue = await this.page.$eval('input[name="username"]', el => el.value);
+ const passwordValue = await this.page.$eval('input[name="password"]', el => el.value);
console.log(` Username field value: ${usernameValue}`);
+ console.log(` Password field has value: ${passwordValue.length > 0 ? 'yes' : 'no'} (length: ${passwordValue.length})`);
// Submit form
console.log(' Submitting form...');
@@ -177,11 +185,21 @@ class AuthHelper {
if (finalUrl.includes('/auth/login')) {
// Still on login page - check for error
- const error = await this.page.$('.alert-danger, .error-message');
+ const error = await this.page.$('.alert-danger, .error-message, .alert');
if (error) {
const errorText = await this.page.evaluate(el => el.textContent, error);
- throw new Error(`Login failed: ${errorText}`);
+ console.log(` Error message on page: ${errorText.trim()}`);
+ throw new Error(`Login failed: ${errorText.trim()}`);
}
+
+ // Check form validation errors
+ const validationErrors = await this.page.$$eval('.invalid-feedback, .help-block', els =>
+ els.map(el => el.textContent.trim()).filter(text => text.length > 0)
+ );
+ if (validationErrors.length > 0) {
+ console.log(` Validation errors: ${JSON.stringify(validationErrors)}`);
+ }
+
throw new Error('Login failed - still on login page');
}
diff --git a/tests/ui_tests/test_auth_flow.js b/tests/ui_tests/test_auth_flow.js
index 9f0a27d767..9f57ef1537 100644
--- a/tests/ui_tests/test_auth_flow.js
+++ b/tests/ui_tests/test_auth_flow.js
@@ -22,10 +22,10 @@ async function testAuthFlow() {
const baseUrl = 'http://127.0.0.1:5000';
const authHelper = new AuthHelper(page, baseUrl);
- // Test credentials
+ // Test credentials - use a strong password that meets requirements
const testUser = {
username: `testuser_${Date.now()}`, // Unique username
- password: 'testpassword123' // pragma: allowlist secret
+ password: 'Test@Pass123!' // pragma: allowlist secret - meets complexity requirements
};
console.log('🧪 Starting authentication flow test...\n');