fix(browser): default hook timeout 2m
This commit is contained in:
@@ -189,7 +189,7 @@ Actions:
|
||||
|
||||
Notes:
|
||||
- `upload` and `dialog` are **arming** calls; run them before the click/press that triggers the chooser/dialog.
|
||||
- The arm default timeout is **30s**; pass `timeoutMs` if you need longer.
|
||||
- The arm default timeout is **2 minutes**; pass `timeoutMs` if you need longer.
|
||||
- `snapshot --format ai` returns AI snapshot markup used for ref-based actions.
|
||||
|
||||
## Security & privacy notes
|
||||
|
||||
@@ -127,7 +127,7 @@ describe("pw-tools-core", () => {
|
||||
await Promise.resolve();
|
||||
|
||||
expect(waitForEvent).toHaveBeenCalledWith("filechooser", {
|
||||
timeout: 30_000,
|
||||
timeout: 120_000,
|
||||
});
|
||||
expect(fileChooser.setFiles).toHaveBeenCalledWith(["/tmp/a.txt"]);
|
||||
});
|
||||
@@ -205,7 +205,7 @@ describe("pw-tools-core", () => {
|
||||
});
|
||||
await Promise.resolve();
|
||||
|
||||
expect(waitForEvent).toHaveBeenCalledWith("dialog", { timeout: 30_000 });
|
||||
expect(waitForEvent).toHaveBeenCalledWith("dialog", { timeout: 120_000 });
|
||||
expect(accept).toHaveBeenCalledWith("x");
|
||||
expect(dismiss).not.toHaveBeenCalled();
|
||||
|
||||
@@ -219,7 +219,7 @@ describe("pw-tools-core", () => {
|
||||
});
|
||||
await Promise.resolve();
|
||||
|
||||
expect(waitForEvent).toHaveBeenCalledWith("dialog", { timeout: 30_000 });
|
||||
expect(waitForEvent).toHaveBeenCalledWith("dialog", { timeout: 120_000 });
|
||||
expect(dismiss).toHaveBeenCalled();
|
||||
expect(accept).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
@@ -222,7 +222,7 @@ export async function armFileUploadViaPlaywright(opts: {
|
||||
}): Promise<void> {
|
||||
const page = await getPageForTargetId(opts);
|
||||
const state = ensurePageState(page);
|
||||
const timeout = Math.max(500, Math.min(120_000, opts.timeoutMs ?? 30_000));
|
||||
const timeout = Math.max(500, Math.min(120_000, opts.timeoutMs ?? 120_000));
|
||||
|
||||
state.armIdUpload = nextUploadArmId += 1;
|
||||
const armId = state.armIdUpload;
|
||||
@@ -256,7 +256,7 @@ export async function armDialogViaPlaywright(opts: {
|
||||
}): Promise<void> {
|
||||
const page = await getPageForTargetId(opts);
|
||||
const state = ensurePageState(page);
|
||||
const timeout = Math.max(500, Math.min(120_000, opts.timeoutMs ?? 30_000));
|
||||
const timeout = Math.max(500, Math.min(120_000, opts.timeoutMs ?? 120_000));
|
||||
|
||||
state.armIdDialog = nextDialogArmId += 1;
|
||||
const armId = state.armIdDialog;
|
||||
|
||||
@@ -268,7 +268,7 @@ export function registerBrowserActionInputCommands(
|
||||
.option("--target-id <id>", "CDP target id (or unique prefix)")
|
||||
.option(
|
||||
"--timeout-ms <ms>",
|
||||
"How long to wait for the next file chooser (default: 30000)",
|
||||
"How long to wait for the next file chooser (default: 120000)",
|
||||
(v: string) => Number(v),
|
||||
)
|
||||
.action(async (paths: string[], opts, cmd) => {
|
||||
@@ -332,7 +332,7 @@ export function registerBrowserActionInputCommands(
|
||||
.option("--target-id <id>", "CDP target id (or unique prefix)")
|
||||
.option(
|
||||
"--timeout-ms <ms>",
|
||||
"How long to wait for the next dialog (default: 30000)",
|
||||
"How long to wait for the next dialog (default: 120000)",
|
||||
(v: string) => Number(v),
|
||||
)
|
||||
.action(async (opts, cmd) => {
|
||||
|
||||
Reference in New Issue
Block a user