Skip to content

waygraph / withDialog

Function: withDialog() ​

withDialog<B>(block, options?): B

Defined in: src/engine/block/dialog.ts:15

Answers the browser's own dialog (confirm, alert, prompt, beforeunload) that this Block's action triggers. A dialog freezes the page until it is answered, so the answer has to be armed before the click - this does that without folding it into the Block's own act. The dialog's text can be kept in mem.

Type Parameters ​

B ​

B extends SomeBlock

Parameters ​

block ​

B

options? ​

accept? ​

boolean

into? ​

MemKey<string>

promptText? ​

string

Returns ​

B

Example ​

ts
withDialog(CancelBlock, { accept: true, into: LeaveWarning })

waygraph 0.18.3 (alpha) · Node 24+ · peer @playwright/test ^1.40.0 · syntax may change before 1.0: see what was removed