Skip to content

Commit

Permalink
Added my Cucumber+Watir 101 Lightning talk from AWTA
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Hoover authored and Dave Hoover committed Jan 18, 2009
1 parent a7a86ec commit cc9f6f0
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
8 changes: 8 additions & 0 deletions cucumber_watir_101/features/google_search.feature
@@ -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 cucumber_watir_101/features/step_definitions/google_search.rb
@@ -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

0 comments on commit cc9f6f0

Please sign in to comment.