我试图针对远程服务器运行测试.即:
require 'rubygems' require 'capybara' require 'capybara/dsl' Capybara.default_driver = :selenium Capybara.app_host = 'http://www.google.com' module MyCapybaraTest include Capybara def test_google visit('/') end end
问题是,你怎么跑?
解决方法
保存
require 'rubygems' require 'capybara' require 'capybara/dsl' Capybara.run_server = false Capybara.current_driver = :selenium Capybara.app_host = 'http://www.google.com' module MyCapybaraTest class Test include Capybara::DSL def test_google visit('/') end end end t = MyCapybaraTest::Test.new t.test_google
to test.rb和简单地:ruby test.rb