Method: Playwright::BrowserContext#expect_page

Defined in:
lib/playwright_api/browser_context.rb

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

Performs action and waits for a new ‘Page` to be created in the context. If predicate is provided, it passes `Page` value into the `predicate` function and waits for `predicate(event)` to return a truthy value. Will throw an error if the context closes before new `Page` is created.



452
453
454
# File 'lib/playwright_api/browser_context.rb', line 452

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