Sha256: 7c5a5ab393444fa280412dae33a37233e44e2b18ffa160251cff3b6ff2b1fa60

Contents?: true

Size: 1.28 KB

Versions: 6

Compression:

Stored size: 1.28 KB

Contents

require File.expand_path("spec/features/spec_helper")

RSpec.describe 'Google Search' do
  include_context "GoogleAcceptanceTest"

  before :all do
    acceptance_test.app_host = "http://www.google.com"
  end

  before do
    puts "Using driver: #{Capybara.current_driver}."
    puts "Default wait time: #{Capybara.default_wait_time}."
  end

  it "uses selenium driver", driver: :selenium, exclude: false do
    visit('/')

    fill_in "q", :with => "Capybara"

    find("#gbqfbw button").click

    # all(:xpath, "//li[@class='g']/h3/a").each { |a| puts a[:href] }
  end

  it "uses webkit driver", driver: :webkit do
    pending
    visit('/')

    fill_in "q", :with => "Capybara"

    has_selector? ".gsfs .gssb_g span.ds input.lsb", :visible => true # wait for ajax to be finished

    button = first(".gsfs .gssb_g span.ds input.lsb")

    button.click

    #all(:xpath, "//li[@class='g']/h3/a").each { |a| puts a[:href] }
  end

  it "uses poltergeist driver", driver: :poltergeist do
    pending
    visit('/')

    fill_in "q", :with => "Capybara"

    has_selector? ".gsfs .gssb_g span.ds input.lsb", :visible => true # wait for ajax to be finished

    button = first(".gsfs .gssb_g span.ds input.lsb")

    button.click

    all(:xpath, "//li[@class='g']/h3/a").each { |a| puts a[:href] }
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
acceptance_test-1.4.5 spec/features/google_search_spec.rb
acceptance_test-1.4.4 spec/features/google_search_spec.rb
acceptance_test-1.4.3 spec/features/google_search_spec.rb
acceptance_test-1.4.2 spec/features/google_search_spec.rb
acceptance_test-1.4.1 spec/features/google_search_spec.rb
acceptance_test-1.4.0 spec/features/google_search_spec.rb