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.

fix(tests): use instant scroll in mobile-nav overlap test (defeat Bootstrap smooth-scroll) (#4442)

LearningCircuit4b6c682adf2a
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 c7db0b2b8c..39cbea9b6e 100644
--- a/tests/ui_tests/playwright/tests/all-pages-mobile.spec.js
+++ b/tests/ui_tests/playwright/tests/all-pages-mobile.spec.js
@@ -417,12 +417,23 @@ test.describe('All Pages - Content Above Mobile Nav', () => {
)
.catch(() => {});
- // Scroll to bottom to check last content. scrollTo() is synchronous inside
- // page.evaluate(): the browser commits the scroll before the evaluate resolves,
- // so an additional `waitForFunction(scrollY >= scrollHeight)` poll is redundant.
- // The old poll could also never resolve on `/` when lazy-loaded content kept
- // growing `document.body.scrollHeight`, eating its full 5s timeout on every run.
- await page.evaluate(() => window.scrollTo(0, document.body.scrollHeight));
+ // Scroll to bottom to check last content. `behavior: 'instant'` is
+ // load-bearing: the Vite bundle ships Bootstrap's reboot rule
+ // `@media (prefers-reduced-motion: no-preference) { :root { scroll-behavior: smooth } }`
+ // and Playwright emulates `no-preference` by default, so the two-arg
+ // `window.scrollTo(x, y)` form ANIMATES over hundreds of ms instead of
+ // committing synchronously. The overlap measurement right below then ran
+ // at scrollY≈0 and flagged the page's natural under-nav content as
+ // "hidden behind nav" — the actual root cause of the persistent
+ // History/News/Library/Metrics failures (clearance padding was fine,
+ // see #4314). Verified against the CI trace DOM: instant scroll commits
+ // before the evaluate resolves (scrollY jumps to max synchronously), so
+ // no follow-up `waitForFunction(scrollY >= scrollHeight)` poll is needed
+ // — and the old poll could never resolve on `/` anyway when lazy-loaded
+ // content kept growing `document.body.scrollHeight`.
+ await page.evaluate(() =>
+ window.scrollTo({ top: document.body.scrollHeight, left: 0, behavior: 'instant' })
+ );
const hiddenElements = await findElementsBehindMobileNav(page, MOBILE_NAV_SELECTOR);