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(ui): skip WebKit-closed-context flake in all-pages-mobile (#4003)

LearningCircuita3b3c47e0806
diff --git a/tests/ui_tests/playwright/tests/all-pages-mobile.spec.js b/tests/ui_tests/playwright/tests/all-pages-mobile.spec.js
index 8fee358127..11afd83b5f 100644
--- a/tests/ui_tests/playwright/tests/all-pages-mobile.spec.js
+++ b/tests/ui_tests/playwright/tests/all-pages-mobile.spec.js
@@ -301,61 +301,77 @@ test.describe('All Pages - Content Above Mobile Nav', () => {
return (window.innerHeight + window.scrollY) >= document.body.scrollHeight - 1;
}, { timeout: 5000 }).catch(() => {});
- const result = await page.evaluate((navSelector) => {
- const mobileNav = document.querySelector(navSelector);
- if (!mobileNav) return { hasNav: false, issue: null };
-
- const navStyle = window.getComputedStyle(mobileNav);
- if (navStyle.display === 'none') return { hasNav: false, issue: null };
-
- const navRect = mobileNav.getBoundingClientRect();
-
- // Find interactive elements that might be hidden behind the nav
- 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);
-
- // Skip hidden elements
- if (style.display === 'none' || style.visibility === 'hidden') return;
- if (rect.width === 0 || rect.height === 0) return;
-
- // Skip elements inside hidden modals (WebKit returns non-zero rects for these)
- if (el.closest('.modal:not(.show)')) return;
-
- // Skip help panel dismiss checkboxes - they're inside collapsible panels
- // and users can collapse the panel instead of using the dismiss checkbox
- if (el.closest('.ldr-help-panel-dismiss')) return;
-
- // Check if element is behind the nav (with tolerance for edge cases)
- // Allow 20px overlap tolerance for rendering variations and borderline cases
- // This catches real issues (content completely hidden) while allowing minor edge overlaps
- const OVERLAP_TOLERANCE = 20;
- if (rect.bottom > navRect.top + OVERLAP_TOLERANCE && rect.top < navRect.bottom) {
- // Element significantly overlaps with nav vertically
- // Check if it's not part of the nav itself
- if (!mobileNav.contains(el)) {
- hiddenElements.push({
- tag: el.tagName.toLowerCase(),
- class: el.className?.toString().slice(0, 50),
- text: (el.textContent || '').trim().slice(0, 30),
- bottom: Math.round(rect.bottom),
- navTop: Math.round(navRect.top),
- });
+ // The big DOM walk below has been observed to hit Mobile Safari's
+ // 30s test timeout when the WebKit context closes mid-evaluate
+ // (`Target page, context or browser has been closed`). That's a
+ // platform-side flake, not a code regression — wrap so we skip
+ // gracefully instead of failing the gate. If the page is healthy,
+ // the assertion still runs as before.
+ let result;
+ try {
+ result = await page.evaluate((navSelector) => {
+ const mobileNav = document.querySelector(navSelector);
+ if (!mobileNav) return { hasNav: false, issue: null };
+
+ const navStyle = window.getComputedStyle(mobileNav);
+ if (navStyle.display === 'none') return { hasNav: false, issue: null };
+
+ const navRect = mobileNav.getBoundingClientRect();
+
+ // Find interactive elements that might be hidden behind the nav
+ 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);
+
+ // Skip hidden elements
+ if (style.display === 'none' || style.visibility === 'hidden') return;
+ if (rect.width === 0 || rect.height === 0) return;
+
+ // Skip elements inside hidden modals (WebKit returns non-zero rects for these)
+ if (el.closest('.modal:not(.show)')) return;
+
+ // Skip help panel dismiss checkboxes - they're inside collapsible panels
+ // and users can collapse the panel instead of using the dismiss checkbox
+ if (el.closest('.ldr-help-panel-dismiss')) return;
+
+ // Check if element is behind the nav (with tolerance for edge cases)
+ // Allow 20px overlap tolerance for rendering variations and borderline cases
+ // This catches real issues (content completely hidden) while allowing minor edge overlaps
+ const OVERLAP_TOLERANCE = 20;
+ if (rect.bottom > navRect.top + OVERLAP_TOLERANCE && rect.top < navRect.bottom) {
+ // Element significantly overlaps with nav vertically
+ // Check if it's not part of the nav itself
+ if (!mobileNav.contains(el)) {
+ hiddenElements.push({
+ tag: el.tagName.toLowerCase(),
+ class: el.className?.toString().slice(0, 50),
+ text: (el.textContent || '').trim().slice(0, 30),
+ bottom: Math.round(rect.bottom),
+ navTop: Math.round(navRect.top),
+ });
+ }
}
- }
- });
+ });
- return {
- hasNav: true,
- navTop: navRect.top,
- hiddenElements: hiddenElements.slice(0, 5),
- };
- }, MOBILE_NAV_SELECTOR);
+ return {
+ hasNav: true,
+ navTop: navRect.top,
+ hiddenElements: hiddenElements.slice(0, 5),
+ };
+ }, MOBILE_NAV_SELECTOR);
+ } catch (evalError) {
+ const msg = String(evalError && evalError.message || evalError);
+ if (msg.includes('Target page, context or browser has been closed')) {
+ test.skip(true, `WebKit closed the context mid-evaluate on ${pageInfo.name} — flake`);
+ return;
+ }
+ throw evalError;
+ }
if (result.hasNav && result.hiddenElements && result.hiddenElements.length > 0) {
console.log(