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

Version Path
aslakhellesoy-cucumber-0.1.10 examples/watir/features/step_definitons/stories_steps.rb
aslakhellesoy-cucumber-0.1.11 examples/watir/features/step_definitons/stories_steps.rb
aslakhellesoy-cucumber-0.1.12 examples/watir/features/step_definitons/stories_steps.rb
aslakhellesoy-cucumber-0.1.13.2 examples/watir/features/step_definitons/stories_steps.rb
aslakhellesoy-cucumber-0.1.13 examples/watir/features/step_definitons/stories_steps.rb
aslakhellesoy-cucumber-0.1.9 examples/watir/features/step_definitons/stories_steps.rb
bts-cucumber-0.1.13.1 examples/watir/features/step_definitons/stories_steps.rb
bts-cucumber-0.1.13.2 examples/watir/features/step_definitons/stories_steps.rb
bts-cucumber-0.1.13.3 examples/watir/features/step_definitons/stories_steps.rb
elight-cucumber-0.1.9 examples/watir/features/steps/stories_steps.rb
jeffrafter-cucumber-0.1.10 examples/watir/features/step_definitons/stories_steps.rb
jeffrafter-cucumber-0.1.12 examples/watir/features/step_definitons/stories_steps.rb
cucumber-0.1.10 examples/watir/features/step_definitons/stories_steps.rb
cucumber-0.1.11 examples/watir/features/step_definitons/stories_steps.rb
cucumber-0.1.13 examples/watir/features/step_definitons/stories_steps.rb
cucumber-0.1.12 examples/watir/features/step_definitons/stories_steps.rb
cucumber-0.1.7 examples/watir/features/steps/stories_steps.rb
cucumber-0.1.6 examples/watir/features/steps/stories_steps.rb
cucumber-0.1.8 examples/watir/features/steps/stories_steps.rb
cucumber-0.1.9 examples/watir/features/step_definitons/stories_steps.rb