Skip to content

Instantly share code, notes, and snippets.

@thecatwasnot
Forked from onthespotqa/cucumber
Created October 6, 2011 04:12
Show Gist options
  • Save thecatwasnot/1266510 to your computer and use it in GitHub Desktop.
Save thecatwasnot/1266510 to your computer and use it in GitHub Desktop.
cucumber examples
feature file:
Feature: Cucumber Question
Scenario Outline: Google Search for <search term>
Given I am on Google Search Home Page
When I search for <search term>
Then I should find <search term>
Examples:
|search term|
|Facebook|
|Delicious|
step definitions:
Given /^I am on Google Search Home Page$/ do
@site.browser.title == "Google"
end
When /^I search for <search term>$/ do |search_term|
@site.google_search.set(search_term)
end
Then /^I should find <search term>$/ do |search_term|
@site.google_search_page.text.include?(search_term)
@site.browser.close
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment