Sha256: 995fe9ee9aec769a4cd08b7386926b855135972699e85c3566f210329a49fac4
Contents?: true
Size: 819 Bytes
Versions: 20
Compression:
Stored size: 819 Bytes
Contents
require 'spec' case PLATFORM when /darwin/ require 'safariwatir' Browser = Watir::Safari when /win32|mingw/ require 'watir' Browser = Watir::IE when /java/ require 'celerity' Browser = Celerity::Browser else raise "This platform is not supported (#{PLATFORM})" end Before do @b = Browser.new end After do @b.close end class GoogleSearch def initialize(b) @b = b end def goto @b.goto 'http://www.google.com/' end def search(text) @b.text_field(:name, 'q').set(text) @b.button(:name, 'btnG').click end end Given 'I am on the Google search page' do @page = GoogleSearch.new(@b) @page.goto end When /I search for "(.*)"/ do |query| @page.search(query) end Then /I should see a link to "(.*)":(.*)/ do |text, url| @b.link(:url, url).text.should == text end
Version data entries
20 entries across 20 versions & 5 rubygems