Skip to content

Instantly share code, notes, and snippets.

@onthespotqa
Created October 6, 2011 03:59
Show Gist options
  • Save onthespotqa/1266476 to your computer and use it in GitHub Desktop.
Save onthespotqa/1266476 to your computer and use it in GitHub Desktop.
cucumber examples
feature:
Feature: Cucumber Question
Scenario Outline: Google Search for <search term>
Given I am on Google Search Home Page
When I search for "<Search>"
Then I should find "<Search>"
Examples:
| Search |
| Facebook |
| Delicious |
steps:
Before do
@site = Bookmarks.new
end
Given /^I am on Google Search Home Page$/ do
@site.google_search_page.title == "Google"
end
When /^I search for "([^"]*)"$/ do |arg1|
@site.google_search(arg1)
end
Then /^I should find "([^"]*)"$/ do |arg1|
@site.google_search_page.text.include?(arg1)
@site.browser.close
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment