mokr.input.dialog ================= .. py:module:: mokr.input.dialog Classes ------- .. autoapisummary:: mokr.input.dialog.Dialog Module Contents --------------- .. py:class:: Dialog(client: mokr.connection.DevtoolsConnection, dialog_type: str, message: str, default_value: str | None = None) Dialog objects are initialised by the parent `mokr.browser.Page` when a dialog event is triggered. :param client: A `mokr.connection.DevtoolsConnection` spawned by the parent `mokr.browser.Page`. :type client: DevtoolsConnection :param dialog_type: Dialog type from the triggering event's type. :type dialog_type: str :param message: Message in the dialog. :type message: str :param default_value: Default prompt that the dialog spawned with. Defaults to None. :type default_value: str | None, optional Example:: async def close_dialog(dialog): print(dialog.message) await dialog.dismiss() page.on("dialog", close_dialog) .. py:property:: kind :type: str Get the remote `Dialog` event type. One of "alert", "beforeunload, "confirm", "prompt, or "". .. py:property:: message :type: str Get the message the dialog spawned with. .. py:property:: default_value :type: str Get default prompt value, if remote dialog type is "prompt". Otherwise, get "". .. py:method:: accept(prompt_text: str = '') -> None :async: Accept the remote dialog. Can optionally accept with the given `prompt_text`, if `Dialog.type` is "prompt". :param prompt_text: _description_. Defaults to ''. :type prompt_text: str, optional .. py:method:: dismiss() -> None :async: Dismiss the remote dialog.