~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
test(ui-tests): real assertions for crud operations (dead-field audit) (#4677)
LearningCircuit4c3b8c218b9c
diff --git a/tests/ui_tests/test_crud_operations_ci.js b/tests/ui_tests/test_crud_operations_ci.jsindex 869bb08d2f..8942c5c73c 100644--- a/tests/ui_tests/test_crud_operations_ci.js+++ b/tests/ui_tests/test_crud_operations_ci.js@@ -7,8 +7,19 @@* Run: node test_crud_operations_ci.js*/+const { readFileSync } = require('fs');+const { join } = require('path');+const { setupTest, teardownTest, TestResults, log, delay, navigateTo, withTimeout, findActionButton } = require('./test_lib');+// Parse strategy names from the source of truth (constants.py::AVAILABLE_STRATEGIES)+// at module load so this list can't drift if an id is renamed or a new strategy added.+const _CONSTANTS_PY = readFileSync(+ join(__dirname, '..', '..', 'src', 'local_deep_research', 'constants.py'),+ 'utf8'+);+const KNOWN_STRATEGIES = [..._CONSTANTS_PY.matchAll(/"name":\s*"([^"]+)"/g)].map(m => m[1]);+// ============================================================================// Collection CRUD Tests// ============================================================================@@ -292,22 +303,31 @@ const SubscriptionCrudTests = {const result = await page.evaluate(() => {const sel = document.querySelector('#subscription-strategy');if (!sel) return { exists: false };- const options = Array.from(sel.options).map(o => o.text);+ // The template renders <option value="{{ s.name }}">{{ s.label }}</option>+ // from the server-side AVAILABLE_STRATEGIES constant (constants.py),+ // so the option *values* are stable strategy ids regardless of LLM.+ const values = Array.from(sel.options).map(o => o.value);return {exists: true,- optionCount: options.length,- options: options.slice(0, 6),+ optionCount: values.length,+ values,};});if (!result.exists) {return { passed: false, message: '#subscription-strategy select missing on /news/subscriptions/new' };}+ // Assert a real contract, not merely "non-empty": the strategy dropdown+ // must offer at least two choices and include at least one known+ // strategy id from constants.py::AVAILABLE_STRATEGIES. KNOWN_STRATEGIES+ // is parsed from constants.py at module load (see top of file).+ const matched = KNOWN_STRATEGIES.filter(s => result.values.includes(s));+ const passed = result.optionCount >= 2 && matched.length > 0;return {- passed: result.optionCount > 0,- message: result.optionCount > 0- ? `Strategy options (${result.optionCount}): ${result.options.join(', ')}`- : 'Strategy select is empty'+ passed,+ message: passed+ ? `Strategy dropdown ok (${result.optionCount} options, known: ${matched.join(', ')})`+ : `Strategy dropdown contract failed (count=${result.optionCount}, values=[${result.values.slice(0, 6).join(', ')}], knownMatched=${matched.length})`};},@@ -612,68 +632,18 @@ const DocumentCrudTests = {} finally {await deleteCollection(page, collId);}- },-- async bulkDeleteSelection(page, baseUrl) {- // Without at least one document the library page renders an- // empty-state placeholder and no row checkboxes — the old- // selectors (input[type=checkbox][name*=select] / .bulk-select /- // .select-all) couldn't find anything anyway. Seed a fixture- // document so the bulk-selection surface is actually present,- // then check for a row checkbox AND the bulk action affordance.-- // Land on an app page first so seedCollection / uploadFixtureDocument- // can read the CSRF meta tag, rather than depending on the page state- // the previous test happened to leave behind.- await navigateTo(page, `${baseUrl}/library/collections`);- const collId = (await seedCollection(page))?.id;- if (!collId) {- return { passed: false, message: 'Could not seed collection for bulk-select test' };- }- try {- const upload = await uploadFixtureDocument(page, collId);- if (!upload.ok) {- return { passed: false, message: `Could not upload fixture document (status=${upload.status})` };- }-- await navigateTo(page, `${baseUrl}/library/?collection=${collId}`);- await page.waitForSelector('.ldr-btn-delete-doc', { timeout: 5000 });-- const result = await page.evaluate(() => {- const rowCheckboxes = document.querySelectorAll(- 'input[type="checkbox"][name*="select"], ' +- '.bulk-select, ' +- '.select-all, ' +- 'th input[type="checkbox"], ' +- '.ldr-doc-checkbox'- );- const bulkDeleteBtn = document.querySelector(- 'button[class*="bulk-delete"], ' +- '.bulk-actions button, ' +- '.delete-selected, ' +- '#bulk-delete-btn'- );- return {- checkboxCount: rowCheckboxes.length,- hasBulkDeleteBtn: !!bulkDeleteBtn,- };- });-- if (result.checkboxCount === 0 && !result.hasBulkDeleteBtn) {- // No checkboxes AND no bulk-delete button: the listing- // doesn't expose a bulk-selection surface even with docs- // present. Skip with a precise message — different from- // the old "no documents" SKIP which masked this case.- return { passed: null, skipped: true, message: 'Library listing has no per-row checkboxes and no bulk-action button (feature not implemented for this view)' };- }- return {- passed: true,- message: `Bulk-selection surface present (checkboxes=${result.checkboxCount}, bulkAction=${result.hasBulkDeleteBtn})`,- };- } finally {- await deleteCollection(page, collId);- }}++ // NOTE: the former bulkDeleteSelection test was removed (not skipped).+ // The /library document listing (templates/pages/library.html) renders+ // server-side document cards with only per-card delete buttons+ // (.ldr-btn-delete-blob / .ldr-btn-delete-doc) — there are NO per-row+ // checkboxes, no select-all control, and no bulk-action button anywhere+ // on that view. The bulkDeleteDocuments() helper in+ // static/js/deletion/delete_manager.js takes an explicit id array and is+ // never wired to a selection surface on this page. The old test therefore+ // SKIPped on the main path for a feature that does not exist here; per the+ // dead-field audit we delete it rather than carry a permanent skip.};// ============================================================================@@ -790,7 +760,6 @@ async function main() {log.section('Document CRUD');await run('Documents', 'Document Upload Form Exists', (p, u) => DocumentCrudTests.documentUploadFormExists(p, u));await run('Documents', 'Document Delete Confirmation', (p, u) => DocumentCrudTests.documentDeleteConfirmation(p, u));- await run('Documents', 'Bulk Delete Selection', (p, u) => DocumentCrudTests.bulkDeleteSelection(p, u));} catch (error) {log.error(`Fatal error: ${error.message}`);