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.

refactor: Remove redundant and obsolete test files

LearningCircuit05d541cf1438
diff --git a/tests/debug_url_utils.py b/tests/debug_url_utils.py
deleted file mode 100644
index 80d92d8696..0000000000
--- a/tests/debug_url_utils.py
+++ /dev/null
@@ -1,33 +0,0 @@
-"""Debug test for URL utility functions."""
-
-from local_deep_research.utilities.url_utils import normalize_ollama_url
-
-
-def test_url_normalization():
- """Test the normalize_ollama_url function."""
-
- test_cases = [
- ("localhost:11434", "http://localhost:11434"),
- ("127.0.0.1:11434", "http://127.0.0.1:11434"),
- ("example.com:11434", "https://example.com:11434"),
- ("http:localhost:11434", "http://localhost:11434"),
- ("https:example.com:11434", "https://example.com:11434"),
- ("http://localhost:11434", "http://localhost:11434"),
- ("https://example.com:11434", "https://example.com:11434"),
- ("//localhost:11434", "http://localhost:11434"),
- ("//example.com:11434", "https://example.com:11434"),
- ("", "http://localhost:11434"),
- ]
-
- for input_url, expected in test_cases:
- result = normalize_ollama_url(input_url)
- if result != expected:
- print(f"FAIL: Input: {input_url!r}")
- print(f" Expected: {expected!r}")
- print(f" Got: {result!r}")
- else:
- print(f"PASS: {input_url!r} -> {result!r}")
-
-
-if __name__ == "__main__":
- test_url_normalization()
diff --git a/tests/ui_tests/run_all_tests_comprehensive.js b/tests/ui_tests/run_all_tests_comprehensive.js
index bc12a2f7fc..1a3359f5c7 100644
--- a/tests/ui_tests/run_all_tests_comprehensive.js
+++ b/tests/ui_tests/run_all_tests_comprehensive.js
@@ -45,7 +45,6 @@ function getAllTestFiles() {
// Exclude our comprehensive test files
const excludeFiles = [
'test_api_key_comprehensive.js', // Already know this has issues
- 'test_api_key_debug.js', // Debug file
'test_settings_simple.js' // Debug file
];
diff --git a/tests/ui_tests/test_api_key_debug.js b/tests/ui_tests/test_api_key_debug.js
deleted file mode 100644
index fa7773fba7..0000000000
--- a/tests/ui_tests/test_api_key_debug.js
+++ /dev/null
@@ -1,227 +0,0 @@
-const puppeteer = require('puppeteer');
-const AuthHelper = require('./auth_helper');
-const { getPuppeteerLaunchOptions } = require('./puppeteer_config');
-
-// Simple debug test for API key field interaction
-(async () => {
- let browser;
-
- try {
- console.log('=== API Key Field Debug Test ===');
-
- const browser = await puppeteer.launch(getPuppeteerLaunchOptions());
-
- const page = await browser.newPage();
- await page.setViewport({ width: 1920, height: 1080 });
-
- // Enable detailed console logging
- page.on('console', msg => {
- console.log(`Browser: ${msg.text()}`);
- });
-
- // Monitor network requests
- await page.setRequestInterception(true);
- page.on('request', request => {
- if (request.url().includes('/settings/api/')) {
- console.log(`API Request: ${request.method()} ${request.url()}`);
- if (request.method() === 'PUT' || request.method() === 'POST') {
- console.log(`Request body: ${request.postData()}`);
- }
- }
- request.continue();
- });
-
- page.on('response', response => {
- if (response.url().includes('/settings/api/')) {
- console.log(`API Response: ${response.status()} ${response.url()}`);
- }
- });
-
- const authHelper = new AuthHelper(page);
-
- // Create test user
- const timestamp = Date.now();
- const testUsername = `debug_test_${timestamp}`;
- await authHelper.register(testUsername, 'testpass123');
-
- console.log('User registered, checking login status...');
-
- // Check if logged in
- const isLoggedIn = await authHelper.isLoggedIn();
- console.log(`Login status: ${isLoggedIn}`);
-
- // Get current URL
- const currentUrl = page.url();
- console.log(`Current URL after registration: ${currentUrl}`);
-
- // Navigate to settings
- console.log('Navigating to settings...');
- await page.goto('http://localhost:5000/settings', { waitUntil: 'networkidle2' });
-
- // Check URL after navigation
- const settingsUrl = page.url();
- console.log(`URL after settings navigation: ${settingsUrl}`);
-
- // If redirected to login, log in again
- if (settingsUrl.includes('/auth/login')) {
- console.log('Redirected to login, logging in...');
- await authHelper.login(testUsername, 'testpass123');
- console.log('Logged in, navigating to settings again...');
- await page.goto('http://localhost:5000/settings', { waitUntil: 'networkidle2' });
- }
-
- await new Promise(resolve => setTimeout(resolve, 2000));
-
- // Wait for settings to fully initialize
- console.log('Waiting for settings to initialize...');
- await page.waitForFunction(() => {
- // Check if event handlers are attached
- const input = document.querySelector('input[name="llm.openai_endpoint.api_key"]');
- if (!input) return false;
-
- // Check if the settings module is initialized
- return window.settings && window.settings.initialized;
- }, { timeout: 10000 }).catch(() => {
- console.log('Settings initialization check timed out');
- });
-
- // Find API key field
- console.log('Looking for API key field...');
- const apiKeyInput = await page.$('input[name="llm.openai_endpoint.api_key"]');
-
- if (!apiKeyInput) {
- console.log('API key field not found!');
-
- // Try to find any password fields
- const passwordFields = await page.evaluate(() => {
- const fields = Array.from(document.querySelectorAll('input[type="password"]'));
- return fields.map(f => ({
- name: f.name,
- id: f.id,
- placeholder: f.placeholder,
- visible: f.offsetParent !== null
- }));
- });
- console.log('Password fields found:', passwordFields);
-
- // Try to find LLM section
- const sections = await page.evaluate(() => {
- const links = Array.from(document.querySelectorAll('a, button, [role="tab"]'));
- return links.filter(l => l.textContent.toLowerCase().includes('llm')).map(l => l.textContent);
- });
- console.log('LLM sections found:', sections);
-
- return;
- }
-
- console.log('API key field found!');
-
- // Check current state
- const fieldInfo = await apiKeyInput.evaluate(el => {
- // Get bound event listeners using browser internals
- const listeners = getEventListeners ? getEventListeners(el) : {};
-
- return {
- value: el.value,
- type: el.type,
- disabled: el.disabled,
- readonly: el.readOnly,
- hasOnKeyDown: !!el.onkeydown,
- hasOnChange: !!el.onchange,
- hasOnBlur: !!el.onblur,
- dataset: Object.assign({}, el.dataset),
- classNames: el.className,
- id: el.id,
- name: el.name
- };
- });
- console.log('Field info:', JSON.stringify(fieldInfo, null, 2));
-
- // Focus and type
- console.log('Focusing field...');
- await apiKeyInput.focus();
-
- console.log('Clearing field...');
- await page.keyboard.down('Control');
- await page.keyboard.press('a');
- await page.keyboard.up('Control');
- await page.keyboard.press('Delete');
-
- console.log('Typing new value...');
- await apiKeyInput.type('test-api-key-12345');
-
- // Check if value was typed
- const typedValue = await apiKeyInput.evaluate(el => el.value);
- console.log(`Typed value: ${typedValue}`);
-
- // Try Enter key
- console.log('Pressing Enter...');
- await page.keyboard.press('Enter');
-
- // Wait and observe
- console.log('Waiting for save...');
- await new Promise(resolve => setTimeout(resolve, 3000));
-
- // Check if any save happened by looking for network activity
- const saveAttempted = await page.evaluate(() => {
- return window.lastSettingsSaveRequest || null;
- });
- console.log('Save attempted:', saveAttempted);
-
- // Try to manually trigger save using the settings module
- console.log('Trying manual save trigger...');
- const manualSaveResult = await page.evaluate(() => {
- const input = document.querySelector('input[name="llm.openai_endpoint.api_key"]');
- if (!input) return 'Input not found';
-
- // Try to find and call the save function
- if (window.settings && window.settings.saveFieldValue) {
- window.settings.saveFieldValue(input);
- return 'Called settings.saveFieldValue';
- }
-
- // Try to trigger change event
- const changeEvent = new Event('change', { bubbles: true });
- input.dispatchEvent(changeEvent);
-
- // Try to trigger blur event
- const blurEvent = new Event('blur', { bubbles: true });
- input.dispatchEvent(blurEvent);
-
- return 'Dispatched change and blur events';
- });
- console.log('Manual save result:', manualSaveResult);
-
- await new Promise(resolve => setTimeout(resolve, 2000));
-
- // Check for any changes
- const afterEnter = await page.evaluate(() => {
- const input = document.querySelector('input[name="llm.openai_endpoint.api_key"]');
- const container = input?.closest('.form-group, .settings-item');
- return {
- inputClasses: Array.from(input?.classList || []),
- containerClasses: Array.from(container?.classList || []),
- alerts: Array.from(document.querySelectorAll('.alert, .toast')).map(a => a.textContent)
- };
- });
- console.log('After Enter:', afterEnter);
-
- // Try blur
- console.log('Trying blur save...');
- await page.click('body');
- await new Promise(resolve => setTimeout(resolve, 2000));
-
- // Final check
- const finalValue = await apiKeyInput.evaluate(el => el.value);
- console.log(`Final value: ${finalValue}`);
-
- console.log('Test complete.');
-
- } catch (error) {
- console.error('Error:', error);
- } finally {
- if (browser) {
- await browser.close();
- }
- }
-})();
diff --git a/tests/ui_tests/test_logout_debug.js b/tests/ui_tests/test_logout_debug.js
deleted file mode 100644
index bc0dd26135..0000000000
--- a/tests/ui_tests/test_logout_debug.js
+++ /dev/null
@@ -1,83 +0,0 @@
-const puppeteer = require('puppeteer');
-const AuthHelper = require('./auth_helper');
-const { getPuppeteerLaunchOptions } = require('./puppeteer_config');
-
-async function testLogoutDebug() {
- let browser;
-
- try {
- const browser = await puppeteer.launch(getPuppeteerLaunchOptions());
-
- const page = await browser.newPage();
- const auth = new AuthHelper(page);
-
- // Enable console logging
- page.on('console', msg => console.log('PAGE LOG:', msg.text()));
- page.on('pageerror', error => console.log('PAGE ERROR:', error.message));
-
- // Login first
- console.log('1. Logging in...');
- await auth.ensureAuthenticated();
-
- // Wait a bit to see the page
- await page.waitForTimeout(2000);
-
- // Check what logout elements exist
- console.log('\n2. Looking for logout elements...');
-
- const logoutForm = await page.$('#logout-form');
- console.log('Found logout form:', !!logoutForm);
-
- const logoutLink = await page.$('a.logout-btn');
- console.log('Found logout link:', !!logoutLink);
-
- // Get the HTML of the logout area
- const logoutHTML = await page.evaluate(() => {
- const form = document.getElementById('logout-form');
- return form ? form.outerHTML : 'No logout form found';
- });
- console.log('\nLogout form HTML:', logoutHTML);
-
- // Try clicking the logout link
- console.log('\n3. Attempting to click logout link...');
-
- // Wait for navigation promise before clicking
- const navigationPromise = page.waitForNavigation({
- waitUntil: 'networkidle2',
- timeout: 10000
- });
-
- await page.click('a.logout-btn');
-
- // Wait for navigation
- await navigationPromise;
-
- console.log('\n4. After logout - current URL:', page.url());
-
- // Check if we're on login page
- const onLoginPage = page.url().includes('/auth/login');
- console.log('On login page:', onLoginPage);
-
- console.log('\n✅ Logout test completed successfully');
-
- } catch (error) {
- console.error('\n❌ Error during logout test:', error);
-
- // Take a screenshot
- if (browser) {
- const page = (await browser.pages())[0];
- if (page) {
- await page.screenshot({ path: 'logout_debug_error.png' });
- console.log('Screenshot saved as logout_debug_error.png');
- }
- }
- } finally {
- if (browser) {
- console.log('\nPress Enter to close browser...');
- await new Promise(resolve => process.stdin.once('data', resolve));
- await browser.close();
- }
- }
-}
-
-testLogoutDebug().catch(console.error);