Sha256: d39cd769c91ed9b86284ec6b22235fca9bcec4297639fba239ab3f462530c9d7

Contents?: true

Size: 1.24 KB

Versions: 3

Compression:

Stored size: 1.24 KB

Contents

require 'acceptance_test'

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

  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

3 entries across 3 versions & 1 rubygems

Version Path
acceptance_test-1.3.1 spec/features/google_search_spec.rb
acceptance_test-1.3.0 spec/features/google_search_spec.rb
acceptance_test-1.2.0 spec/features/google_search_spec.rb