Created
May 30, 2012 13:39
-
-
Save nickzam/2836377 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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