Method: Capybara::Poltergeist::Browser#network_traffic

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

#network_trafficObject



252
253
254
255
256
257
258
259
260
# File 'lib/capybara/poltergeist/browser.rb', line 252

def network_traffic
  command('network_traffic').values.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