Skip to content

Commit 98704c9

Browse files
add timeout for js click (#883)
# why - we have a timeout for playwright click events, we should also have one for the JS click event attempt # what changed - added a 3.5 second timeout for the JS click event attempt in `actHandlerUtils.ts` # test plan - `act` evals - `combination` evals
1 parent 1d9b74c commit 98704c9

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

.changeset/slow-dryers-repeat.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@browserbasehq/stagehand": patch
3+
---
4+
5+
add timeout for JS click

lib/handlers/handlerUtils/actHandlerUtils.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,9 @@ export async function clickElement(ctx: MethodHandlerContext) {
410410
});
411411

412412
try {
413-
await locator.evaluate((el) => (el as HTMLElement).click());
413+
await locator.evaluate((el) => (el as HTMLElement).click(), undefined, {
414+
timeout: 3_500,
415+
});
414416
} catch (e) {
415417
logger({
416418
category: "action",

0 commit comments

Comments
 (0)