I’ve updated my tests of external webpages using cucumber. If you like to test the amount of results of the google search we tested last time you can get the content of a special tag on the result of the query using the following step
Then /^I should get more than (d+) results$/ do |arg1| page.find('#resultStats').text.sub('.', '').scan(/d+/).to_i.should be > arg1.to_i end
I also prepared the cucumber steps for using the ruby debugger if something goes wrong.
Here you have use the ruby gem ruby-debug19 and start the debugger in the step with the debugger command. First you have to require the gem in env.rb