~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(playwright): expand mobile UI coverage for auth and settings pages
LearningCircuitcd69b48d76f4
diff --git a/tests/ui_tests/playwright/tests/all-pages-mobile.spec.js b/tests/ui_tests/playwright/tests/all-pages-mobile.spec.jsindex 1bfc30ed1f..48eb5fa018 100644--- a/tests/ui_tests/playwright/tests/all-pages-mobile.spec.js+++ b/tests/ui_tests/playwright/tests/all-pages-mobile.spec.js@@ -16,6 +16,7 @@* 4. /news/ - News Feed* 5. /library/ - Library* 6. /metrics/ - Metrics Dashboard+ * 7. /benchmark/ - Benchmark** Note: Authentication is handled by auth.setup.js via storageState*/@@ -37,6 +38,7 @@ const PAGES = [{ path: '/news/', name: 'News Feed', priority: 'high' },{ path: '/library/', name: 'Library', priority: 'high' },{ path: '/metrics/', name: 'Metrics Dashboard', priority: 'high' },+ { path: '/benchmark/', name: 'Benchmark', priority: 'medium' },{ path: '/metrics/context-overflow', name: 'Context Overflow', priority: 'medium' },{ path: '/metrics/star-reviews', name: 'Star Reviews', priority: 'medium' },{ path: '/metrics/costs', name: 'Cost Analytics', priority: 'medium' },diff --git a/tests/ui_tests/playwright/tests/auth-pages-mobile.spec.js b/tests/ui_tests/playwright/tests/auth-pages-mobile.spec.jsnew file mode 100644index 0000000000..b65b372d03--- /dev/null+++ b/tests/ui_tests/playwright/tests/auth-pages-mobile.spec.js@@ -0,0 +1,378 @@+/**+ * Auth Pages Mobile Tests+ *+ * Tests for authentication pages (login/register) on mobile devices.+ * These pages are tested WITHOUT authentication to verify unauthenticated+ * user experience.+ *+ * Pages tested:+ * 1. /auth/login - Login page+ * 2. /auth/register - Registration page+ */++import { test, expect } from '@playwright/test';+const {+ ensureSheetsClosed,+ MIN_TOUCH_TARGET,+} = require('./helpers/mobile-utils');++// Auth pages configuration+const AUTH_PAGES = [+ { path: '/auth/login', name: 'Login' },+ { path: '/auth/register', name: 'Register' },+];++// ============================================+// AUTH PAGES - UNAUTHENTICATED TESTS+// ============================================++test.describe('Auth Pages Mobile', () => {+ // Clear authentication state for these tests+ test.use({ storageState: { cookies: [], origins: [] } });++ // ============================================+ // NO HORIZONTAL OVERFLOW TESTS+ // ============================================++ test.describe('No Horizontal Overflow', () => {+ for (const pageInfo of AUTH_PAGES) {+ test(`${pageInfo.name} - no horizontal overflow`, async ({ page }) => {+ await page.goto(pageInfo.path);+ await page.waitForLoadState('networkidle');++ const hasOverflow = await page.evaluate(() =>+ document.documentElement.scrollWidth > window.innerWidth+ );++ if (hasOverflow) {+ const overflowInfo = await page.evaluate(() => {+ const elements = [];+ document.querySelectorAll('*').forEach((el) => {+ const rect = el.getBoundingClientRect();+ if (rect.right > window.innerWidth) {+ elements.push({+ tag: el.tagName.toLowerCase(),+ class: el.className,+ id: el.id,+ width: Math.round(rect.width),+ right: Math.round(rect.right),+ overflow: Math.round(rect.right - window.innerWidth),+ });+ }+ });+ return elements.slice(0, 5);+ });+ console.log('Overflowing elements:', JSON.stringify(overflowInfo, null, 2));+ }++ expect(hasOverflow, `${pageInfo.name} should have no horizontal overflow`).toBe(false);+ });+ }+ });++ // ============================================+ // FORM TOUCH TARGET TESTS+ // ============================================++ test.describe('Form Touch Targets', () => {+ for (const pageInfo of AUTH_PAGES) {+ test(`${pageInfo.name} - form inputs meet touch target requirements`, async ({ page, isMobile }, testInfo) => {+ if (!isMobile) {+ test.skip();+ return;+ }++ // Skip on tablets - different touch target requirements+ const isTablet = testInfo.project.name.includes('iPad');+ if (isTablet) {+ test.skip();+ return;+ }++ await page.goto(pageInfo.path);+ await page.waitForLoadState('networkidle');++ // Check form inputs have adequate height+ const inputs = page.locator('input[type="text"], input[type="password"], input[type="email"]');+ const inputCount = await inputs.count();++ for (let i = 0; i < inputCount; i++) {+ const input = inputs.nth(i);+ const box = await input.boundingBox();++ expect(box).toBeTruthy();+ expect(+ box.height,+ `Input ${i + 1} on ${pageInfo.name} should have height >= ${MIN_TOUCH_TARGET}px`+ ).toBeGreaterThanOrEqual(MIN_TOUCH_TARGET);+ }+ });++ test(`${pageInfo.name} - submit button meets touch target requirements`, async ({ page, isMobile }, testInfo) => {+ if (!isMobile) {+ test.skip();+ return;+ }++ const isTablet = testInfo.project.name.includes('iPad');+ if (isTablet) {+ test.skip();+ return;+ }++ await page.goto(pageInfo.path);+ await page.waitForLoadState('networkidle');++ const submitButton = page.locator('button[type="submit"]');+ await expect(submitButton).toBeVisible();++ const box = await submitButton.boundingBox();+ expect(box).toBeTruthy();+ expect(box.height, `Submit button should have height >= ${MIN_TOUCH_TARGET}px`).toBeGreaterThanOrEqual(MIN_TOUCH_TARGET);+ });+ }+ });++ // ============================================+ // PAGE LOADS WITHOUT ERRORS+ // ============================================++ test.describe('Basic Load Tests', () => {+ for (const pageInfo of AUTH_PAGES) {+ test(`${pageInfo.name} - loads without errors`, async ({ page }) => {+ const errors = [];+ page.on('console', (msg) => {+ if (msg.type() === 'error') {+ errors.push(msg.text());+ }+ });++ const pageErrors = [];+ page.on('pageerror', (error) => {+ pageErrors.push(error.message);+ });++ await page.goto(pageInfo.path);+ await page.waitForLoadState('networkidle');++ const criticalErrors = errors.filter(+ (err) =>+ !err.includes('favicon') &&+ !err.includes('404') &&+ !err.includes('Failed to load resource')+ );++ expect(pageErrors.length, `${pageInfo.name} should have no page errors`).toBe(0);+ expect(+ criticalErrors.length,+ `${pageInfo.name} should have no critical console errors: ${criticalErrors.join(', ')}`+ ).toBe(0);+ });+ }+ });++ // ============================================+ // PAGE-SPECIFIC CONTENT TESTS+ // ============================================++ test.describe('Login Page Content', () => {+ test('displays login form correctly', async ({ page }) => {+ await page.goto('/auth/login');+ await page.waitForLoadState('networkidle');++ // Check for page title/header+ await expect(page.locator('h1')).toContainText(/Local Deep Research|Login/i);++ // Check for form elements+ await expect(page.locator('input[name="username"]')).toBeVisible();+ await expect(page.locator('input[name="password"]')).toBeVisible();+ await expect(page.locator('button[type="submit"]')).toBeVisible();++ // Check for encryption banner+ const encryptionBanner = page.locator('.ldr-encryption-banner');+ if (await encryptionBanner.count() > 0) {+ await expect(encryptionBanner).toBeVisible();+ }+ });++ test('remember me checkbox is accessible', async ({ page, isMobile }, testInfo) => {+ if (!isMobile) {+ test.skip();+ return;+ }++ const isTablet = testInfo.project.name.includes('iPad');+ if (isTablet) {+ test.skip();+ return;+ }++ await page.goto('/auth/login');+ await page.waitForLoadState('networkidle');++ const rememberCheckbox = page.locator('input[name="remember"]');+ if (await rememberCheckbox.count() > 0) {+ await expect(rememberCheckbox).toBeVisible();++ // Check the label is clickable+ const label = page.locator('.ldr-checkbox-label').first();+ await expect(label).toBeVisible();+ }+ });+ });++ test.describe('Register Page Content', () => {+ test('displays registration form correctly', async ({ page }) => {+ await page.goto('/auth/register');+ await page.waitForLoadState('networkidle');++ // Check for page header+ await expect(page.locator('h1')).toContainText(/Create Account|Register/i);++ // Check for form elements+ await expect(page.locator('input[name="username"]')).toBeVisible();+ await expect(page.locator('input[name="password"]')).toBeVisible();+ await expect(page.locator('input[name="confirm_password"]')).toBeVisible();+ await expect(page.locator('button[type="submit"]')).toBeVisible();++ // Check for acknowledgement checkbox+ const acknowledgeCheckbox = page.locator('input[name="acknowledge"]');+ await expect(acknowledgeCheckbox).toBeVisible();+ });++ test('password requirements section is visible', async ({ page }) => {+ await page.goto('/auth/register');+ await page.waitForLoadState('networkidle');++ const passwordRequirements = page.locator('.ldr-password-requirements');+ if (await passwordRequirements.count() > 0) {+ await expect(passwordRequirements).toBeVisible();+ }+ });++ test('acknowledgement checkbox is accessible on mobile', async ({ page, isMobile }, testInfo) => {+ if (!isMobile) {+ test.skip();+ return;+ }++ const isTablet = testInfo.project.name.includes('iPad');+ if (isTablet) {+ test.skip();+ return;+ }++ await page.goto('/auth/register');+ await page.waitForLoadState('networkidle');++ const acknowledgeBox = page.locator('.ldr-acknowledge-box');+ if (await acknowledgeBox.count() > 0) {+ await expect(acknowledgeBox).toBeVisible();++ // Check checkbox is interactable+ const checkbox = acknowledgeBox.locator('input[type="checkbox"]');+ await expect(checkbox).toBeVisible();+ }+ });+ });++ // ============================================+ // NAVIGATION BETWEEN AUTH PAGES+ // ============================================++ test.describe('Auth Page Navigation', () => {+ test('can navigate from login to register', async ({ page }) => {+ await page.goto('/auth/login');+ await page.waitForLoadState('networkidle');++ const registerLink = page.locator('a[href*="register"]');+ if (await registerLink.count() > 0) {+ await registerLink.click();+ await page.waitForLoadState('networkidle');++ expect(page.url()).toContain('/auth/register');+ }+ });++ test('can navigate from register to login', async ({ page }) => {+ await page.goto('/auth/register');+ await page.waitForLoadState('networkidle');++ const loginLink = page.locator('a[href*="login"]');+ await expect(loginLink).toBeVisible();+ await loginLink.click();+ await page.waitForLoadState('networkidle');++ expect(page.url()).toContain('/auth/login');+ });+ });++ // ============================================+ // RESPONSIVE AT EXTRA SMALL WIDTHS (iPhone SE)+ // ============================================++ test.describe('Responsive at Extra Small Widths', () => {+ for (const pageInfo of AUTH_PAGES) {+ test(`${pageInfo.name} - responsive on iPhone SE width (375px)`, async ({ page, isMobile }, testInfo) => {+ if (!isMobile) {+ test.skip();+ return;+ }++ // Only run on iPhone SE project (smallest viewport)+ if (!testInfo.project.name.includes('iPhone SE')) {+ test.skip();+ return;+ }++ await page.goto(pageInfo.path);+ await page.waitForLoadState('networkidle');++ // Check no horizontal overflow+ const hasOverflow = await page.evaluate(() =>+ document.documentElement.scrollWidth > window.innerWidth+ );+ expect(hasOverflow, `${pageInfo.name} should not overflow on 375px width`).toBe(false);++ // Check form container is within viewport+ const container = page.locator('.ldr-auth-container, .ldr-card').first();+ const box = await container.boundingBox();+ expect(box).toBeTruthy();+ expect(box.width, `Container should be <= viewport width`).toBeLessThanOrEqual(375);+ });+ }+ });++ // ============================================+ // VISUAL REGRESSION SCREENSHOTS+ // ============================================++ test.describe('Visual Regression', () => {+ for (const pageInfo of AUTH_PAGES) {+ test(`${pageInfo.name} - screenshot`, async ({ page, isMobile }) => {+ await page.goto(pageInfo.path);+ await page.waitForLoadState('networkidle');+ await page.waitForTimeout(500);++ // Ensure sheets are closed on mobile+ if (isMobile) {+ await ensureSheetsClosed(page);+ }++ // Scroll to top+ await page.evaluate(() => window.scrollTo(0, 0));+ await page.waitForTimeout(200);++ const safeName = pageInfo.name.toLowerCase().replace(/[^a-z0-9]/g, '-');++ // For mobile, use viewport-only screenshots+ const useFullPage = !isMobile;++ await expect(page).toHaveScreenshot(`auth-${safeName}.png`, {+ fullPage: useFullPage,+ maxDiffPixelRatio: 0.02,+ });+ });+ }+ });+});diff --git a/tests/ui_tests/playwright/tests/helpers/mobile-utils.js b/tests/ui_tests/playwright/tests/helpers/mobile-utils.jsindex 2e65f2c7ab..3390a5c8ea 100644--- a/tests/ui_tests/playwright/tests/helpers/mobile-utils.js+++ b/tests/ui_tests/playwright/tests/helpers/mobile-utils.js@@ -32,6 +32,7 @@ const PAGES = [{ path: '/news/', name: 'News Feed' },{ path: '/library/', name: 'Library' },{ path: '/metrics/', name: 'Metrics' },+ { path: '/benchmark/', name: 'Benchmark' },{ path: '/metrics/context-overflow', name: 'Context Overflow' },{ path: '/metrics/star-reviews', name: 'Star Reviews' },{ path: '/metrics/costs', name: 'Cost Analytics' },diff --git a/tests/ui_tests/playwright/tests/settings-subpages-mobile.spec.js b/tests/ui_tests/playwright/tests/settings-subpages-mobile.spec.jsnew file mode 100644index 0000000000..c37921524a--- /dev/null+++ b/tests/ui_tests/playwright/tests/settings-subpages-mobile.spec.js@@ -0,0 +1,487 @@+/**+ * Settings Subpages Mobile Tests+ *+ * Tests for settings subpages on mobile devices.+ * These pages use tab navigation within the settings area.+ *+ * Subpages tested:+ * 1. /settings/main - Main settings tab+ * 2. /settings/llm - LLM configuration tab+ * 3. /settings/api_keys - API Keys tab+ * 4. /settings/search_engines - Search Engines tab+ * 5. /settings/collections - Collections tab+ */++import { test, expect } from '@playwright/test';+const {+ ensureSheetsClosed,+ MIN_TOUCH_TARGET,+ MOBILE_NAV_SELECTOR,+} = require('./helpers/mobile-utils');++// Settings subpages configuration+const SETTINGS_SUBPAGES = [+ { path: '/settings/main', name: 'Settings Main', tab: 'Main' },+ { path: '/settings/llm', name: 'Settings LLM', tab: 'LLM' },+ { path: '/settings/api_keys', name: 'Settings API Keys', tab: 'API Keys' },+ { path: '/settings/search_engines', name: 'Settings Search Engines', tab: 'Search' },+ { path: '/settings/collections', name: 'Settings Collections', tab: 'Collections' },+];++// ============================================+// COMMON TESTS FOR ALL SETTINGS SUBPAGES+// ============================================++test.describe('Settings Subpages - Common Mobile Tests', () => {+ for (const pageInfo of SETTINGS_SUBPAGES) {+ test.describe(`${pageInfo.name}`, () => {+ test('page loads without errors', async ({ page }) => {+ const errors = [];+ page.on('console', (msg) => {+ if (msg.type() === 'error') {+ errors.push(msg.text());+ }+ });++ const pageErrors = [];+ page.on('pageerror', (error) => {+ pageErrors.push(error.message);+ });++ await page.goto(pageInfo.path);+ await page.waitForLoadState('networkidle');++ // Wait for settings to load+ await page.waitForSelector('.ldr-loading-spinner', { state: 'hidden', timeout: 15000 }).catch(() => {});++ const criticalErrors = errors.filter(+ (err) =>+ !err.includes('favicon') &&+ !err.includes('404') &&+ !err.includes('Failed to load resource')+ );++ expect(pageErrors.length, `${pageInfo.name} should have no page errors`).toBe(0);+ expect(+ criticalErrors.length,+ `${pageInfo.name} should have no critical console errors: ${criticalErrors.join(', ')}`+ ).toBe(0);+ });++ test('has no horizontal overflow', async ({ page }) => {+ await page.goto(pageInfo.path);+ await page.waitForLoadState('networkidle');++ // Wait for settings to load+ await page.waitForSelector('.ldr-loading-spinner', { state: 'hidden', timeout: 15000 }).catch(() => {});+ await page.waitForTimeout(500);++ const hasOverflow = await page.evaluate(() =>+ document.documentElement.scrollWidth > window.innerWidth+ );++ if (hasOverflow) {+ const overflowInfo = await page.evaluate(() => {+ const elements = [];+ document.querySelectorAll('*').forEach((el) => {+ const rect = el.getBoundingClientRect();+ if (rect.right > window.innerWidth) {+ elements.push({+ tag: el.tagName.toLowerCase(),+ class: el.className?.toString().slice(0, 50),+ id: el.id,+ overflow: Math.round(rect.right - window.innerWidth),+ });+ }+ });+ return elements.slice(0, 5);+ });+ console.log(`Overflowing elements on ${pageInfo.name}:`, JSON.stringify(overflowInfo, null, 2));+ }++ expect(hasOverflow, `${pageInfo.name} should have no horizontal overflow`).toBe(false);+ });++ test('shows mobile nav on phone', async ({ page, isMobile }, testInfo) => {+ if (!isMobile) {+ test.skip();+ return;+ }++ // Skip on tablets - they use sidebar+ const isTablet = testInfo.project.name.includes('iPad');+ if (isTablet) {+ test.skip();+ return;+ }++ await page.goto(pageInfo.path);+ await page.waitForLoadState('networkidle');++ const mobileNav = page.locator(MOBILE_NAV_SELECTOR);+ await expect(mobileNav, 'Mobile nav should be visible').toBeVisible();+ });++ test('has adequate touch targets', async ({ page, isMobile }, testInfo) => {+ if (!isMobile) {+ test.skip();+ return;+ }++ // Skip on tablets+ const isTablet = testInfo.project.name.includes('iPad');+ if (isTablet) {+ test.skip();+ return;+ }++ await page.goto(pageInfo.path);+ await page.waitForLoadState('networkidle');++ // Wait for settings to load+ await page.waitForSelector('.ldr-loading-spinner', { state: 'hidden', timeout: 15000 }).catch(() => {});++ const smallTargets = await page.evaluate((MIN_SIZE) => {+ const elements = document.querySelectorAll(+ 'button, a, input, select, textarea, [role="button"], .btn'+ );+ const issues = [];++ elements.forEach((el) => {+ const rect = el.getBoundingClientRect();+ const style = window.getComputedStyle(el);++ if (style.display === 'none' || style.visibility === 'hidden') return;+ if (rect.width === 0 || rect.height === 0) return;+ if (rect.top > window.innerHeight || rect.bottom < 0) return;+ if (rect.left > window.innerWidth || rect.right < 0) return;++ if (rect.width < MIN_SIZE || rect.height < MIN_SIZE) {+ issues.push({+ tag: el.tagName.toLowerCase(),+ class: el.className?.toString().slice(0, 50),+ size: `${Math.round(rect.width)}x${Math.round(rect.height)}`,+ text: (el.textContent || '').trim().slice(0, 30),+ });+ }+ });++ return issues;+ }, MIN_TOUCH_TARGET);++ // Log issues for debugging+ if (smallTargets.length > 0) {+ console.log(`Small touch targets on ${pageInfo.name}:`, JSON.stringify(smallTargets, null, 2));+ }++ // Allow up to 3 small elements (some icons may be small but have large hit areas)+ expect(+ smallTargets.length,+ `${pageInfo.name} should have minimal small touch targets`+ ).toBeLessThan(3);+ });++ test('content not hidden behind mobile nav', async ({ page, isMobile }, testInfo) => {+ if (!isMobile) {+ test.skip();+ return;+ }++ // Skip on tablets+ const isTablet = testInfo.project.name.includes('iPad');+ if (isTablet) {+ test.skip();+ return;+ }++ await page.goto(pageInfo.path);+ await page.waitForLoadState('networkidle');++ // Wait for settings to load+ await page.waitForSelector('.ldr-loading-spinner', { state: 'hidden', timeout: 15000 }).catch(() => {});+ await page.waitForTimeout(500);++ // Scroll to bottom+ await page.evaluate(() => window.scrollTo(0, document.body.scrollHeight));+ await page.waitForTimeout(300);++ const result = await page.evaluate((navSelector) => {+ const mobileNav = document.querySelector(navSelector);+ if (!mobileNav) return { hasNav: false };++ const navStyle = window.getComputedStyle(mobileNav);+ if (navStyle.display === 'none') return { hasNav: false };++ const navRect = mobileNav.getBoundingClientRect();+ const interactiveElements = document.querySelectorAll(+ 'button, a, input, select, textarea, [role="button"]'+ );+ const hiddenElements = [];++ interactiveElements.forEach((el) => {+ const rect = el.getBoundingClientRect();+ const style = window.getComputedStyle(el);++ if (style.display === 'none' || style.visibility === 'hidden') return;+ if (rect.width === 0 || rect.height === 0) return;++ const OVERLAP_TOLERANCE = 5;+ if (rect.bottom > navRect.top + OVERLAP_TOLERANCE && rect.top < navRect.bottom) {+ if (!mobileNav.contains(el)) {+ hiddenElements.push({+ tag: el.tagName.toLowerCase(),+ text: (el.textContent || '').trim().slice(0, 30),+ });+ }+ }+ });++ return { hasNav: true, hiddenElements };+ }, MOBILE_NAV_SELECTOR);++ expect(+ result.hiddenElements?.length || 0,+ `${pageInfo.name} should have no elements behind mobile nav`+ ).toBe(0);+ });++ test('viewport screenshot', async ({ page, isMobile }) => {+ if (!isMobile) {+ test.skip();+ return;+ }++ await page.goto(pageInfo.path);+ await page.waitForLoadState('networkidle');++ // Wait for settings to load+ await page.waitForSelector('.ldr-loading-spinner', { state: 'hidden', timeout: 15000 }).catch(() => {});+ await page.waitForTimeout(500);++ await ensureSheetsClosed(page);++ // Scroll to top+ await page.evaluate(() => window.scrollTo(0, 0));+ await page.waitForTimeout(200);++ const safeName = pageInfo.name.toLowerCase().replace(/[^a-z0-9]/g, '-');++ await expect(page).toHaveScreenshot(`${safeName}-viewport.png`, {+ fullPage: false,+ maxDiffPixelRatio: 0.02,+ });+ });+ });+ }+});++// ============================================+// SETTINGS TAB NAVIGATION TESTS+// ============================================++test.describe('Settings Tab Navigation', () => {+ test.beforeEach(async ({ page }) => {+ await page.goto('/settings/');+ await page.waitForLoadState('networkidle');++ // Wait for settings to load+ await page.waitForSelector('.ldr-loading-spinner', { state: 'hidden', timeout: 15000 }).catch(() => {});+ });++ for (const pageInfo of SETTINGS_SUBPAGES) {+ test(`can navigate to ${pageInfo.name} via URL`, async ({ page }) => {+ await page.goto(pageInfo.path);+ await page.waitForLoadState('networkidle');++ // Wait for settings content to load+ await page.waitForSelector('.ldr-loading-spinner', { state: 'hidden', timeout: 15000 }).catch(() => {});++ // Verify we're on the correct page by checking URL+ expect(page.url()).toContain(pageInfo.path);++ // Verify page has loaded content (settings form or similar)+ const hasContent = await page.locator('.ldr-settings-form, .ldr-settings-content, form, .ldr-card').first().isVisible().catch(() => false);+ expect(hasContent, `${pageInfo.name} should have visible content`).toBe(true);+ });+ }+});++// ============================================+// SETTINGS MAIN PAGE SPECIFIC TESTS+// ============================================++test.describe('Settings Main Page - Specific Tests', () => {+ test.beforeEach(async ({ page }) => {+ await page.goto('/settings/main');+ await page.waitForLoadState('networkidle');+ await page.waitForSelector('.ldr-loading-spinner', { state: 'hidden', timeout: 15000 }).catch(() => {});+ });++ test('displays settings form', async ({ page }) => {+ const form = page.locator('form, .ldr-settings-form').first();+ await expect(form).toBeVisible();+ });++ test('has save button', async ({ page }) => {+ const saveButton = page.locator('button:has-text("Save"), button[type="submit"]').first();+ if (await saveButton.count() > 0) {+ await expect(saveButton).toBeVisible();+ }+ });+});++// ============================================+// SETTINGS LLM PAGE SPECIFIC TESTS+// ============================================++test.describe('Settings LLM Page - Specific Tests', () => {+ test.beforeEach(async ({ page }) => {+ await page.goto('/settings/llm');+ await page.waitForLoadState('networkidle');+ await page.waitForSelector('.ldr-loading-spinner', { state: 'hidden', timeout: 15000 }).catch(() => {});+ });++ test('displays LLM configuration options', async ({ page }) => {+ // Wait for content to load+ await page.waitForTimeout(500);++ // Check for LLM-related form elements+ const llmContent = page.locator('form, .ldr-settings-form, .ldr-llm-settings, select, input').first();+ await expect(llmContent).toBeVisible();+ });++ test('has model selection if available', async ({ page }) => {+ const modelSelect = page.locator('select[name*="model"], select[id*="model"], .ldr-model-select').first();+ if (await modelSelect.count() > 0) {+ await expect(modelSelect).toBeVisible();+ }+ });+});++// ============================================+// SETTINGS API KEYS PAGE SPECIFIC TESTS+// ============================================++test.describe('Settings API Keys Page - Specific Tests', () => {+ test.beforeEach(async ({ page }) => {+ await page.goto('/settings/api_keys');+ await page.waitForLoadState('networkidle');+ await page.waitForSelector('.ldr-loading-spinner', { state: 'hidden', timeout: 15000 }).catch(() => {});+ });++ test('displays API keys section', async ({ page }) => {+ // Wait for content to load+ await page.waitForTimeout(500);++ // Check for API key related elements+ const apiContent = page.locator('form, .ldr-settings-form, .ldr-api-keys, input[type="password"], input[type="text"]').first();+ await expect(apiContent).toBeVisible();+ });++ test('has password/masked inputs for API keys', async ({ page }) => {+ // API keys should be in password fields or masked+ const apiInputs = page.locator('input[type="password"], input[class*="api"], input[name*="key"]');+ const count = await apiInputs.count();++ // Should have at least some inputs for API keys+ // Note: Count may be 0 if no API keys are configured yet+ expect(count).toBeGreaterThanOrEqual(0);+ });+});++// ============================================+// SETTINGS SEARCH ENGINES PAGE SPECIFIC TESTS+// ============================================++test.describe('Settings Search Engines Page - Specific Tests', () => {+ test.beforeEach(async ({ page }) => {+ await page.goto('/settings/search_engines');+ await page.waitForLoadState('networkidle');+ await page.waitForSelector('.ldr-loading-spinner', { state: 'hidden', timeout: 15000 }).catch(() => {});+ });++ test('displays search engines configuration', async ({ page }) => {+ // Wait for content to load+ await page.waitForTimeout(500);++ // Check for search engine related elements+ const searchContent = page.locator('form, .ldr-settings-form, .ldr-search-engines, select, input, .ldr-card').first();+ await expect(searchContent).toBeVisible();+ });++ test('has toggle switches or checkboxes for engines', async ({ page }) => {+ // Look for toggles or checkboxes to enable/disable engines+ const toggles = page.locator('input[type="checkbox"], .ldr-toggle, [role="switch"]');+ const count = await toggles.count();++ // Should have some toggle controls for search engines+ expect(count).toBeGreaterThanOrEqual(0);+ });+});++// ============================================+// SETTINGS COLLECTIONS PAGE SPECIFIC TESTS+// ============================================++test.describe('Settings Collections Page - Specific Tests', () => {+ test.beforeEach(async ({ page }) => {+ await page.goto('/settings/collections');+ await page.waitForLoadState('networkidle');+ await page.waitForSelector('.ldr-loading-spinner', { state: 'hidden', timeout: 15000 }).catch(() => {});+ });++ test('displays collections section', async ({ page }) => {+ // Wait for content to load+ await page.waitForTimeout(500);++ // Check for collections related elements+ const collectionsContent = page.locator('form, .ldr-settings-form, .ldr-collections, .ldr-card').first();+ await expect(collectionsContent).toBeVisible();+ });+});++// ============================================+// FORM INPUT TESTS+// ============================================++test.describe('Settings Form Inputs', () => {+ for (const pageInfo of SETTINGS_SUBPAGES) {+ test(`${pageInfo.name} - form inputs have adequate size`, async ({ page, isMobile }, testInfo) => {+ if (!isMobile) {+ test.skip();+ return;+ }++ const isTablet = testInfo.project.name.includes('iPad');+ if (isTablet) {+ test.skip();+ return;+ }++ await page.goto(pageInfo.path);+ await page.waitForLoadState('networkidle');+ await page.waitForSelector('.ldr-loading-spinner', { state: 'hidden', timeout: 15000 }).catch(() => {});++ // Get all visible form inputs+ const inputs = page.locator('input:visible, select:visible, textarea:visible');+ const inputCount = await inputs.count();++ // Check that inputs meet minimum size+ let tooSmallInputs = 0;+ for (let i = 0; i < Math.min(inputCount, 10); i++) {+ const input = inputs.nth(i);+ const box = await input.boundingBox().catch(() => null);++ if (box && (box.height < 32 || box.width < 44)) {+ tooSmallInputs++;+ }+ }++ // Allow up to 2 small inputs (some hidden inputs may still be counted)+ expect(+ tooSmallInputs,+ `${pageInfo.name} should have properly sized form inputs`+ ).toBeLessThan(3);+ });+ }+});