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.

test(playwright): add extended mobile component screenshot tests

LearningCircuitac0e677e8874
diff --git a/tests/ui_tests/playwright/tests/mobile-components.spec.js b/tests/ui_tests/playwright/tests/mobile-components.spec.js
index bf653e3df0..31306cfce3 100644
--- a/tests/ui_tests/playwright/tests/mobile-components.spec.js
+++ b/tests/ui_tests/playwright/tests/mobile-components.spec.js
@@ -792,6 +792,600 @@ test.describe('Metrics Page Sections', () => {
});
});
+// ============================================
+// FULL PAGE MOBILE LAYOUTS
+// ============================================
+
+test.describe('Full Page Mobile Layouts', () => {
+ // Note: Settings page is excluded as it's too tall (>32767 pixels) for fullPage screenshots
+ const pages = [
+ { path: '/', name: 'research' },
+ { path: '/history/', name: 'history' },
+ { path: '/news/', name: 'news' },
+ { path: '/library/', name: 'library' },
+ ];
+
+ for (const pageInfo of pages) {
+ test(`${pageInfo.name} page - full mobile layout`, async ({ page, isMobile }, testInfo) => {
+ if (!isMobile) {
+ test.skip();
+ return;
+ }
+
+ // Skip tablets for this test - they have different layouts
+ const isTablet = testInfo.project.name.includes('iPad');
+ if (isTablet) {
+ test.skip();
+ return;
+ }
+
+ await page.goto(pageInfo.path);
+ await page.waitForLoadState('domcontentloaded');
+ await page.waitForTimeout(500);
+ await ensureSheetsClosed(page, { preserveMobileNav: true });
+
+ await expect(page).toHaveScreenshot(`${pageInfo.name}-full-mobile.png`, {
+ fullPage: true,
+ maxDiffPixelRatio: 0.02,
+ });
+ });
+ }
+});
+
+// ============================================
+// TABLET/SIDEBAR NAVIGATION TESTS
+// ============================================
+
+test.describe('Tablet Sidebar Navigation', () => {
+ test('iPad sidebar - collapsed state', async ({ page, isMobile }, testInfo) => {
+ if (!isMobile) {
+ test.skip();
+ return;
+ }
+
+ // Only run on tablets
+ const isTablet = testInfo.project.name.includes('iPad');
+ if (!isTablet) {
+ test.skip();
+ return;
+ }
+
+ await page.goto('/');
+ await page.waitForLoadState('domcontentloaded');
+ await page.waitForTimeout(500);
+
+ const sidebar = page.locator('.ldr-sidebar, nav[class*="sidebar"], aside');
+ if (await sidebar.first().isVisible()) {
+ await expect(sidebar.first()).toHaveScreenshot('tablet-sidebar.png', {
+ maxDiffPixelRatio: 0.02,
+ });
+ }
+ });
+
+ test('iPad research page layout', async ({ page, isMobile }, testInfo) => {
+ if (!isMobile) {
+ test.skip();
+ return;
+ }
+
+ const isTablet = testInfo.project.name.includes('iPad');
+ if (!isTablet) {
+ test.skip();
+ return;
+ }
+
+ await page.goto('/');
+ await page.waitForLoadState('domcontentloaded');
+ await page.waitForTimeout(500);
+ await ensureSheetsClosed(page);
+
+ await expect(page).toHaveScreenshot('tablet-research-layout.png', {
+ fullPage: false,
+ maxDiffPixelRatio: 0.02,
+ });
+ });
+});
+
+// ============================================
+// BUTTON STATE TESTS
+// ============================================
+
+test.describe('Button States', () => {
+ test('Start Research button - disabled state', async ({ page, isMobile }) => {
+ if (!isMobile) {
+ test.skip();
+ return;
+ }
+
+ await page.goto('/');
+ await page.waitForLoadState('domcontentloaded');
+ await page.waitForTimeout(500);
+ await ensureSheetsClosed(page);
+
+ // Clear the textarea to trigger disabled state
+ const textarea = page.locator('#query, textarea[name="query"]');
+ if (await textarea.isVisible()) {
+ await textarea.clear();
+ await page.waitForTimeout(500);
+ }
+
+ const startBtn = page.locator('#start-research-btn, button:has-text("Start Research")');
+ if (await startBtn.isVisible()) {
+ // Wait for element to be stable
+ await startBtn.scrollIntoViewIfNeeded();
+ await page.waitForTimeout(300);
+ await expect(startBtn).toHaveScreenshot('start-research-btn-disabled.png', {
+ maxDiffPixelRatio: 0.02,
+ timeout: 10000,
+ });
+ }
+ });
+
+ test('Start Research button - enabled state with text', async ({ page, isMobile }) => {
+ if (!isMobile) {
+ test.skip();
+ return;
+ }
+
+ await page.goto('/');
+ await page.waitForLoadState('domcontentloaded');
+ await page.waitForTimeout(500);
+ await ensureSheetsClosed(page);
+
+ // Fill textarea to enable the button
+ const textarea = page.locator('#query, textarea[name="query"]');
+ if (await textarea.isVisible()) {
+ await textarea.fill('Test research query');
+ await page.waitForTimeout(500);
+ }
+
+ const startBtn = page.locator('#start-research-btn, button:has-text("Start Research")');
+ if (await startBtn.isVisible()) {
+ await startBtn.scrollIntoViewIfNeeded();
+ await page.waitForTimeout(300);
+ await expect(startBtn).toHaveScreenshot('start-research-btn-enabled.png', {
+ maxDiffPixelRatio: 0.02,
+ timeout: 10000,
+ });
+ }
+ });
+
+ test('Settings save button', async ({ page, isMobile }) => {
+ if (!isMobile) {
+ test.skip();
+ return;
+ }
+
+ await page.goto('/settings/');
+ await page.waitForLoadState('domcontentloaded');
+ await page.waitForTimeout(500);
+ await page.waitForSelector('.ldr-loading-spinner', { state: 'hidden', timeout: 10000 }).catch(() => {});
+ await page.waitForTimeout(1000);
+ await ensureSheetsClosed(page);
+
+ const saveBtn = page.locator('button:has-text("Save"), button[type="submit"], .ldr-save-btn').first();
+ if (await saveBtn.isVisible()) {
+ await saveBtn.scrollIntoViewIfNeeded();
+ await page.waitForTimeout(300);
+ await expect(saveBtn).toHaveScreenshot('settings-save-button.png', {
+ maxDiffPixelRatio: 0.02,
+ timeout: 10000,
+ });
+ }
+ });
+});
+
+// ============================================
+// MODAL AND SHEET COMPONENTS
+// ============================================
+
+test.describe('Modal and Sheet Components', () => {
+ test('Mobile sheet backdrop', async ({ page, isMobile }, testInfo) => {
+ if (!isMobile) {
+ test.skip();
+ return;
+ }
+
+ const isTablet = testInfo.project.name.includes('iPad');
+ const isLandscape = testInfo.project.name.includes('Landscape');
+ if (isTablet || isLandscape) {
+ test.skip();
+ return;
+ }
+
+ await page.goto('/');
+ await page.waitForLoadState('domcontentloaded');
+ await page.waitForTimeout(500);
+
+ // Open the More menu to show a sheet
+ const moreBtn = page.locator('[data-nav="more"], .ldr-nav-more-btn, .ldr-mobile-bottom-nav button:has-text("More")');
+ if (await moreBtn.count() > 0) {
+ await moreBtn.first().click();
+ // Wait for sheet animation to complete
+ await page.waitForTimeout(800);
+
+ // Capture the sheet element instead of full page for stability
+ const sheet = page.locator('.ldr-mobile-sheet');
+ if (await sheet.isVisible()) {
+ await expect(sheet).toHaveScreenshot('mobile-sheet-with-backdrop.png', {
+ maxDiffPixelRatio: 0.02,
+ timeout: 10000,
+ });
+ }
+ }
+ });
+
+ test('Confirmation dialog (if available)', async ({ page, isMobile }) => {
+ if (!isMobile) {
+ test.skip();
+ return;
+ }
+
+ await page.goto('/history/');
+ await page.waitForLoadState('domcontentloaded');
+ await page.waitForTimeout(500);
+
+ // Look for delete buttons that might trigger a confirmation
+ const deleteBtn = page.locator('button:has-text("Delete"), [aria-label*="delete"], .ldr-delete-btn').first();
+ if (await deleteBtn.isVisible()) {
+ await deleteBtn.click();
+ await page.waitForTimeout(300);
+
+ // Check for confirmation dialog
+ const dialog = page.locator('[role="dialog"], .ldr-modal, .ldr-confirm-dialog');
+ if (await dialog.isVisible()) {
+ await expect(dialog).toHaveScreenshot('confirmation-dialog.png', {
+ maxDiffPixelRatio: 0.02,
+ });
+ }
+ }
+ });
+});
+
+// ============================================
+// SETTINGS PAGE SECTIONS
+// ============================================
+
+test.describe('Settings Page Sections', () => {
+ test('Settings - General section', async ({ page, isMobile }) => {
+ if (!isMobile) {
+ test.skip();
+ return;
+ }
+
+ await page.goto('/settings/');
+ await page.waitForLoadState('domcontentloaded');
+ await page.waitForTimeout(500);
+ await page.waitForSelector('.ldr-loading-spinner', { state: 'hidden', timeout: 10000 }).catch(() => {});
+ await page.waitForTimeout(500);
+
+ // Click on General tab if tabs exist
+ const generalTab = page.locator('[data-tab="general"], button:has-text("General"), a:has-text("General")').first();
+ if (await generalTab.isVisible()) {
+ await generalTab.click();
+ await page.waitForTimeout(300);
+ }
+
+ const settingsContent = page.locator('.ldr-settings-content, .ldr-tab-content, [role="tabpanel"]').first();
+ if (await settingsContent.isVisible()) {
+ await expect(settingsContent).toHaveScreenshot('settings-general-section.png', {
+ maxDiffPixelRatio: 0.02,
+ });
+ }
+ });
+
+ test('Settings - LLM section', async ({ page, isMobile }) => {
+ if (!isMobile) {
+ test.skip();
+ return;
+ }
+
+ await page.goto('/settings/');
+ await page.waitForLoadState('domcontentloaded');
+ await page.waitForTimeout(500);
+ await page.waitForSelector('.ldr-loading-spinner', { state: 'hidden', timeout: 10000 }).catch(() => {});
+ await page.waitForTimeout(500);
+
+ // Click on LLM tab
+ const llmTab = page.locator('[data-tab="llm"], button:has-text("LLM"), a:has-text("LLM")').first();
+ if (await llmTab.isVisible()) {
+ await llmTab.click();
+ await page.waitForTimeout(300);
+
+ const settingsContent = page.locator('.ldr-settings-content, .ldr-tab-content, [role="tabpanel"]').first();
+ if (await settingsContent.isVisible()) {
+ await expect(settingsContent).toHaveScreenshot('settings-llm-section.png', {
+ maxDiffPixelRatio: 0.02,
+ });
+ }
+ }
+ });
+
+ test('Settings - Search section', async ({ page, isMobile }) => {
+ if (!isMobile) {
+ test.skip();
+ return;
+ }
+
+ await page.goto('/settings/');
+ await page.waitForLoadState('domcontentloaded');
+ await page.waitForTimeout(500);
+ await page.waitForSelector('.ldr-loading-spinner', { state: 'hidden', timeout: 10000 }).catch(() => {});
+ await page.waitForTimeout(500);
+
+ // Click on Search tab
+ const searchTab = page.locator('[data-tab="search"], button:has-text("Search"), a:has-text("Search")').first();
+ if (await searchTab.isVisible()) {
+ await searchTab.click();
+ await page.waitForTimeout(300);
+
+ const settingsContent = page.locator('.ldr-settings-content, .ldr-tab-content, [role="tabpanel"]').first();
+ if (await settingsContent.isVisible()) {
+ await expect(settingsContent).toHaveScreenshot('settings-search-section.png', {
+ maxDiffPixelRatio: 0.02,
+ });
+ }
+ }
+ });
+
+ test('Settings - Reporting section', async ({ page, isMobile }) => {
+ if (!isMobile) {
+ test.skip();
+ return;
+ }
+
+ await page.goto('/settings/');
+ await page.waitForLoadState('domcontentloaded');
+ await page.waitForTimeout(500);
+ await page.waitForSelector('.ldr-loading-spinner', { state: 'hidden', timeout: 10000 }).catch(() => {});
+ await page.waitForTimeout(500);
+
+ // Click on Reporting tab
+ const reportingTab = page.locator('[data-tab="reporting"], button:has-text("Reporting"), a:has-text("Reporting")').first();
+ if (await reportingTab.isVisible()) {
+ await reportingTab.click();
+ await page.waitForTimeout(300);
+
+ const settingsContent = page.locator('.ldr-settings-content, .ldr-tab-content, [role="tabpanel"]').first();
+ if (await settingsContent.isVisible()) {
+ await expect(settingsContent).toHaveScreenshot('settings-reporting-section.png', {
+ maxDiffPixelRatio: 0.02,
+ });
+ }
+ }
+ });
+});
+
+// ============================================
+// NEWS PAGE ADDITIONAL TESTS
+// ============================================
+
+test.describe('News Page Additional', () => {
+ test('News subscription list (if has subscriptions)', async ({ page, isMobile }) => {
+ if (!isMobile) {
+ test.skip();
+ return;
+ }
+
+ await page.goto('/news/');
+ await page.waitForLoadState('domcontentloaded');
+ await page.waitForTimeout(500);
+
+ const subscriptionList = page.locator('.ldr-subscription-list, [class*="subscription"]');
+ if (await subscriptionList.count() > 0 && await subscriptionList.first().isVisible()) {
+ await expect(subscriptionList.first()).toHaveScreenshot('news-subscription-list.png', {
+ maxDiffPixelRatio: 0.02,
+ });
+ }
+ });
+
+ test('News empty state', async ({ page, isMobile }) => {
+ if (!isMobile) {
+ test.skip();
+ return;
+ }
+
+ await page.goto('/news/');
+ await page.waitForLoadState('domcontentloaded');
+ await page.waitForTimeout(500);
+
+ const emptyState = page.locator('.ldr-empty-state, :text("No subscriptions"), :text("no news")').first();
+ if (await emptyState.isVisible()) {
+ await expect(emptyState).toHaveScreenshot('news-empty-state.png', {
+ maxDiffPixelRatio: 0.02,
+ });
+ }
+ });
+
+ test('News page header with actions', async ({ page, isMobile }) => {
+ if (!isMobile) {
+ test.skip();
+ return;
+ }
+
+ await page.goto('/news/');
+ await page.waitForLoadState('domcontentloaded');
+ await page.waitForTimeout(500);
+
+ // Capture the header area with any action buttons
+ const headerArea = page.locator('.ldr-page-header, header, .ldr-news-header').first();
+ if (await headerArea.isVisible()) {
+ await expect(headerArea).toHaveScreenshot('news-header-with-actions.png', {
+ maxDiffPixelRatio: 0.02,
+ });
+ }
+ });
+});
+
+// ============================================
+// LIBRARY PAGE ADDITIONAL TESTS
+// ============================================
+
+test.describe('Library Page Additional', () => {
+ test('Library file upload area', async ({ page, isMobile }) => {
+ if (!isMobile) {
+ test.skip();
+ return;
+ }
+
+ await page.goto('/library/');
+ await page.waitForLoadState('domcontentloaded');
+ await page.waitForTimeout(500);
+
+ const uploadArea = page.locator('.ldr-upload-area, [class*="upload"], .ldr-dropzone').first();
+ if (await uploadArea.isVisible()) {
+ await expect(uploadArea).toHaveScreenshot('library-upload-area.png', {
+ maxDiffPixelRatio: 0.02,
+ });
+ }
+ });
+
+ test('Library page header with actions', async ({ page, isMobile }) => {
+ if (!isMobile) {
+ test.skip();
+ return;
+ }
+
+ await page.goto('/library/');
+ await page.waitForLoadState('domcontentloaded');
+ await page.waitForTimeout(500);
+
+ const headerArea = page.locator('.ldr-page-header, header, .ldr-library-header').first();
+ if (await headerArea.isVisible()) {
+ await expect(headerArea).toHaveScreenshot('library-header-with-actions.png', {
+ maxDiffPixelRatio: 0.02,
+ });
+ }
+ });
+
+ test('Library search/filter bar', async ({ page, isMobile }) => {
+ if (!isMobile) {
+ test.skip();
+ return;
+ }
+
+ await page.goto('/library/');
+ await page.waitForLoadState('domcontentloaded');
+ await page.waitForTimeout(500);
+
+ const searchBar = page.locator('.ldr-search-bar, input[type="search"], .ldr-filter-bar').first();
+ if (await searchBar.isVisible()) {
+ await expect(searchBar).toHaveScreenshot('library-search-bar.png', {
+ maxDiffPixelRatio: 0.02,
+ });
+ }
+ });
+});
+
+// ============================================
+// HISTORY PAGE ADDITIONAL TESTS
+// ============================================
+
+test.describe('History Page Additional', () => {
+ test('History page header with filters', async ({ page, isMobile }) => {
+ if (!isMobile) {
+ test.skip();
+ return;
+ }
+
+ await page.goto('/history/');
+ await page.waitForLoadState('domcontentloaded');
+ await page.waitForTimeout(500);
+
+ const headerArea = page.locator('.ldr-page-header, header, .ldr-history-header').first();
+ if (await headerArea.isVisible()) {
+ await expect(headerArea).toHaveScreenshot('history-header-with-filters.png', {
+ maxDiffPixelRatio: 0.02,
+ });
+ }
+ });
+
+ test('History search/filter bar', async ({ page, isMobile }) => {
+ if (!isMobile) {
+ test.skip();
+ return;
+ }
+
+ await page.goto('/history/');
+ await page.waitForLoadState('domcontentloaded');
+ await page.waitForTimeout(500);
+
+ const filterBar = page.locator('.ldr-search-bar, .ldr-filter-bar, [class*="filter"]').first();
+ if (await filterBar.isVisible()) {
+ await expect(filterBar).toHaveScreenshot('history-filter-bar.png', {
+ maxDiffPixelRatio: 0.02,
+ });
+ }
+ });
+});
+
+// ============================================
+// RESEARCH PAGE ADDITIONAL TESTS
+// ============================================
+
+test.describe('Research Page Additional', () => {
+ test('Research form complete view', async ({ page, isMobile }) => {
+ if (!isMobile) {
+ test.skip();
+ return;
+ }
+
+ await page.goto('/');
+ await page.waitForLoadState('domcontentloaded');
+ await page.waitForTimeout(500);
+ await ensureSheetsClosed(page, { preserveMobileNav: true });
+
+ // Capture the entire research form area
+ const formArea = page.locator('.ldr-research-form, form, .ldr-research-container').first();
+ if (await formArea.isVisible()) {
+ await expect(formArea).toHaveScreenshot('research-form-complete.png', {
+ maxDiffPixelRatio: 0.02,
+ });
+ }
+ });
+
+ test('Research mode option', async ({ page, isMobile }) => {
+ if (!isMobile) {
+ test.skip();
+ return;
+ }
+
+ await page.goto('/');
+ await page.waitForLoadState('domcontentloaded');
+ await page.waitForTimeout(500);
+ await ensureSheetsClosed(page);
+
+ // Find the first mode option (radio button label)
+ const modeOption = page.locator('.ldr-mode-selection label, .ldr-mode-option').first();
+ if (await modeOption.isVisible()) {
+ await modeOption.scrollIntoViewIfNeeded();
+ await page.waitForTimeout(300);
+ await expect(modeOption).toHaveScreenshot('research-mode-option.png', {
+ maxDiffPixelRatio: 0.02,
+ timeout: 10000,
+ });
+ }
+ });
+
+ test('Research quick actions', async ({ page, isMobile }) => {
+ if (!isMobile) {
+ test.skip();
+ return;
+ }
+
+ await page.goto('/');
+ await page.waitForLoadState('domcontentloaded');
+ await page.waitForTimeout(500);
+
+ const quickActions = page.locator('.ldr-quick-actions, .ldr-action-bar, [class*="quick-action"]');
+ if (await quickActions.count() > 0 && await quickActions.first().isVisible()) {
+ await expect(quickActions.first()).toHaveScreenshot('research-quick-actions.png', {
+ maxDiffPixelRatio: 0.02,
+ });
+ }
+ });
+});
+
// ============================================
// RESPONSIVE HEADER/TITLE TESTS
// ============================================