~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: resolve research cancellation test navigation errors (#1294)
LearningCircuit9f31e4c75c41
diff --git a/tests/ui_tests/test_research_cancellation.js b/tests/ui_tests/test_research_cancellation.jsindex 1864138835..c968427858 100644--- a/tests/ui_tests/test_research_cancellation.js+++ b/tests/ui_tests/test_research_cancellation.js@@ -1,10 +1,9 @@const puppeteer = require('puppeteer');const { getPuppeteerLaunchOptions } = require('./puppeteer_config');+const AuthHelper = require('./auth_helper');// Test configurationconst BASE_URL = 'http://127.0.0.1:5000';-const TEST_USER = `cancel_test_${Date.now()}`;-const TEST_PASSWORD = 'TestPass123!';// Colors for console outputconst colors = {@@ -34,44 +33,6 @@ async function delay(ms) {return new Promise(resolve => setTimeout(resolve, ms));}-async function registerUser(page) {- log('📝 Registering new user...', 'info');-- await page.goto(`${BASE_URL}/auth/register`, { waitUntil: 'networkidle2' });- await page.waitForSelector('#username', { timeout: 10000 });-- await page.type('#username', TEST_USER);- await page.type('#password', TEST_PASSWORD);- await page.type('#confirm_password', TEST_PASSWORD);-- // Handle potential acknowledge checkbox- const acknowledgeCheckbox = await page.$('#acknowledge');- if (acknowledgeCheckbox) {- await acknowledgeCheckbox.click();- }-- // Click submit and wait for navigation with better error handling- await Promise.all([- page.waitForNavigation({ waitUntil: 'networkidle2', timeout: 10000 }).catch(() => {- // Navigation might not happen if there's an error, check current URL- return page.url();- }),- page.click('button[type="submit"]')- ]);-- // Check if we successfully registered- const currentUrl = page.url();- if (currentUrl.includes('/auth/register')) {- // Still on registration page, likely an error- const errorMessage = await page.$eval('.error, .alert-danger', el => el.textContent).catch(() => null);- if (errorMessage) {- throw new Error(`Registration failed: ${errorMessage}`);- }- }-- log('✅ Registration successful', 'success');-}-async function startResearch(page, query) {log(`🔬 Starting research: "${query}"`, 'info');@@ -92,22 +53,39 @@ async function startResearch(page, query) {document.getElementById('query').value = q;}, query);- // Submit form - use a more flexible selector- await page.click('button[type="submit"], #submit-research, #start-research-btn');+ // Submit form and wait for potential navigation or AJAX response+ const submitButton = await page.$('button[type="submit"], #submit-research, #start-research-btn');+ if (!submitButton) {+ log('❌ Submit button not found', 'error');+ return false;+ }- // Wait for research to start- await delay(2000);+ // Click the submit button+ await submitButton.click();- // Verify research started- const progressStarted = await page.evaluate(() => {- const progressBar = document.querySelector('.progress-bar, [role="progressbar"]');- const progressText = document.querySelector('.progress-info, .progress-text');- return progressBar || progressText;- });+ // Wait for page to settle after submission+ await delay(3000);++ // Verify research started - use try-catch in case of navigation context issues+ try {+ const progressStarted = await page.evaluate(() => {+ const progressBar = document.querySelector('.progress-bar, [role="progressbar"]');+ const progressText = document.querySelector('.progress-info, .progress-text');+ return progressBar || progressText;+ });- if (progressStarted) {- log('✅ Research started successfully', 'success');- return true;+ if (progressStarted) {+ log('✅ Research started successfully', 'success');+ return true;+ }+ } catch (e) {+ // If execution context was destroyed, the page likely navigated to progress page+ // which means research started successfully+ if (e.message.includes('Execution context was destroyed')) {+ log('✅ Research started (page navigated)', 'success');+ return true;+ }+ throw e;}return false;@@ -126,8 +104,12 @@ async function testCancellation() {});try {- // Register user- await registerUser(page);+ // Register user using AuthHelper for consistent behavior+ const auth = new AuthHelper(page, BASE_URL);+ await auth.ensureAuthenticated();++ // Navigate to home page after authentication+ await page.goto(BASE_URL, { waitUntil: 'networkidle2', timeout: 10000 });// Test 1: Cancel during early stagelog('\n=== TEST 1: EARLY CANCELLATION ===', 'section');