Skip to content

Instantly share code, notes, and snippets.

@jarmo
Created February 17, 2011 13:24
Show Gist options
  • Save jarmo/831718 to your computer and use it in GitHub Desktop.
Save jarmo/831718 to your computer and use it in GitHub Desktop.
require "watir"
describe "Google" do
before :all do
@browser = Watir::Browser.new
@browser.goto "http://google.com/ncr"
end
it "allows to search" do
search_field = @browser.text_field(:name => "q")
search_field.should exist
search_field.should be_visible
search_field.set "codeborne"
@browser.wait_until do
@browser.text.include? "Codeborne"
end
end
after :all do
@browser.close
end
end
require "watir"
browser = Watir::Browser.new
browser.goto "http://google.com/ncr"
search_field = browser.text_field(:name => "q")
search_field.should exist
search_field.should be_visible
search_field.set "codeborne"
browser.wait_until do
browser.text.include? "Codeborne"
end
browser.close
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment