Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added my Cucumber+Watir 101 Lightning talk from AWTA
- Loading branch information
Dave Hoover
authored and
Dave Hoover
committed
Jan 18, 2009
1 parent
a7a86ec
commit cc9f6f0
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
Feature: Google Search | ||
In order to find out more infomration about AWTA | ||
I need to be able to search Google | ||
|
||
Scenario: Google Search for AWTA | ||
Given that we are on the Google Homepage | ||
When I search for AWTA | ||
Then I should see "Austin Workshop on Test Automation" |
20 changes: 20 additions & 0 deletions
20
cucumber_watir_101/features/step_definitions/google_search.rb
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require "spec" | ||
require "safariwatir" | ||
|
||
BROWSER = Watir::Safari.new | ||
PAGES = { | ||
"Google Homepage" => "http://google.com" | ||
} | ||
|
||
Given /^that we are on the (.*)$/ do |page| | ||
BROWSER.goto(PAGES[page]) | ||
end | ||
|
||
When /^I search for (.*)$/ do |query| | ||
BROWSER.text_field(:name, "q").set(query) | ||
BROWSER.button(:name, "btnG").click | ||
end | ||
|
||
Then /^I should see "(.*)"$/ do |text| | ||
BROWSER.html.include?(text).should == true | ||
end |