how to run a standalone Capybara test?

Tags: ruby capybara
By : SergioB
Source: Stackoverflow.com
Question!

I'm trying to run a test against a remote server. i.e:

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

question is, how do you run it?

By : SergioB


Answers

I found this standalone cucumber thingy using the selenium driver a few days ago and got it up and running in a few minutes:

https://github.com/thuss/standalone-cucumber

I had to make a few mods:

My Gemfile is

source "http://rubygems.org"

group(:test) do
  gem 'cucumber'
  gem 'capybara'
  gem 'rspec'
  gem 'selenium-webdriver', '2.5.0'
end

And this is my env.rb

begin require 'rspec/expectations'; rescue LoadError; require 'spec/expectations'; end
require 'capybara' 
require 'capybara/dsl' 
require 'capybara/cucumber'
require 'selenium-webdriver'

Capybara.default_driver = :selenium
Capybara.app_host = 'http://something'
World(Capybara) 
By : Rimian


This video can help you solving your question :)
By: admin