mirror of
https://github.com/CloakHQ/CloakBrowser.git
synced 2026-06-23 11:41:46 +02:00
fix: align humanize timeout default with Playwright's 30s auto-retry (#172)
The humanize layer hardcoded timeout=2000ms for element lookups, causing locator.click() and page.click() to fail instantly instead of retrying for 30s like standard Playwright. Aligned all defaults to 30000ms across Python sync/async, JS Playwright, and JS Puppeteer paths. Bumped the outer retry sleep from 200ms to 500ms for DOM mutation settle time.
This commit is contained in:
@@ -1108,7 +1108,7 @@ describe("page.click(selector, { timeout }) forwards timeout to scroll", () => {
|
||||
expect(boundingBox).toHaveBeenCalledWith({ timeout: 5000 });
|
||||
});
|
||||
|
||||
it("default timeout stays 2000ms when not specified", async () => {
|
||||
it("default timeout matches Playwright's 30000ms when not specified", async () => {
|
||||
const { scrollToElement } = await import("../src/human/scroll.js");
|
||||
const cfg = resolveConfig("default");
|
||||
|
||||
@@ -1125,7 +1125,7 @@ describe("page.click(selector, { timeout }) forwards timeout to scroll", () => {
|
||||
};
|
||||
|
||||
await scrollToElement(page, raw, "#x", 0, 0, cfg);
|
||||
expect(boundingBox).toHaveBeenCalledWith({ timeout: 2000 });
|
||||
expect(boundingBox).toHaveBeenCalledWith({ timeout: 30000 });
|
||||
});
|
||||
|
||||
it("page.click({ timeout }) reaches scrollToElement", async () => {
|
||||
|
||||
@@ -1671,11 +1671,13 @@ describe("Puppeteer: isInputElement stealth integration via patchPage", () => {
|
||||
}),
|
||||
});
|
||||
|
||||
const mockEl = buildMockElementHandle();
|
||||
const page = buildMockPage({
|
||||
evaluate: vi.fn(async (...args: any[]) => {
|
||||
evaluateCalls.push(args);
|
||||
return false;
|
||||
}),
|
||||
$: vi.fn(async () => mockEl),
|
||||
});
|
||||
page.createCDPSession = vi.fn(async () => mockCdp);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user