Method: Capybara::Poltergeist::Browser#network_traffic

Defined in:
lib/capybara/poltergeist/browser.rb

#network_traffic(type = nil) ⇒ Object



264
265
266
267
268
269
270
271
272
# File 'lib/capybara/poltergeist/browser.rb', line 264

def network_traffic(type = nil)
  command('network_traffic', type).map do |event|
    NetworkTraffic::Request.new(
      event['request'],
      event['responseParts'].map { |response| NetworkTraffic::Response.new(response) },
      event['error'] ? NetworkTraffic::Error.new(event['error']) : nil
    )
  end
end