Add this line to to your Gemfile:
gem "acceptance_test"
And then execute:
$ bundle
Your spec class:
require 'acceptance_test'
describe 'Google Search' do
include_context "AcceptanceTest"
before :all do
acceptance_test.app_host = "http://www.google.com"
end
it "uses selenium driver", driver: :selenium, exclude: false do
visit('/')
fill_in "q", :with => "Capybara"
#save_and_open_page
find("#gbqfbw button").click
all(:xpath, "//li[@class='g']/h3/a").each { |a| puts a[:href] }
end
end
Your spec class:
require 'acceptance_test'
describe 'Google Search' do
include_context "AcceptanceTest"
before :all do
selenium_config_file = "spec/features/selenium.yml"
selenium_config_name = "test"
acceptance_test.load_selenium_config selenium_config_file, selenium_config_name
end
it "do something" do
# ...
end
end
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request