如何在纯Ruby(没有Rails)中使用Capybara for IE8?

时间:2011-07-15 14:57:50

标签: ruby internet-explorer internet-explorer-8 cucumber capybara

我一直在使用以下代码在纯Ruby中测试使用带有IE8的Capybara运行,即不是rails应用程序,但每次运行脚本IE8弹出但随后Firefox弹出并且测试通过Firefox运行离开IE8坐在后台:

$:.unshift(File.dirname(__FILE__) + '/../../lib')

begin require 'rspec/expectations'; rescue LoadError; end
require 'rubygems'

require 'capybara'
require 'capybara/dsl'

Capybara.run_server = false
Capybara.app_host = 'http://www.google.com'

require 'selenium-webdriver'
Selenium::WebDriver.for :internet_explorer
Capybara.default_driver = :selenium

require 'cukesalad'
begin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end

1 个答案:

答案 0 :(得分:0)

这不是太老了,也许你可以从中找到一些有用的信息:

Run Capybara & Cucumber Features In Internet Explorer On Remote Windows