Sha256: bb44cc259cb5a57e47d483928cd68692e8faba2119bc0d9f0a9709617ee1c491

Contents?: true

Size: 733 Bytes

Versions: 12

Compression:

Stored size: 733 Bytes

Contents

require 'spec_helper'

describe "Proxy + WebDriverListener" do
  let(:proxy) { new_proxy }
  let(:listener) { BrowserMob::Proxy::WebDriverListener.new(proxy) }

  let(:driver)  { Selenium::WebDriver.for :firefox, :profile => profile, :listener => listener }
  let(:wait) { Selenium::WebDriver::Wait.new(:timeout => 10) }

  let(:profile) {
    pr = Selenium::WebDriver::Firefox::Profile.new
    pr.proxy = proxy.selenium_proxy

    pr
  }

  after { proxy.close }

  it "should record events" do
    driver.get url_for("1.html")
    wait.until { driver.title == '1' }
    driver.find_element(:link_text => "2").click
    driver.quit

    hars = listener.hars
    hars.size.should == 1

    hars.first.pages.size.should == 2
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
browsermob-proxy-0.3.1 spec/e2e/listener_spec.rb
browsermob-proxy-0.2.0 spec/e2e/listener_spec.rb
browsermob-proxy-0.1.9 spec/e2e/listener_spec.rb
browsermob-proxy-0.1.8 spec/e2e/listener_spec.rb
browsermob-proxy-0.1.8.rc1 spec/e2e/listener_spec.rb
browsermob-proxy-0.1.7 spec/e2e/listener_spec.rb
browsermob-proxy-0.1.6 spec/e2e/listener_spec.rb
browsermob-proxy-0.1.5 spec/e2e/listener_spec.rb
browsermob-proxy-0.1.4 spec/e2e/listener_spec.rb
browsermob-proxy-0.1.3 spec/e2e/listener_spec.rb
browsermob-proxy-0.1.2 spec/e2e/listener_spec.rb
browsermob-proxy-0.1.1 spec/e2e/listener_spec.rb