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: Use dedicated user for change password test (test isolation)

LearningCircuite19a75929cd5
diff --git a/tests/ui_tests/test_change_password_validation.js b/tests/ui_tests/test_change_password_validation.js
index e748783886..67a936af1c 100644
--- a/tests/ui_tests/test_change_password_validation.js
+++ b/tests/ui_tests/test_change_password_validation.js
@@ -49,16 +49,24 @@ async function testChangePasswordValidation() {
console.log('🧪 Starting change password validation tests...\n');
try {
- // First, authenticate (CI uses pre-created user, local creates new one)
- console.log('📋 Setup: Authenticating...');
+ // IMPORTANT: This test must NOT use the shared CI_TEST_USER because it tests
+ // password change functionality. Even though we're only testing validation
+ // (mismatched passwords, same-as-current detection), using a dedicated user
+ // ensures we don't accidentally break other tests if validation logic changes.
+ // See AI Code Review concern about "Test Isolation Failure".
+ console.log('📋 Setup: Registering dedicated test user...');
const authHelper = new AuthHelper(page, baseUrl);
+ const dedicatedUsername = `changepwd_test_${Date.now()}`;
+ const dedicatedPassword = 'T3st!Secure#2024$LDR';
try {
- // Use ensureAuthenticated which tries CI user first, then falls back to registration
- await authHelper.ensureAuthenticated();
- console.log('✅ Authenticated\n');
+ // Always register a new user for this test to ensure isolation
+ await authHelper.register(dedicatedUsername, dedicatedPassword);
+ // Update testUser.password to match the registered user
+ testUser.password = dedicatedPassword;
+ console.log(`✅ Registered dedicated user: ${dedicatedUsername}\n`);
} catch (authError) {
- console.log(`⚠️ Could not authenticate: ${authError.message}`);
+ console.log(`⚠️ Could not register test user: ${authError.message}`);
console.log(' Skipping change password tests - requires authenticated user\n');
await browser.close();
testTimer.summary();
@@ -67,9 +75,11 @@ async function testChangePasswordValidation() {
}
// Navigate to change password page
+ // NOTE: Using 'domcontentloaded' instead of 'networkidle2' to avoid hangs
+ // caused by WebSocket/polling keeping the network active.
console.log('📄 Navigating to change password page...');
await page.goto(`${baseUrl}/auth/change-password`, {
- waitUntil: 'networkidle2',
+ waitUntil: 'domcontentloaded',
timeout: 30000
});
@@ -78,9 +88,9 @@ async function testChangePasswordValidation() {
if (currentUrl.includes('/auth/login')) {
console.log('⚠️ Redirected to login - user not authenticated');
console.log(' Attempting to login...');
- await authHelper.login(testUser.username, testUser.password);
+ await authHelper.login(dedicatedUsername, dedicatedPassword);
await page.goto(`${baseUrl}/auth/change-password`, {
- waitUntil: 'networkidle2',
+ waitUntil: 'domcontentloaded',
timeout: 30000
});
}