Method: Playwright::BrowserContext#route_from_har

Defined in:
lib/playwright_api/browser_context.rb

#route_from_har(har, notFound: nil, update: nil, updateContent: nil, updateMode: nil, url: nil) ⇒ Object

If specified the network requests that are made in the context will be served from the HAR file. Read more about [Replaying from HAR](../mock.md#replaying-from-har).

Playwright will not serve requests intercepted by Service Worker from the HAR file. See [this](github.com/microsoft/playwright/issues/1090) issue. We recommend disabling Service Workers when using request interception by setting ‘serviceWorkers` to `’block’‘.



304
305
306
307
308
309
310
311
312
# File 'lib/playwright_api/browser_context.rb', line 304

def route_from_har(
      har,
      notFound: nil,
      update: nil,
      updateContent: nil,
      updateMode: nil,
      url: nil)
  wrap_impl(@impl.route_from_har(unwrap_impl(har), notFound: unwrap_impl(notFound), update: unwrap_impl(update), updateContent: unwrap_impl(updateContent), updateMode: unwrap_impl(updateMode), url: unwrap_impl(url)))
end