Dialog objects are dispatched by page via the page.on('dialog') event.
An example of using Dialog class:
Instance methods
accept(prompt_text :
String |
Nil) :
Nil Returns when the dialog has been accepted.
Sourcedefault_value
If dialog is prompt, returns default prompt value. Otherwise, returns empty string.
Sourcedismiss
Returns when the dialog has been dismissed.
Sourcemessage
A message displayed in the dialog.
Sourcetype
Returns dialog's type, can be one of alert, beforeunload, confirm or prompt.
Source