Practice Widgets Scroll
scrollIntoView · scrollBy
Widget practice · Scroll

Scrolling patterns

One long page with hero · mid section · a deeply nested anchor · lazy-loaded list · CTA at bottom. Practise locator.scrollIntoViewIfNeeded(), page.evaluate(() => window.scrollBy/scrollTo), and asserting infinite-scroll reveal.

Scroll position: 0 px

Long scrollable page

5 sections in a single container — total height ~3500px. The deepest anchor is inside section 4. Last section has a CTA that only loads after you scroll.

Hero · top of page

Start scrolling. The buttons above let you jump; tests should drive scroll via scrollIntoViewIfNeeded() or evaluate.

Mid section

About scrollBy(0, 1000) away from the hero. Use scrollIntoViewIfNeeded to bring it into view.

Section 3

Below this paragraph is a deep anchor element that's well off-screen. Tests should click it without manually scrolling.

Lazy-loaded list

Items appear as you scroll closer (IntersectionObserver). 30 items total.

    Loading more…

    CTA at the bottom

    The button below only enables after you've scrolled past 75% of the page.

    data-testid=scroll-page · section-hero · section-mid · section-deep · section-lazy · section-cta · deep-anchor · cta-button · lazy-loader · lazy-list scroll target=document.scrollingElement (use page.evaluate(() => window.scrollTo/By(...)))
    No scroll action yet.