Skip to content

Instantly share code, notes, and snippets.

@nickzam
Created May 30, 2012 13:39
Show Gist options
  • Save nickzam/2836377 to your computer and use it in GitHub Desktop.
Save nickzam/2836377 to your computer and use it in GitHub Desktop.
require 'httparty'
require 'capybara'
require 'capybara/dsl'
include Capybara::DSL
require 'capybara-webkit'
Given /^"(.*?)" in search bar on site "(.*?)"$/ do |item, url|
@response = HTTParty.get(url)
@response.code.should eq 200
$url = url or 'http://www.reviewcentre.com'
$item = item
end
Capybara.run_server = false
Capybara.default_driver = :webkit
Capybara.javascript_driver = :webkit
Capybara.app_host = $url
When /^it has all possible matched items labelled "(.*?)"$/ do |match_label|
visit($url)
fill_in('SearchField',:with => $item).should eq ""
find('#SiteSeachSubmit').click.should eq 'ok'
$match_label = match_label
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment