When I run workshops to review and improve people’s automated tests, a common problem I see is the use of sleeps. I have a simple rule about sleeps: I might use them to diagnose a race condition, but I never check them into source control. This blog post will look at what it means to …
Tag Archives: Capybara
Using Capybara with RSpec Outside Cucumber
If you want to try using Capybara for browser automation on it’s own, here’s a simple script to get you started: require ‘rubygems’ require ‘capybara’ require ‘capybara/dsl’ Capybara.default_driver = :selenium Capybara.app_host = “http://www.google.com” require “rspec/expectations” class Google include Capybara include RSpec::Matchers def search_for(text) visit “/” fill_in “q”, :with => text click_button “Search” end def ensure_results_contain(expected_text) …
Continue reading “Using Capybara with RSpec Outside Cucumber”