Method: Playwright::BrowserContext#expect_console_message

Defined in:
lib/playwright_api/browser_context.rb

#expect_console_message(predicate: nil, timeout: nil, &block) ⇒ Object

Performs action and waits for a ‘ConsoleMessage` to be logged by in the pages in the context. If predicate is provided, it passes `ConsoleMessage` value into the `predicate` function and waits for `predicate(message)` to return a truthy value. Will throw an error if the page is closed before the [`event: BrowserContext.console`] event is fired.



429
430
431
# File 'lib/playwright_api/browser_context.rb', line 429

def expect_console_message(predicate: nil, timeout: nil, &block)
  wrap_impl(@impl.expect_console_message(predicate: unwrap_impl(predicate), timeout: unwrap_impl(timeout), &wrap_block_call(block)))
end