~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.
Python academiaanthropicarxivbravedeep-researchencryptionhome-automationhomeserverlocallocal-deep-researchlocal-llmmistralollamaopenaipubmedresearchresearch-toolretrieval-augmented-generationsearxngself-hosted
fix: Replace all networkidle2/networkidle0 with domcontentloaded in UI tests
LearningCircuitfb74726dcf32
diff --git a/tests/ui_tests/browser_config.js b/tests/ui_tests/browser_config.jsindex b370d3f2dd..ee78f9fa77 100644--- a/tests/ui_tests/browser_config.js+++ b/tests/ui_tests/browser_config.js@@ -44,7 +44,7 @@ const BROWSER_CONFIG = {* Page initialization options*/const PAGE_CONFIG = {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 5000 // Reduced from 30000 to 5000ms};diff --git a/tests/ui_tests/check_available_models.js b/tests/ui_tests/check_available_models.jsindex 8874d3f67f..a50372dd72 100644--- a/tests/ui_tests/check_available_models.js+++ b/tests/ui_tests/check_available_models.js@@ -42,7 +42,7 @@ async function checkAvailableModels() {}// Also check what's in the model dropdown on the form- await page.goto(baseUrl, { waitUntil: 'networkidle2' });+ await page.goto(baseUrl, { waitUntil: 'domcontentloaded' });const formModels = await page.evaluate(() => {const select = document.querySelector('#model, select[name="model"]');diff --git a/tests/ui_tests/library/test_collections_page.js b/tests/ui_tests/library/test_collections_page.jsindex f1fdd431d1..e0ee941b5d 100644--- a/tests/ui_tests/library/test_collections_page.js+++ b/tests/ui_tests/library/test_collections_page.js@@ -33,9 +33,9 @@ async function runTests() {page.setDefaultTimeout(TIMEOUT);const authHelper = new AuthHelper(page, BASE_URL);- await page.goto(BASE_URL, { waitUntil: 'networkidle2' });+ await page.goto(BASE_URL, { waitUntil: 'domcontentloaded' });await authHelper.ensureAuthenticated();- await page.goto(`${BASE_URL}/library/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/library/`, { waitUntil: 'domcontentloaded' });const pageTitle = await page.title();if (!pageTitle.toLowerCase().includes('library') && !pageTitle.toLowerCase().includes('collection')) {@@ -58,9 +58,9 @@ async function runTests() {page.setDefaultTimeout(TIMEOUT);const authHelper = new AuthHelper(page, BASE_URL);- await page.goto(BASE_URL, { waitUntil: 'networkidle2' });+ await page.goto(BASE_URL, { waitUntil: 'domcontentloaded' });await authHelper.ensureAuthenticated();- await page.goto(`${BASE_URL}/library/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/library/`, { waitUntil: 'domcontentloaded' });// Wait a bit for page to fully loadawait delay(1000);@@ -86,9 +86,9 @@ async function runTests() {page.setDefaultTimeout(TIMEOUT);const authHelper = new AuthHelper(page, BASE_URL);- await page.goto(BASE_URL, { waitUntil: 'networkidle2' });+ await page.goto(BASE_URL, { waitUntil: 'domcontentloaded' });await authHelper.ensureAuthenticated();- await page.goto(`${BASE_URL}/library/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/library/`, { waitUntil: 'domcontentloaded' });await delay(1000);const pageContent = await page.content();@@ -113,9 +113,9 @@ async function runTests() {page.setDefaultTimeout(TIMEOUT);const authHelper = new AuthHelper(page, BASE_URL);- await page.goto(BASE_URL, { waitUntil: 'networkidle2' });+ await page.goto(BASE_URL, { waitUntil: 'domcontentloaded' });await authHelper.ensureAuthenticated();- await page.goto(`${BASE_URL}/library/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/library/`, { waitUntil: 'domcontentloaded' });await delay(1000);@@ -145,9 +145,9 @@ async function runTests() {page.setDefaultTimeout(TIMEOUT);const authHelper = new AuthHelper(page, BASE_URL);- await page.goto(BASE_URL, { waitUntil: 'networkidle2' });+ await page.goto(BASE_URL, { waitUntil: 'domcontentloaded' });await authHelper.ensureAuthenticated();- await page.goto(`${BASE_URL}/library/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/library/`, { waitUntil: 'domcontentloaded' });await delay(1000);@@ -178,9 +178,9 @@ async function runTests() {page.setDefaultTimeout(TIMEOUT);const authHelper = new AuthHelper(page, BASE_URL);- await page.goto(BASE_URL, { waitUntil: 'networkidle2' });+ await page.goto(BASE_URL, { waitUntil: 'domcontentloaded' });await authHelper.ensureAuthenticated();- await page.goto(`${BASE_URL}/library/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/library/`, { waitUntil: 'domcontentloaded' });await delay(1000);diff --git a/tests/ui_tests/library/test_library_documents.js b/tests/ui_tests/library/test_library_documents.jsindex 5e5e6181b0..03ec49227d 100644--- a/tests/ui_tests/library/test_library_documents.js+++ b/tests/ui_tests/library/test_library_documents.js@@ -34,7 +34,7 @@ describe('Library Documents UI Tests', () => {authHelper = new AuthHelper(page, BASE_URL);// Authenticate before each test- await page.goto(BASE_URL, { waitUntil: 'networkidle2' });+ await page.goto(BASE_URL, { waitUntil: 'domcontentloaded' });await authHelper.ensureAuthenticated();});@@ -46,14 +46,14 @@ describe('Library Documents UI Tests', () => {describe('Library Page Load', () => {test('should load library page', async () => {- await page.goto(`${BASE_URL}/library/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/library/`, { waitUntil: 'domcontentloaded' });const pageTitle = await page.title();expect(pageTitle.toLowerCase()).toContain('library');});test('should display navigation elements', async () => {- await page.goto(`${BASE_URL}/library/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/library/`, { waitUntil: 'domcontentloaded' });// Check for main navigation elementsconst mainNav = await page.$('nav, .navbar, .sidebar');@@ -67,7 +67,7 @@ describe('Library Documents UI Tests', () => {});test('should show search functionality', async () => {- await page.goto(`${BASE_URL}/library/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/library/`, { waitUntil: 'domcontentloaded' });// Look for search inputconst searchInput = await page.$(@@ -81,7 +81,7 @@ describe('Library Documents UI Tests', () => {describe('Document Search', () => {test('should allow entering search query', async () => {- await page.goto(`${BASE_URL}/library/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/library/`, { waitUntil: 'domcontentloaded' });const searchInput = await page.$('input[type="search"], input[name="query"], .search-input'@@ -99,7 +99,7 @@ describe('Library Documents UI Tests', () => {});test('should submit search form', async () => {- await page.goto(`${BASE_URL}/library/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/library/`, { waitUntil: 'domcontentloaded' });const searchInput = await page.$('input[type="search"], input[name="query"], .search-input'@@ -127,7 +127,7 @@ describe('Library Documents UI Tests', () => {describe('Document Viewer', () => {test('should open document when clicked', async () => {- await page.goto(`${BASE_URL}/library/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/library/`, { waitUntil: 'domcontentloaded' });// Look for a document linkconst documentLink = await page.$(@@ -150,7 +150,7 @@ describe('Library Documents UI Tests', () => {test('should display document content', async () => {// Navigate to a specific document if available- await page.goto(`${BASE_URL}/library/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/library/`, { waitUntil: 'domcontentloaded' });const documentLink = await page.$('.document-item a, [data-document-id]'@@ -174,7 +174,7 @@ describe('Library Documents UI Tests', () => {describe('Document Actions', () => {test('should show document action menu', async () => {- await page.goto(`${BASE_URL}/library/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/library/`, { waitUntil: 'domcontentloaded' });// Look for action menu buttonconst actionButton = await page.$(@@ -191,7 +191,7 @@ describe('Library Documents UI Tests', () => {});test('should allow document deletion', async () => {- await page.goto(`${BASE_URL}/library/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/library/`, { waitUntil: 'domcontentloaded' });// Look for delete optionconst deleteButton = await page.$(@@ -210,7 +210,7 @@ describe('Library Documents UI Tests', () => {describe('RAG Integration', () => {test('should show RAG search option', async () => {- await page.goto(`${BASE_URL}/library/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/library/`, { waitUntil: 'domcontentloaded' });// Look for RAG/semantic search optionconst ragOption = await page.$(@@ -229,7 +229,7 @@ describe('Library Documents UI Tests', () => {});test('should show index status', async () => {- await page.goto(`${BASE_URL}/library/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/library/`, { waitUntil: 'domcontentloaded' });// Look for index status indicatorconst indexStatus = await page.$(@@ -244,7 +244,7 @@ describe('Library Documents UI Tests', () => {describe('Download Manager', () => {test('should show download queue link', async () => {- await page.goto(`${BASE_URL}/library/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/library/`, { waitUntil: 'domcontentloaded' });// Look for download queue linkconst downloadQueueLink = await page.$(@@ -261,7 +261,7 @@ describe('Library Documents UI Tests', () => {test('should open download queue page', async () => {// Navigate directly to downloads page- await page.goto(`${BASE_URL}/library/downloads`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/library/downloads`, { waitUntil: 'domcontentloaded' });const pageTitle = await page.title();const pageContent = await page.content();diff --git a/tests/ui_tests/mobile/test_layout_bugs_ci.js b/tests/ui_tests/mobile/test_layout_bugs_ci.jsindex 896803f8c9..2ad5647cf0 100644--- a/tests/ui_tests/mobile/test_layout_bugs_ci.js+++ b/tests/ui_tests/mobile/test_layout_bugs_ci.js@@ -675,7 +675,7 @@ class LayoutBugTests {const url = `${BASE_URL}${pageInfo.path}`;try {- await page.goto(url, { waitUntil: 'networkidle2', timeout: 30000 });+ await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 30000 });// Small delay to ensure CSS is fully appliedawait new Promise(resolve => setTimeout(resolve, 500));} catch (error) {diff --git a/tests/ui_tests/mobile/test_mobile_all_pages_ci.js b/tests/ui_tests/mobile/test_mobile_all_pages_ci.jsindex 1e52154e6e..235808d003 100644--- a/tests/ui_tests/mobile/test_mobile_all_pages_ci.js+++ b/tests/ui_tests/mobile/test_mobile_all_pages_ci.js@@ -106,7 +106,7 @@ class MobileAllPagesTest {try {await page.goto(CONFIG.baseUrl + pageInfo.path, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: CONFIG.timeout});@@ -208,7 +208,7 @@ class MobileAllPagesTest {try {// Navigate to a page with mobile navawait page.goto(CONFIG.baseUrl + '/news/', {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: CONFIG.timeout});await new Promise(resolve => setTimeout(resolve, 1000));diff --git a/tests/ui_tests/mobile/test_mobile_diagnostic.js b/tests/ui_tests/mobile/test_mobile_diagnostic.jsindex 93fa555740..4b89d42b3d 100644--- a/tests/ui_tests/mobile/test_mobile_diagnostic.js+++ b/tests/ui_tests/mobile/test_mobile_diagnostic.js@@ -136,7 +136,7 @@ class MobileDiagnosticTool {try {await page.goto(this.baseUrl + pageInfo.path, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});@@ -319,7 +319,7 @@ class MobileDiagnosticTool {try {// Navigate to a page with mobile navawait page.goto(this.baseUrl + '/news/', {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});await new Promise(resolve => setTimeout(resolve, 1000));diff --git a/tests/ui_tests/mobile/test_mobile_nav_all_pages.js b/tests/ui_tests/mobile/test_mobile_nav_all_pages.jsindex 908900682d..6bef3551ef 100644--- a/tests/ui_tests/mobile/test_mobile_nav_all_pages.js+++ b/tests/ui_tests/mobile/test_mobile_nav_all_pages.js@@ -112,7 +112,7 @@ async function testAllPages() {try {await page.goto(baseUrl + pageInfo.path, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});@@ -189,7 +189,7 @@ async function testAllPages() {try {await page.goto(baseUrl + pageInfo.path, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});@@ -259,7 +259,7 @@ async function testAllPages() {try {// Go back to home- await page.goto(baseUrl, { waitUntil: 'networkidle2' });+ await page.goto(baseUrl, { waitUntil: 'domcontentloaded' });// Try to open sheet menuconst sheetOpened = await page.evaluate(() => {diff --git a/tests/ui_tests/mobile/test_mobile_navigation_authenticated.js b/tests/ui_tests/mobile/test_mobile_navigation_authenticated.jsindex c409f5dd53..9afeaefe31 100644--- a/tests/ui_tests/mobile/test_mobile_navigation_authenticated.js+++ b/tests/ui_tests/mobile/test_mobile_navigation_authenticated.js@@ -40,7 +40,7 @@ async function testAuthenticatedPages() {for (const pageInfo of pages) {console.log(`\nTesting ${pageInfo.name}...`);await page.goto(baseUrl + pageInfo.path, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});diff --git a/tests/ui_tests/mobile/test_mobile_navigation_ci.js b/tests/ui_tests/mobile/test_mobile_navigation_ci.jsindex 6bb21c4b89..2e5bb319fa 100644--- a/tests/ui_tests/mobile/test_mobile_navigation_ci.js+++ b/tests/ui_tests/mobile/test_mobile_navigation_ci.js@@ -404,7 +404,7 @@ class MobileNavTestRunner {// Navigate to home page after authenticationawait page.goto(TEST_CONFIG.baseUrl, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: TEST_CONFIG.timeout});@@ -461,13 +461,13 @@ class MobileNavTestRunner {async () => {// Navigate to login pageawait page.goto(`${TEST_CONFIG.baseUrl}/auth/login`, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: TEST_CONFIG.timeout});await MobileNavAssertions.assertNoOverlap(page);// Navigate back to homeawait page.goto(TEST_CONFIG.baseUrl, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: TEST_CONFIG.timeout});},@@ -506,7 +506,7 @@ class MobileNavTestRunner {// Click History tabconst [response] = await Promise.all([- page.waitForNavigation({ waitUntil: 'networkidle2', timeout: 10000 }),+ page.waitForNavigation({ waitUntil: 'domcontentloaded', timeout: 10000 }),page.click('.ldr-mobile-nav-tab[data-tab-id="history"]')]);diff --git a/tests/ui_tests/mobile/test_mobile_ui_comprehensive.js b/tests/ui_tests/mobile/test_mobile_ui_comprehensive.jsindex 3943f84ceb..d27e8624a9 100644--- a/tests/ui_tests/mobile/test_mobile_ui_comprehensive.js+++ b/tests/ui_tests/mobile/test_mobile_ui_comprehensive.js@@ -79,7 +79,7 @@ class MobileUITester {for (const pageInfo of pages) {console.log(`\n 📄 ${pageInfo.name}`);await page.goto(this.baseUrl + pageInfo.path, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});diff --git a/tests/ui_tests/test_api_key_comprehensive.js b/tests/ui_tests/test_api_key_comprehensive.jsindex 1185418f3f..d9ad733dca 100644--- a/tests/ui_tests/test_api_key_comprehensive.js+++ b/tests/ui_tests/test_api_key_comprehensive.js@@ -114,7 +114,7 @@ async function runComprehensiveApiKeyTest() {log('Test 2: Accessing Settings Page', 'test');try {await page.goto(`${TEST_CONFIG.baseUrl}/settings`, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: TEST_CONFIG.timeout});@@ -326,7 +326,7 @@ async function runComprehensiveApiKeyTest() {// Verify by reloading the pagelog('Reloading page to check persistence...', 'info');- await page.reload({ waitUntil: 'networkidle2' });+ await page.reload({ waitUntil: 'domcontentloaded' });// Find the field againapiKeyInput = null;@@ -399,7 +399,7 @@ async function runComprehensiveApiKeyTest() {log('Test 6: Testing Multiple Changes', 'test');try {// Reload to get fresh state- await page.reload({ waitUntil: 'networkidle2' });+ await page.reload({ waitUntil: 'domcontentloaded' });// Find field againapiKeyInput = null;diff --git a/tests/ui_tests/test_api_key_enter_save.js b/tests/ui_tests/test_api_key_enter_save.jsindex 7397c80fb7..10faf00ba2 100644--- a/tests/ui_tests/test_api_key_enter_save.js+++ b/tests/ui_tests/test_api_key_enter_save.js@@ -78,7 +78,7 @@ function log(message, type = 'info') {// Navigate to settings pagelog('Navigating to settings page...', 'info');- await page.goto(`${BASE_URL}/settings`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/settings`, { waitUntil: 'domcontentloaded' });// Wait a bit for page to fully loadawait new Promise(resolve => setTimeout(resolve, 2000));@@ -170,7 +170,7 @@ function log(message, type = 'info') {// Check if the value persisted by reloadinglog('Reloading page to check persistence...', 'info');- await page.reload({ waitUntil: 'networkidle2' });+ await page.reload({ waitUntil: 'domcontentloaded' });await new Promise(resolve => setTimeout(resolve, 2000));// Find the input againdiff --git a/tests/ui_tests/test_api_key_integrated.js b/tests/ui_tests/test_api_key_integrated.jsindex c43d79351c..40352af0eb 100644--- a/tests/ui_tests/test_api_key_integrated.js+++ b/tests/ui_tests/test_api_key_integrated.js@@ -153,7 +153,7 @@ async function getCSRFToken(page) {// Test 2: Navigate to settings and wait for full loadlog('Test 2: Navigate to Settings', 'info');- await page.goto(`${BASE_URL}/settings`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/settings`, { waitUntil: 'domcontentloaded' });await page.waitForSelector('input, button', { visible: true, timeout: 10000 });// Test 3: Get CSRF token@@ -259,7 +259,7 @@ async function getCSRFToken(page) {log('Test 6: Persistence Verification', 'info');// Reload page- await page.reload({ waitUntil: 'networkidle2' });+ await page.reload({ waitUntil: 'domcontentloaded' });// Check if value persisted via APIconst persistenceCheck = await page.evaluate(async (key) => {@@ -294,7 +294,7 @@ async function getCSRFToken(page) {// Test 8: Research functionality with API keylog('Test 8: Research Functionality Test', 'info');- await page.goto(BASE_URL, { waitUntil: 'networkidle2' });+ await page.goto(BASE_URL, { waitUntil: 'domcontentloaded' });const searchInput = await page.$('input[name="query"]');if (searchInput) {diff --git a/tests/ui_tests/test_api_key_settings.js b/tests/ui_tests/test_api_key_settings.jsindex def6996644..1b4aee78fa 100644--- a/tests/ui_tests/test_api_key_settings.js+++ b/tests/ui_tests/test_api_key_settings.js@@ -74,7 +74,7 @@ function log(message, type = 'info') {// Navigate to settings pagelog('Navigating to settings page...', 'info');- await page.goto(`${BASE_URL}/settings`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/settings`, { waitUntil: 'domcontentloaded' });// Check if we got redirected to loginconst currentUrl = page.url();@@ -83,7 +83,7 @@ function log(message, type = 'info') {// Try to login againawait authHelper.login(testUsername, testPassword);// Navigate to settings again- await page.goto(`${BASE_URL}/settings`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/settings`, { waitUntil: 'domcontentloaded' });}// Wait for settings to load - try multiple selectors@@ -228,7 +228,7 @@ function log(message, type = 'info') {// Refresh page to verify persistencelog('Refreshing page to verify API key persistence...', 'info');- await page.reload({ waitUntil: 'networkidle2' });+ await page.reload({ waitUntil: 'domcontentloaded' });await new Promise(resolve => setTimeout(resolve, 1000));// Navigate back to OpenAI Endpoint settings@@ -336,7 +336,7 @@ function log(message, type = 'info') {// Try to trigger a research to see if the API key is being usedlog('Testing if API key is accessible for research...', 'info');- await page.goto(`${BASE_URL}/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/`, { waitUntil: 'domcontentloaded' });// Get final statusconst finalUrl = page.url();diff --git a/tests/ui_tests/test_api_key_simple_verify.js b/tests/ui_tests/test_api_key_simple_verify.jsindex c820a6c1cf..458da76b07 100644--- a/tests/ui_tests/test_api_key_simple_verify.js+++ b/tests/ui_tests/test_api_key_simple_verify.js@@ -23,7 +23,7 @@ const { getPuppeteerLaunchOptions } = require('./puppeteer_config');console.log(`✓ User ${testUser} created\n`);// Get CSRF token- await page.goto(`${BASE_URL}/settings`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/settings`, { waitUntil: 'domcontentloaded' });const csrfToken = await page.evaluate(() => {const meta = document.querySelector('meta[name="csrf-token"]');return meta ? meta.content : null;diff --git a/tests/ui_tests/test_api_key_via_api.js b/tests/ui_tests/test_api_key_via_api.jsindex 5a8c59b5f0..c81536c080 100644--- a/tests/ui_tests/test_api_key_via_api.js+++ b/tests/ui_tests/test_api_key_via_api.js@@ -151,8 +151,8 @@ const { getPuppeteerLaunchOptions } = require('./puppeteer_config');// Test 6: Check if settings persist after navigationconsole.log('\nTest 6: Checking persistence after navigation...');- await page.goto(`${BASE_URL}/`, { waitUntil: 'networkidle2' });- await page.goto(`${BASE_URL}/settings`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/`, { waitUntil: 'domcontentloaded' });+ await page.goto(`${BASE_URL}/settings`, { waitUntil: 'domcontentloaded' });const finalCheck = await page.evaluate(async () => {const response = await fetch('/api/settings', {diff --git a/tests/ui_tests/test_autocomplete_selection.js b/tests/ui_tests/test_autocomplete_selection.jsindex 9210903b20..4d14e641ed 100644--- a/tests/ui_tests/test_autocomplete_selection.js+++ b/tests/ui_tests/test_autocomplete_selection.js@@ -49,7 +49,7 @@ async function runTests() {page.setDefaultTimeout(TEST_TIMEOUT);await authHelper.ensureAuthenticated();- await page.goto(`${config.baseUrl}/`, { waitUntil: 'networkidle2' });+ await page.goto(`${config.baseUrl}/`, { waitUntil: 'domcontentloaded' });// Wait for and click the model inputawait page.waitForSelector('#model', { visible: true });@@ -133,7 +133,7 @@ async function runTests() {page.setDefaultTimeout(TEST_TIMEOUT);await authHelper.ensureAuthenticated();- await page.goto(`${config.baseUrl}/`, { waitUntil: 'networkidle2' });+ await page.goto(`${config.baseUrl}/`, { waitUntil: 'domcontentloaded' });// Wait for and click the search engine inputawait page.waitForSelector('#search_engine', { visible: true });@@ -209,7 +209,7 @@ async function runTests() {page.setDefaultTimeout(TEST_TIMEOUT);await authHelper.ensureAuthenticated();- await page.goto(`${config.baseUrl}/`, { waitUntil: 'networkidle2' });+ await page.goto(`${config.baseUrl}/`, { waitUntil: 'domcontentloaded' });// Test with model dropdownawait page.waitForSelector('#model', { visible: true });@@ -262,7 +262,7 @@ async function runTests() {page.setDefaultTimeout(TEST_TIMEOUT);await authHelper.ensureAuthenticated();- await page.goto(`${config.baseUrl}/`, { waitUntil: 'networkidle2' });+ await page.goto(`${config.baseUrl}/`, { waitUntil: 'domcontentloaded' });// Open model dropdownawait page.waitForSelector('#model', { visible: true });diff --git a/tests/ui_tests/test_benchmark_settings.js b/tests/ui_tests/test_benchmark_settings.jsindex 893661a9ea..e0f1e7c019 100644--- a/tests/ui_tests/test_benchmark_settings.js+++ b/tests/ui_tests/test_benchmark_settings.js@@ -154,7 +154,7 @@ async function keepSessionAlive(page) {logInfo(`Saved ${cookies.length} cookies from session`);// Navigate to settings - use consistent base URL- await page.goto(`${BASE_URL}/settings`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/settings`, { waitUntil: 'domcontentloaded' });await delay(2000);// Check if we're still logged in (not redirected to login)@@ -165,13 +165,13 @@ async function keepSessionAlive(page) {// Restore cookies and try againawait page.setCookie(...cookies);- await page.goto(`${BASE_URL}/settings`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/settings`, { waitUntil: 'domcontentloaded' });await delay(1000);// If still redirected, login againif (page.url().includes('/auth/login')) {await auth.login(username, password);- await page.goto(`${BASE_URL}/settings`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/settings`, { waitUntil: 'domcontentloaded' });await delay(2000);}}@@ -375,7 +375,7 @@ async function keepSessionAlive(page) {const settingsCookies = await page.cookies();logInfo(`Saved ${settingsCookies.length} cookies before benchmark navigation`);- await page.goto(`${BASE_URL}/benchmark`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/benchmark`, { waitUntil: 'domcontentloaded' });await delay(2000);// Check if we were redirected to login@@ -386,13 +386,13 @@ async function keepSessionAlive(page) {// Restore cookies and try againawait page.setCookie(...settingsCookies);- await page.goto(`${BASE_URL}/benchmark`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/benchmark`, { waitUntil: 'domcontentloaded' });await delay(1000);// If still redirected, login againif (page.url().includes('/auth/login')) {await auth.login(username, password);- await page.goto(`${BASE_URL}/benchmark`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/benchmark`, { waitUntil: 'domcontentloaded' });await delay(2000);}}diff --git a/tests/ui_tests/test_check_search_engines.js b/tests/ui_tests/test_check_search_engines.jsindex 3f9b2d520e..139499843d 100644--- a/tests/ui_tests/test_check_search_engines.js+++ b/tests/ui_tests/test_check_search_engines.js@@ -38,7 +38,7 @@ async function checkSearchEngines() {console.log('Search engines response:', JSON.stringify(searchEngines, null, 2));// Also check what's in the form- await page.goto(baseUrl, { waitUntil: 'networkidle2' });+ await page.goto(baseUrl, { waitUntil: 'domcontentloaded' });await page.waitForSelector('#query', { timeout: 10000 });const formSearchEngines = await page.evaluate(() => {diff --git a/tests/ui_tests/test_check_user_database.js b/tests/ui_tests/test_check_user_database.jsindex 4b98957ffd..6d3cb006f4 100644--- a/tests/ui_tests/test_check_user_database.js+++ b/tests/ui_tests/test_check_user_database.js@@ -22,7 +22,7 @@ async function checkUserDatabase() {console.log('✅ Logged in\n');// Check database tables via settings page- await page.goto(`${baseUrl}/settings/`, { waitUntil: 'networkidle2' });+ await page.goto(`${baseUrl}/settings/`, { waitUntil: 'domcontentloaded' });// Try to get some indication of what's in the databaseconst pageContent = await page.evaluate(() => {@@ -41,7 +41,7 @@ async function checkUserDatabase() {// Try to check research history to see if research table existsconsole.log('\n📋 Checking history page...');- await page.goto(`${baseUrl}/history/`, { waitUntil: 'networkidle2' });+ await page.goto(`${baseUrl}/history/`, { waitUntil: 'domcontentloaded' });const historyContent = await page.evaluate(() => {return {@@ -63,7 +63,7 @@ async function checkUserDatabase() {// Try a simple research submission to see what error we getconsole.log('\n🧪 Testing research submission for database errors...');- await page.goto(baseUrl, { waitUntil: 'networkidle2' });+ await page.goto(baseUrl, { waitUntil: 'domcontentloaded' });const testResult = await page.evaluate(async () => {try {diff --git a/tests/ui_tests/test_checkbox_settings.js b/tests/ui_tests/test_checkbox_settings.jsindex b3a8860b5a..96f78e1fb5 100644--- a/tests/ui_tests/test_checkbox_settings.js+++ b/tests/ui_tests/test_checkbox_settings.js@@ -264,7 +264,7 @@ const waitForAjaxResponse = async (responses, timeout = TEST_CONFIG.TIMEOUTS.AJAconsole.log('✅ User authenticated successfully');// Navigate to settings page- await page.goto(TEST_CONFIG.URLS.SETTINGS, { waitUntil: 'networkidle2' });+ await page.goto(TEST_CONFIG.URLS.SETTINGS, { waitUntil: 'domcontentloaded' });// Check if we got redirected back to login and need to login againif (page.url().includes(TEST_CONFIG.URLS.LOGIN)) {@@ -274,7 +274,7 @@ const waitForAjaxResponse = async (responses, timeout = TEST_CONFIG.TIMEOUTS.AJA// Try to use the default test user that might already existtry {await authHelper.login('testuser', 'T3st!Secure#2024$LDR');- await page.goto(TEST_CONFIG.URLS.SETTINGS, { waitUntil: 'networkidle2' });+ await page.goto(TEST_CONFIG.URLS.SETTINGS, { waitUntil: 'domcontentloaded' });} catch (loginError) {console.log('⚠️ Default user login failed, test may not work with settings');}diff --git a/tests/ui_tests/test_context_overflow.js b/tests/ui_tests/test_context_overflow.jsindex be1a55d132..ff6c211c4f 100644--- a/tests/ui_tests/test_context_overflow.js+++ b/tests/ui_tests/test_context_overflow.js@@ -53,7 +53,7 @@ describe('Context Overflow Dashboard Tests', () => {// Navigate to context overflow pageconsole.log(' Navigating to context overflow page...');await page.goto(`${BASE_URL}/metrics/context-overflow`, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});@@ -166,7 +166,7 @@ describe('Context Overflow Dashboard Tests', () => {// Navigate to context overflow pageawait page.goto(`${BASE_URL}/metrics/context-overflow`, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});diff --git a/tests/ui_tests/test_context_overflow_standalone.js b/tests/ui_tests/test_context_overflow_standalone.jsindex 2072630ef1..8f2172c18b 100644--- a/tests/ui_tests/test_context_overflow_standalone.js+++ b/tests/ui_tests/test_context_overflow_standalone.js@@ -67,7 +67,7 @@ async function testContextOverflow() {// Navigate to context overflow pageconsole.log('📊 Navigating to context overflow page...');await page.goto(`${BASE_URL}/metrics/context-overflow`, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});console.log('✅ Page loaded');diff --git a/tests/ui_tests/test_cost_analytics.js b/tests/ui_tests/test_cost_analytics.jsindex 69a3e44d28..668f1f6699 100644--- a/tests/ui_tests/test_cost_analytics.js+++ b/tests/ui_tests/test_cost_analytics.js@@ -73,7 +73,7 @@ async function testCostAnalytics() {console.log('📄 Navigating to cost analytics page...');const response = await page.goto('http://127.0.0.1:5000/metrics/costs', {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});diff --git a/tests/ui_tests/test_error_recovery.js b/tests/ui_tests/test_error_recovery.jsindex d6dcf7284d..f7f3b40ffc 100644--- a/tests/ui_tests/test_error_recovery.js+++ b/tests/ui_tests/test_error_recovery.js@@ -51,7 +51,7 @@ async function testErrorRecovery() {// Test 1: Invalid research query (empty)console.log('📝 Test 1: Empty query validation');try {- await page.goto(`${BASE_URL}/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/`, { waitUntil: 'domcontentloaded' });// Try to submit empty queryconst submitButton = await page.$('button[type="submit"]');@@ -110,7 +110,7 @@ async function testErrorRecovery() {console.log('\n📝 Test 3: Settings page loads without JS errors');try {const preErrorCount = consoleErrors.length;- await page.goto(`${BASE_URL}/settings/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/settings/`, { waitUntil: 'domcontentloaded' });// Wait for page to stabilizeawait new Promise(resolve => setTimeout(resolve, 2000));@@ -139,7 +139,7 @@ async function testErrorRecovery() {// Test 4: Metrics page graceful degradationconsole.log('\n📝 Test 4: Metrics page handles no data gracefully');try {- await page.goto(`${BASE_URL}/metrics/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/metrics/`, { waitUntil: 'domcontentloaded' });// Page should load even with no metrics dataconst hasMetricsContent = await page.evaluate(() => {@@ -162,7 +162,7 @@ async function testErrorRecovery() {// Test 5: History page with no historyconsole.log('\n📝 Test 5: History page handles empty history');try {- await page.goto(`${BASE_URL}/history/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/history/`, { waitUntil: 'domcontentloaded' });// Should show empty state or messageconst pageContent = await page.content();@@ -187,14 +187,14 @@ async function testErrorRecovery() {// Test 6: API error simulationconsole.log('\n📝 Test 6: UI handles API errors');try {- await page.goto(`${BASE_URL}/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/`, { waitUntil: 'domcontentloaded' });// Monitor for failed requestslet failedRequests = 0;page.on('requestfailed', () => failedRequests++);// Try to trigger an API call (visit settings)- await page.goto(`${BASE_URL}/settings/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/settings/`, { waitUntil: 'domcontentloaded' });await new Promise(resolve => setTimeout(resolve, 2000));// Check page is still usablediff --git a/tests/ui_tests/test_followup_research.js b/tests/ui_tests/test_followup_research.jsindex acca88794f..bb3ce85f01 100644--- a/tests/ui_tests/test_followup_research.js+++ b/tests/ui_tests/test_followup_research.js@@ -46,7 +46,7 @@ async function createAndCompleteResearch(page, query) {log(`🔬 Creating research: "${query}"`, 'info');// Navigate to home page- await page.goto(BASE_URL, { waitUntil: 'networkidle2' });+ await page.goto(BASE_URL, { waitUntil: 'domcontentloaded' });// Wait for and fill the query inputawait page.waitForSelector('#query', { timeout: 10000 });@@ -62,7 +62,7 @@ async function createAndCompleteResearch(page, query) {// Submit the researchlog('📤 Submitting research...', 'info');await Promise.all([- page.waitForNavigation({ waitUntil: 'networkidle2', timeout: TIMEOUT }),+ page.waitForNavigation({ waitUntil: 'domcontentloaded', timeout: TIMEOUT }),page.click('button[type="submit"]')]);@@ -101,7 +101,7 @@ async function createAndCompleteResearch(page, query) {const viewResultsBtn = await page.$('a[href*="/results/"], .view-results-btn, button.btn-primary');if (viewResultsBtn) {await Promise.all([- page.waitForNavigation({ waitUntil: 'networkidle2', timeout: TIMEOUT }),+ page.waitForNavigation({ waitUntil: 'domcontentloaded', timeout: TIMEOUT }),viewResultsBtn.click()]);}@@ -163,7 +163,7 @@ async function testFollowUpResearch() {const currentUrl = page.url();if (!currentUrl.includes(`/results/${researchId}`)) {log('📍 Navigating to results page...', 'info');- await page.goto(`${BASE_URL}/results/${researchId}`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/results/${researchId}`, { waitUntil: 'domcontentloaded' });}// Wait for results to load@@ -339,7 +339,7 @@ async function testFollowUpResearch() {// Wait for navigation after clickingawait page.waitForNavigation({- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: TIMEOUT}).catch(e => {log('⚠️ Navigation timeout, checking URL...', 'warning');diff --git a/tests/ui_tests/test_metrics_full_flow.js b/tests/ui_tests/test_metrics_full_flow.jsindex 97e6aee9b9..3b77cedd7f 100644--- a/tests/ui_tests/test_metrics_full_flow.js+++ b/tests/ui_tests/test_metrics_full_flow.js@@ -67,7 +67,7 @@ async function startAndCompleteResearch(page, query) {log(`Starting research: "${query}"`, 'info');// Navigate to home page- await page.goto(`${BASE_URL}/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/`, { waitUntil: 'domcontentloaded' });// Wait for research formawait page.waitForSelector('#research-form', { visible: true });@@ -159,7 +159,7 @@ async function captureMetricsDashboard(page) {log('Navigating to metrics dashboard...', 'info');// Navigate to metrics page- await page.goto(`${BASE_URL}/metrics`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/metrics`, { waitUntil: 'domcontentloaded' });// Wait for page to loadawait page.waitForSelector('body');@@ -344,13 +344,13 @@ async function testMetricsFullFlow() {log('\n=== GENERATING ADDITIONAL ACTIVITY ===', 'section');// Visit history- await page.goto(`${BASE_URL}/history`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/history`, { waitUntil: 'domcontentloaded' });log('Visited history page', 'success');await new Promise(r => setTimeout(r, 2000));// Go back to researchif (researchId) {- await page.goto(`${BASE_URL}/research/${researchId}`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/research/${researchId}`, { waitUntil: 'domcontentloaded' });log('Returned to research page', 'success');await new Promise(r => setTimeout(r, 2000));}diff --git a/tests/ui_tests/test_metrics_screenshot.js b/tests/ui_tests/test_metrics_screenshot.jsindex f699f71c46..a40e0d3cd1 100644--- a/tests/ui_tests/test_metrics_screenshot.js+++ b/tests/ui_tests/test_metrics_screenshot.js@@ -16,7 +16,7 @@ async function captureMetricsScreenshot() {console.log('Navigating to metrics...');await page.goto('http://127.0.0.1:5000/metrics/', {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});diff --git a/tests/ui_tests/test_metrics_subpages.js b/tests/ui_tests/test_metrics_subpages.jsindex 9e93a54832..fe3d9276dc 100644--- a/tests/ui_tests/test_metrics_subpages.js+++ b/tests/ui_tests/test_metrics_subpages.js@@ -26,7 +26,7 @@ async function captureMetricsSubpages() {console.log(`\nNavigating to ${subpage.name}...`);await page.goto(subpage.url, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});diff --git a/tests/ui_tests/test_metrics_visibility.js b/tests/ui_tests/test_metrics_visibility.jsindex 7928e89aea..09eb90a424 100644--- a/tests/ui_tests/test_metrics_visibility.js+++ b/tests/ui_tests/test_metrics_visibility.js@@ -41,7 +41,7 @@ async function testMetricsPage() {// Navigate to metrics pageconsole.log('Navigating to metrics page...');- await page.goto(`${BASE_URL}/metrics/`, { waitUntil: 'networkidle0' });+ await page.goto(`${BASE_URL}/metrics/`, { waitUntil: 'domcontentloaded' });// Wait a bit for any dynamic content to loadawait delay(2000);diff --git a/tests/ui_tests/test_metrics_with_llm.js b/tests/ui_tests/test_metrics_with_llm.jsindex 0659b98ca0..d0650fd908 100644--- a/tests/ui_tests/test_metrics_with_llm.js+++ b/tests/ui_tests/test_metrics_with_llm.js@@ -71,7 +71,7 @@ const { setupDefaultModel } = require('./model_helper');console.log('\n=== CHECKING INITIAL METRICS ===\n');// Navigate to metrics page to check if the LLM call was tracked- await page.goto('http://127.0.0.1:5000/metrics', { waitUntil: 'networkidle2' });+ await page.goto('http://127.0.0.1:5000/metrics', { waitUntil: 'domcontentloaded' });const initialMetrics = await page.evaluate(() => {const content = {@@ -87,7 +87,7 @@ const { setupDefaultModel } = require('./model_helper');console.log('\n=== CONFIGURING SETTINGS FOR FASTER TEST ===\n');// Navigate to settings page to configure iterations and questions- await page.goto('http://127.0.0.1:5000/settings', { waitUntil: 'networkidle2' });+ await page.goto('http://127.0.0.1:5000/settings', { waitUntil: 'domcontentloaded' });// Set iterations to 1await page.evaluate(() => {@@ -122,7 +122,7 @@ const { setupDefaultModel } = require('./model_helper');console.log('\n=== STARTING RESEARCH ===\n');// Navigate to home- await page.goto('http://127.0.0.1:5000/', { waitUntil: 'networkidle2' });+ await page.goto('http://127.0.0.1:5000/', { waitUntil: 'domcontentloaded' });// Fill form with a simple queryawait page.type('#query', 'What is Node.js?');@@ -148,7 +148,7 @@ const { setupDefaultModel } = require('./model_helper');await page.click('button[type="submit"]');// Wait for navigation- await page.waitForNavigation({ waitUntil: 'networkidle2' });+ await page.waitForNavigation({ waitUntil: 'domcontentloaded' });// Check where we ended upconst url = page.url();@@ -195,7 +195,7 @@ const { setupDefaultModel } = require('./model_helper');console.log('\n=== CHECKING METRICS AFTER RESEARCH ===\n');// Navigate to metrics page- await page.goto('http://127.0.0.1:5000/metrics', { waitUntil: 'networkidle2' });+ await page.goto('http://127.0.0.1:5000/metrics', { waitUntil: 'domcontentloaded' });// Wait for metrics to loadawait new Promise(resolve => setTimeout(resolve, 2000));@@ -266,7 +266,7 @@ const { setupDefaultModel } = require('./model_helper');// Also check the cost analytics pageconsole.log('\n=== CHECKING COST ANALYTICS ===\n');- await page.goto('http://127.0.0.1:5000/metrics/costs', { waitUntil: 'networkidle2' });+ await page.goto('http://127.0.0.1:5000/metrics/costs', { waitUntil: 'domcontentloaded' });const costMetrics = await page.evaluate(() => {const content = {diff --git a/tests/ui_tests/test_mobile_metrics.js b/tests/ui_tests/test_mobile_metrics.jsindex 08ee5d64f3..e4859f8ab6 100644--- a/tests/ui_tests/test_mobile_metrics.js+++ b/tests/ui_tests/test_mobile_metrics.js@@ -33,7 +33,7 @@ async function testMobileMetrics() {console.log(`\nTesting ${pageInfo.name}...`);await page.goto(pageInfo.url, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});diff --git a/tests/ui_tests/test_network_requests.js b/tests/ui_tests/test_network_requests.jsindex d1fedf5646..2593d41493 100644--- a/tests/ui_tests/test_network_requests.js+++ b/tests/ui_tests/test_network_requests.js@@ -51,7 +51,7 @@ async function testNetworkRequests() {console.log('📄 Loading research results page and tracking requests...');await page.goto('http://127.0.0.1:5000/research/results/67', {- waitUntil: 'networkidle0',+ waitUntil: 'domcontentloaded',timeout: 15000});diff --git a/tests/ui_tests/test_news_breaking_table.js b/tests/ui_tests/test_news_breaking_table.jsindex 4fd12d5465..f60e4cf7f2 100644--- a/tests/ui_tests/test_news_breaking_table.js+++ b/tests/ui_tests/test_news_breaking_table.js@@ -61,7 +61,7 @@ async function testNewsBreakingTable() {// Test 1: Load news pageconsole.log('📄 Test 1: Loading news page');await page.goto(`${BASE_URL}/news`, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});@@ -159,7 +159,7 @@ async function testNewsBreakingTable() {const subscriptionUrl = `${BASE_URL}/news/subscriptions/new?${params.toString()}`;await page.goto(subscriptionUrl, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});diff --git a/tests/ui_tests/test_news_js_loads.js b/tests/ui_tests/test_news_js_loads.jsindex 0cb563ce98..e08ce71ebd 100644--- a/tests/ui_tests/test_news_js_loads.js+++ b/tests/ui_tests/test_news_js_loads.js@@ -34,7 +34,7 @@ async function testNewsJsLoads() {// Load news pageconsole.log('📄 Loading news page...');await page.goto(`${BASE_URL}/news`, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});diff --git a/tests/ui_tests/test_news_subscription_form.js b/tests/ui_tests/test_news_subscription_form.jsindex 2f7bbd888f..b12412b6ed 100644--- a/tests/ui_tests/test_news_subscription_form.js+++ b/tests/ui_tests/test_news_subscription_form.js@@ -52,7 +52,7 @@ async function testNewsSubscriptionForm() {// Test 1: Load subscription form pageconsole.log('📄 Test 1: Loading subscription form page');await page.goto(`${BASE_URL}/news/subscriptions/new`, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});diff --git a/tests/ui_tests/test_rate_limiting_chart.js b/tests/ui_tests/test_rate_limiting_chart.jsindex a5ef6b47b1..6ab7f57ca1 100644--- a/tests/ui_tests/test_rate_limiting_chart.js+++ b/tests/ui_tests/test_rate_limiting_chart.js@@ -16,7 +16,7 @@ async function testRateLimitingChart() {console.log('Navigating to metrics...');await page.goto('http://127.0.0.1:5000/metrics/', {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});diff --git a/tests/ui_tests/test_rate_limiting_settings.js b/tests/ui_tests/test_rate_limiting_settings.jsindex a6b85858fc..16aedbf136 100644--- a/tests/ui_tests/test_rate_limiting_settings.js+++ b/tests/ui_tests/test_rate_limiting_settings.js@@ -32,7 +32,7 @@ async function testRateLimiting() {// Test 1: Test login rate limiting (5 per 15 minutes)console.log('\n🔍 Test 1: Login endpoint should be rate limited (5 attempts per 15 min)');- await page.goto(`${baseUrl}/auth/login`, { waitUntil: 'networkidle0' });+ await page.goto(`${baseUrl}/auth/login`, { waitUntil: 'domcontentloaded' });let loginAttempts = 0;let rateLimitTriggered = false;@@ -90,7 +90,7 @@ async function testRateLimiting() {// Use a different page context to reset cookies/sessionconst page2 = await browser.newPage();- await page2.goto(`${baseUrl}/auth/register`, { waitUntil: 'networkidle0' });+ await page2.goto(`${baseUrl}/auth/register`, { waitUntil: 'domcontentloaded' });let registrationAttempts = 0;let regRateLimitTriggered = false;diff --git a/tests/ui_tests/test_research_diagnosis.js b/tests/ui_tests/test_research_diagnosis.jsindex 5f0aeb3bfe..f7616f6e9e 100644--- a/tests/ui_tests/test_research_diagnosis.js+++ b/tests/ui_tests/test_research_diagnosis.js@@ -79,7 +79,7 @@ async function testResearchDiagnosis() {// Step 2: Go to home pageawait page.goto(baseUrl, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});diff --git a/tests/ui_tests/test_research_diagnostic.js b/tests/ui_tests/test_research_diagnostic.jsindex f564b991ce..5a596dd018 100644--- a/tests/ui_tests/test_research_diagnostic.js+++ b/tests/ui_tests/test_research_diagnostic.js@@ -22,7 +22,7 @@ async function runDiagnostic() {console.log('✅ Logged in\n');// Navigate to home- await page.goto(baseUrl, { waitUntil: 'networkidle2' });+ await page.goto(baseUrl, { waitUntil: 'domcontentloaded' });await page.waitForSelector('#query', { timeout: 10000 });// Test 1: Direct API call with minimal datadiff --git a/tests/ui_tests/test_research_form.js b/tests/ui_tests/test_research_form.jsindex 8c0ffc55d3..0d5fb734f9 100644--- a/tests/ui_tests/test_research_form.js+++ b/tests/ui_tests/test_research_form.js@@ -24,7 +24,7 @@ async function testResearchForm() {// Navigate to home pageawait page.goto(baseUrl, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});@@ -136,7 +136,7 @@ async function testResearchForm() {// Set up navigation promiseconst navPromise = page.waitForNavigation({- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 10000}).catch(e => console.log('Navigation timeout:', e.message));diff --git a/tests/ui_tests/test_research_search_analysis.js b/tests/ui_tests/test_research_search_analysis.jsindex 61edace47a..f978f684ad 100644--- a/tests/ui_tests/test_research_search_analysis.js+++ b/tests/ui_tests/test_research_search_analysis.js@@ -44,7 +44,7 @@ async function analyzeSearchFunctionality() {// Step 2: Navigate to research pageconsole.log('📄 Step 2: Navigating to research page...');- await page.goto(`${BASE_URL}/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/`, { waitUntil: 'domcontentloaded' });// Check if research form existsconst researchForm = await page.$('#research-form');diff --git a/tests/ui_tests/test_research_searxng.js b/tests/ui_tests/test_research_searxng.jsindex 546e951efb..5a88422490 100644--- a/tests/ui_tests/test_research_searxng.js+++ b/tests/ui_tests/test_research_searxng.js@@ -45,7 +45,7 @@ async function testResearchWithSearxng() {console.log('✅ Logged in\n');// Navigate to home- await page.goto(BASE_URL, { waitUntil: 'networkidle2' });+ await page.goto(BASE_URL, { waitUntil: 'domcontentloaded' });// Fill formconsole.log('📝 Filling research form...');diff --git a/tests/ui_tests/test_research_status.js b/tests/ui_tests/test_research_status.jsindex 5f994e8822..5c6e441ce7 100644--- a/tests/ui_tests/test_research_status.js+++ b/tests/ui_tests/test_research_status.js@@ -18,7 +18,7 @@ async function testResearchStatus() {console.log(`Checking research status for ID: ${researchId}`);await page.goto(`http://127.0.0.1:5000/progress/${researchId}`, {- waitUntil: 'networkidle2'+ waitUntil: 'domcontentloaded'});// Wait a bit for the page to loaddiff --git a/tests/ui_tests/test_research_verify.js b/tests/ui_tests/test_research_verify.jsindex c228c4f47b..38706ee2b5 100644--- a/tests/ui_tests/test_research_verify.js+++ b/tests/ui_tests/test_research_verify.js@@ -25,7 +25,7 @@ async function testResearchVerify() {// First, check history to see existing researchesconsole.log('📋 Checking existing history...');await page.goto(`${baseUrl}/history/`, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});@@ -37,7 +37,7 @@ async function testResearchVerify() {// Go back to homeawait page.goto(baseUrl, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});@@ -86,7 +86,7 @@ async function testResearchVerify() {console.log(`📍 Navigating to: ${researchUrl}`);await page.goto(researchUrl, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});@@ -118,7 +118,7 @@ async function testResearchVerify() {await new Promise(resolve => setTimeout(resolve, 10000));// Refresh to see updates- await page.reload({ waitUntil: 'networkidle2' });+ await page.reload({ waitUntil: 'domcontentloaded' });// Check status againconst statusUpdate = await page.evaluate(() => {@@ -141,7 +141,7 @@ async function testResearchVerify() {// Check history againconsole.log('\n📋 Checking history after research...');await page.goto(`${baseUrl}/history/`, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});diff --git a/tests/ui_tests/test_research_workflow.js b/tests/ui_tests/test_research_workflow.jsindex 62f05d115f..647ab4d4b8 100644--- a/tests/ui_tests/test_research_workflow.js+++ b/tests/ui_tests/test_research_workflow.js@@ -44,7 +44,7 @@ async function testResearchWorkflow() {// Test 1: Home page loads with research formconsole.log('📝 Test 1: Research form loads correctly');try {- await page.goto(`${BASE_URL}/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/`, { waitUntil: 'domcontentloaded' });// Check for query inputconst queryInput = await page.$('#query, input[name="query"]');@@ -107,7 +107,7 @@ async function testResearchWorkflow() {// Test 4: Query can be enteredconsole.log('\n📝 Test 4: Query input accepts text');try {- await page.goto(`${BASE_URL}/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/`, { waitUntil: 'domcontentloaded' });const queryInput = await page.$('#query, input[name="query"]');if (queryInput) {@@ -135,7 +135,7 @@ async function testResearchWorkflow() {// Test 5: Research submission workflowconsole.log('\n📝 Test 5: Research submission workflow');try {- await page.goto(`${BASE_URL}/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/`, { waitUntil: 'domcontentloaded' });// Configure modelawait setupDefaultModel(page);@@ -205,7 +205,7 @@ async function testResearchWorkflow() {// Test 6: History page shows research historyconsole.log('\n📝 Test 6: History page is accessible');try {- await page.goto(`${BASE_URL}/history/`, { waitUntil: 'networkidle2' });+ await page.goto(`${BASE_URL}/history/`, { waitUntil: 'domcontentloaded' });const hasHistoryContent = await page.evaluate(() => {const body = document.body;diff --git a/tests/ui_tests/test_responsive_ui_comprehensive.js b/tests/ui_tests/test_responsive_ui_comprehensive.jsindex ec1d9e3a99..403011792b 100644--- a/tests/ui_tests/test_responsive_ui_comprehensive.js+++ b/tests/ui_tests/test_responsive_ui_comprehensive.js@@ -116,7 +116,7 @@ class ResponsiveUITester {// Navigate to login pageconst loginUrl = `${this.baseUrl}/auth/login`;await this.page.goto(loginUrl, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});@@ -191,7 +191,7 @@ class ResponsiveUITester {// Also capture registration page screenshotconst registerUrl = `${this.baseUrl}/auth/register`;await this.page.goto(registerUrl, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});@@ -220,7 +220,7 @@ class ResponsiveUITester {try {const response = await this.page.goto(url, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});@@ -240,7 +240,7 @@ class ResponsiveUITester {if (authResult.authenticated) {// Try navigating to the page againawait this.page.goto(url, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});}diff --git a/tests/ui_tests/test_settings_errors.js b/tests/ui_tests/test_settings_errors.jsindex e587e9a798..05b4130a3c 100644--- a/tests/ui_tests/test_settings_errors.js+++ b/tests/ui_tests/test_settings_errors.js@@ -44,7 +44,7 @@ async function testSettingsChange() {try {console.log('🔧 Testing settings change functionality...');await page.goto('http://127.0.0.1:5000/settings/', {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});diff --git a/tests/ui_tests/test_settings_exploration.js b/tests/ui_tests/test_settings_exploration.jsindex 05e327deee..914993041c 100644--- a/tests/ui_tests/test_settings_exploration.js+++ b/tests/ui_tests/test_settings_exploration.js@@ -24,7 +24,7 @@ const { getPuppeteerLaunchOptions } = require('./puppeteer_config');console.log('User registered and logged in');// Navigate to settings- await page.goto('http://localhost:5000/settings', { waitUntil: 'networkidle2' });+ await page.goto('http://localhost:5000/settings', { waitUntil: 'domcontentloaded' });await new Promise(resolve => setTimeout(resolve, 2000));// Get page titlediff --git a/tests/ui_tests/test_settings_page.js b/tests/ui_tests/test_settings_page.jsindex 1dddb3d7d8..5e33db7dd2 100644--- a/tests/ui_tests/test_settings_page.js+++ b/tests/ui_tests/test_settings_page.js@@ -37,7 +37,7 @@ async function testSettingsPage() {console.log('Navigating to settings page...');await page.goto('http://127.0.0.1:5000/settings/', {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});diff --git a/tests/ui_tests/test_settings_save.js b/tests/ui_tests/test_settings_save.jsindex 19edbd8a46..f1fc2e4fd7 100644--- a/tests/ui_tests/test_settings_save.js+++ b/tests/ui_tests/test_settings_save.js@@ -54,7 +54,7 @@ async function testSettingsSave() {try {console.log('🔧 Testing settings save functionality...');await page.goto('http://127.0.0.1:5000/settings/', {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});diff --git a/tests/ui_tests/test_settings_simple.js b/tests/ui_tests/test_settings_simple.jsindex ba788fa9fc..621f7ae6a2 100644--- a/tests/ui_tests/test_settings_simple.js+++ b/tests/ui_tests/test_settings_simple.js@@ -42,14 +42,14 @@ const { getPuppeteerLaunchOptions } = require('./puppeteer_config');console.log('User registered');// Navigate to settings- await page.goto('http://localhost:5000/settings', { waitUntil: 'networkidle2' });+ await page.goto('http://localhost:5000/settings', { waitUntil: 'domcontentloaded' });// Check if we're on settings pageconst url = page.url();if (url.includes('/auth/login')) {console.log('Redirected to login, logging in...');await authHelper.login(testUsername, 'testpass123');- await page.goto('http://localhost:5000/settings', { waitUntil: 'networkidle2' });+ await page.goto('http://localhost:5000/settings', { waitUntil: 'domcontentloaded' });}console.log('On settings page');diff --git a/tests/ui_tests/test_simple_auth.js b/tests/ui_tests/test_simple_auth.jsindex b5abc63cb2..13cf386174 100644--- a/tests/ui_tests/test_simple_auth.js+++ b/tests/ui_tests/test_simple_auth.js@@ -26,7 +26,7 @@ async function testSimpleAuth() {// Test 1: Can we reach the login page?console.log('📄 Test 1: Accessing login page');await page.goto(`${baseUrl}/auth/login`, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});@@ -36,7 +36,7 @@ async function testSimpleAuth() {// Test 2: Try registrationconsole.log('\n📝 Test 2: Registration');await page.goto(`${baseUrl}/auth/register`, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});@@ -51,7 +51,7 @@ async function testSimpleAuth() {// Submitconsole.log('Submitting registration form...');await Promise.all([- page.waitForNavigation({ waitUntil: 'networkidle2' }),+ page.waitForNavigation({ waitUntil: 'domcontentloaded' }),page.click('button[type="submit"]')]);@@ -75,7 +75,7 @@ async function testSimpleAuth() {// Test 4: Try to access settings (protected page)console.log('\n🔒 Test 4: Accessing protected page');await page.goto(`${baseUrl}/settings/`, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});diff --git a/tests/ui_tests/test_simple_metrics.js b/tests/ui_tests/test_simple_metrics.jsindex 9811db77a0..3b89f3550c 100644--- a/tests/ui_tests/test_simple_metrics.js+++ b/tests/ui_tests/test_simple_metrics.js@@ -10,7 +10,7 @@ async function testMetricsDashboard() {try {// Navigate to login page- await page.goto('http://127.0.0.1:5000/auth/login', { waitUntil: 'networkidle0' });+ await page.goto('http://127.0.0.1:5000/auth/login', { waitUntil: 'domcontentloaded' });// Login with test userconst username = 'test_' + Date.now();@@ -26,12 +26,12 @@ async function testMetricsDashboard() {await page.click('button[type="submit"]');// Wait for redirect to home- await page.waitForNavigation({ waitUntil: 'networkidle0' });+ await page.waitForNavigation({ waitUntil: 'domcontentloaded' });console.log('✅ Registration successful');// Navigate to metrics pageconsole.log('📊 Navigating to metrics dashboard...');- await page.goto('http://127.0.0.1:5000/metrics/', { waitUntil: 'networkidle0' });+ await page.goto('http://127.0.0.1:5000/metrics/', { waitUntil: 'domcontentloaded' });// Check if metrics page loadedawait page.waitForSelector('.metrics-container', { timeout: 5000 });diff --git a/tests/ui_tests/test_star_reviews.js b/tests/ui_tests/test_star_reviews.jsindex c10b0ef9f6..5982aeed08 100644--- a/tests/ui_tests/test_star_reviews.js+++ b/tests/ui_tests/test_star_reviews.js@@ -58,7 +58,7 @@ async function testStarReviews() {// First test navigation from metrics pageawait page.goto('http://127.0.0.1:5000/metrics/', {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});@@ -71,11 +71,11 @@ async function testStarReviews() {await starReviewsLink.click();// Wait for navigation- await page.waitForNavigation({ waitUntil: 'networkidle2' });+ await page.waitForNavigation({ waitUntil: 'domcontentloaded' });} else {console.log('⚠️ Star reviews link not found, navigating directly...');await page.goto('http://127.0.0.1:5000/metrics/star-reviews', {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});}diff --git a/tests/ui_tests/test_toast_notifications.js b/tests/ui_tests/test_toast_notifications.jsindex 67c5fe451d..2cfd56b5ee 100644--- a/tests/ui_tests/test_toast_notifications.js+++ b/tests/ui_tests/test_toast_notifications.js@@ -117,7 +117,7 @@ const TEST_CONFIG = {// Navigate to settingsconsole.log('📄 Navigating to settings page...');await page.goto(TEST_CONFIG.URLS.SETTINGS, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: TEST_CONFIG.TIMEOUTS.NAVIGATION});@@ -130,7 +130,7 @@ const TEST_CONFIG = {console.log('⚠️ Redirected to login, attempting login...');await authHelper.login(testUser, testPassword);await page.goto(TEST_CONFIG.URLS.SETTINGS, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: TEST_CONFIG.TIMEOUTS.NAVIGATION});currentUrl = page.url();diff --git a/tests/ui_tests/test_ui_screenshots.js b/tests/ui_tests/test_ui_screenshots.jsindex 41c5315e56..da751d3f75 100644--- a/tests/ui_tests/test_ui_screenshots.js+++ b/tests/ui_tests/test_ui_screenshots.js@@ -36,7 +36,7 @@ async function captureUIScreenshots() {for (const pageInfo of pages) {console.log(`📸 Capturing ${pageInfo.description}...`);- await page.goto(pageInfo.url, { waitUntil: 'networkidle2' });+ await page.goto(pageInfo.url, { waitUntil: 'domcontentloaded' });await new Promise(resolve => setTimeout(resolve, 1000)); // Wait for any animationsconst screenshotPath = path.join(screenshotDir, `${pageInfo.name}.png`);diff --git a/tests/ui_tests/tests/news/test_subscription_form.js b/tests/ui_tests/tests/news/test_subscription_form.jsindex 910cccb7c4..11439774a5 100644--- a/tests/ui_tests/tests/news/test_subscription_form.js+++ b/tests/ui_tests/tests/news/test_subscription_form.js@@ -70,7 +70,7 @@ describe('News Subscription Form Tests', () => {test('should load subscription form page', async () => {console.log('Navigating to subscription form...');await page.goto(`${BASE_URL}/news/subscriptions/new`, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});@@ -94,7 +94,7 @@ describe('News Subscription Form Tests', () => {// Navigate to subscription formawait page.goto(`${BASE_URL}/news/subscriptions/new`, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});@@ -120,7 +120,7 @@ describe('News Subscription Form Tests', () => {// Navigate to subscription formawait page.goto(`${BASE_URL}/news/subscriptions/new`, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});@@ -151,7 +151,7 @@ describe('News Subscription Form Tests', () => {// Navigate to subscription formawait page.goto(`${BASE_URL}/news/subscriptions/new`, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});@@ -236,7 +236,7 @@ describe('News Subscription Form Tests', () => {// Navigate to subscription formawait page.goto(`${BASE_URL}/news/subscriptions/new`, {- waitUntil: 'networkidle2',+ waitUntil: 'domcontentloaded',timeout: 30000});