Capybara的API似乎不支持配置HTTP代理。有没有办法在其中使用代理?
背景:我正在使用capybara和cucumber测试rails应用程序,并将akephalos作为javascript驱动程序。页面上有一个
背景:我正在使用capybara和cucumber测试rails应用程序,并将akephalos作为javascript驱动程序。页面上有一个
我不知道Akephalos,但使用Selenium/Firefox来实现这一点是完全可能的:
Capybara.register_driver :selenium do |app|
profile = Selenium::WebDriver::Firefox::Profile.new
profile["network.proxy.type"] = 1 # manual proxy config
profile["network.proxy.http"] = "http://example.com"
profile["network.proxy.http_port"] = 80
Capybara::Selenium::Driver.new(app, :profile => profile)
end