accept method

Future<void> accept({
  1. String? promptText,
})

promptText: A text to enter in prompt. Does not cause any effects if the dialog's type is not prompt.

Returns Future which resolves when the dialog has been accepted.

Implementation

Future<void> accept({String? promptText}) async {
  assert(!_handled, 'Cannot accept dialog which is already handled!');
  _handled = true;
  await page.devTools.page
      .handleJavaScriptDialog(true, promptText: promptText);
}