import { scrollToLoadContent } from "@intuned/browser";
import { BrowserContext, Page } from "playwright";
interface Params {}
export default async function handler(
params: Params,
page: Page,
context: BrowserContext
) {
// Scroll through a specific scrollable div
await page.goto(
"https://docs.intunedhq.com/docs/00-getting-started/introduction"
);
// This will scroll the sidebar content only and watch its height to change.
const container = page.locator("xpath=//div[@id='sidebar-content']");
await scrollToLoadContent({
source: container,
maxScrolls: 20,
});
// Will keep scrolling until the sidebar content has loaded all content or the maxScrolls is reached.
}