Sha256: 981df4a91672467df59cdb099c3aba3dc275dd0cdd02f33aaa922893b6ed7d9a
Contents?: true
Size: 847 Bytes
Versions: 2
Compression:
Stored size: 847 Bytes
Contents
require 'spec' case PLATFORM when /darwin/ require 'safariwatir' Watir::Browser = Watir::Safari when /win32|mingw/ require 'watir' Watir::Browser = Watir::IE when /java/ require 'celerity' Watir::Browser = Celerity::Browser else raise "This platform is not supported (#{PLATFORM})" 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 Before do @b = Watir::Browser.new end After do @b.close 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
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
aslakhellesoy-cucumber-0.1.3 | examples/watir/features/steps/stories_steps.rb |
aslakhellesoy-cucumber-0.1.4 | examples/watir/features/steps/stories_steps.rb |