Skip to content

Commit 349f38c

Browse files
committed
type slowly working, 50ms
1 parent a253cca commit 349f38c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

browserbase/src/tools/snapshot.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@ const typeSchema = elementSchema.extend({
240240
slowly: z
241241
.boolean()
242242
.optional()
243+
.default(true)
243244
.describe("Whether to type one character at a time."),
244245
});
245246
type TypeInput = z.infer<typeof typeSchema>;
@@ -269,7 +270,7 @@ const type = defineTool<typeof typeSchema>({
269270
)}.pressSequentially('${params.text.replace(/'/g, "\\'")}');`
270271
);
271272
steps.push(() =>
272-
locator.pressSequentially(params.text, { delay: 100, timeout: 5000 })
273+
locator.pressSequentially(params.text, { delay: 50 })
273274
);
274275
} else {
275276
code.push(`// Fill "${params.text}" into "${params.element}"`);
@@ -279,8 +280,8 @@ const type = defineTool<typeof typeSchema>({
279280
)}.fill('${params.text.replace(/'/g, "\\'")}');`
280281
);
281282
steps.push(async () => {
282-
await locator.waitFor({ state: "visible", timeout: 5000 });
283-
if (!(await locator.isEditable({ timeout: 2000 }))) {
283+
await locator.waitFor({ state: "visible"});
284+
if (!(await locator.isEditable())) {
284285
throw new Error(
285286
`Element '${params.element}' was visible but not editable.`
286287
);

0 commit comments

Comments
 (0)