Sha256: 98dc30fec9f561ee7d8259d567ea782aca4f94c8810d568a523e450cf3ffe4d8

Contents?: true

Size: 1.35 KB

Versions: 18

Compression:

Stored size: 1.35 KB

Contents

require 'rspec/expectations'
require 'acceptance_test'

AcceptanceTest.instance.configure({webapp_url: 'http://www.wikipedia.org', timeout_in_seconds: 10})

AcceptanceTest.instance.driver_manager.register_driver(:selenium, :chrome)
AcceptanceTest.instance.driver_manager.register_driver(:webkit)
AcceptanceTest.instance.driver_manager.register_driver(:poltergeist)

RSpec.describe 'Wikipedia Search' do
  include Capybara::DSL

  before do
    AcceptanceTest.instance.setup
    AcceptanceTest.instance.driver_manager.use_driver(:selenium_chrome)

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

  after do
    AcceptanceTest.instance.teardown
  end

  it "uses selenium driver" do
    visit('/')

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

    find(".formBtn", match: :first).click

    expect(page).to have_content "Hydrochoerus hydrochaeris"
  end

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

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

    find(".formBtn", match: :first).click

    expect(page).to have_content "Hydrochoerus hydrochaeris"
  end

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

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

    find(".formBtn", match: :first).click

    expect(page).to have_content "Hydrochoerus hydrochaeris"
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
acceptance_test-1.8.4 spec/wikipedia_search_spec.rb
acceptance_test-1.8.3 spec/wikipedia_search_spec.rb
acceptance_test-1.8.2 spec/wikipedia_search_spec.rb
acceptance_test-1.8.1 spec/wikipedia_search_spec.rb
acceptance_test-1.8.0 spec/wikipedia_search_spec.rb
acceptance_test-1.7.14 spec/wikipedia_search_spec.rb
acceptance_test-1.7.13 spec/wikipedia_search_spec.rb
acceptance_test-1.7.12 spec/wikipedia_search_spec.rb
acceptance_test-1.7.11 spec/wikipedia_search_spec.rb
acceptance_test-1.7.9 spec/wikipedia_search_spec.rb
acceptance_test-1.7.8 spec/wikipedia_search_spec.rb
acceptance_test-1.7.7 spec/wikipedia_search_spec.rb
acceptance_test-1.7.6 spec/wikipedia_search_spec.rb
acceptance_test-1.7.5 spec/wikipedia_search_spec.rb
acceptance_test-1.7.4 spec/wikipedia_search_spec.rb
acceptance_test-1.7.3 spec/wikipedia_search_spec.rb
acceptance_test-1.7.2 spec/wikipedia_search_spec.rb
acceptance_test-1.7.1 spec/wikipedia_search_spec.rb