mokr.frame.wait =============== .. py:module:: mokr.frame.wait Attributes ---------- .. autoapisummary:: mokr.frame.wait.LOGGER Classes ------- .. autoapisummary:: mokr.frame.wait.WaitTask Module Contents --------------- .. py:data:: LOGGER .. py:class:: WaitTask(frame: mokr.frame.frame.Frame, predicate_body: str, title: str, polling: Literal['raf', 'mutation'] | int | float, timeout: float, loop: asyncio.AbstractEventLoop, *args: Any) Class used to monitor a remote frame for events to occur within a given timer interval. :param frame: `mokr.frame.Frame` that spawned this `WaitTask`. :type frame: Frame :param predicate_body: JavaScript function to return from. :type predicate_body: str :param title: Title to be used to contextualise error, if any. :type title: str :param polling: Polling type; if set to "raf", executes continously in "requestAnimationFrame", else if set to "mutation" executes only on DOM mutations. Defaults to "raf". :type polling: Literal["raf", "mutation"] | int | float :param timeout: Time in milliseconds to wait. :type timeout: float :param loop: Running asyncio loop. :type loop: asyncio.AbstractEventLoop :raises ValueError: Raised if `polling_type` not "raf" or "mutation". .. py:attribute:: promise .. py:method:: terminate(error: Exception) -> None Finish the task, if the promise is still not done, set the result with the given `error`, then remove this task from the parent `mokr.frame.Frame`. :param error: Error to raise if watched promise isn't done. :type error: Exception .. py:method:: rerun() -> None :async: Start polling for the expected condition. :raises PageError: Raised if no `mokr.execution.ExecutionContext` attached to the parent `mokr.frame.Frame`.