Sha256: 643269d91fc8352bf181612adafeb8628f81a3a543bfac32993b92bfc42a9766

Contents?: true

Size: 1.59 KB

Versions: 5

Compression:

Stored size: 1.59 KB

Contents

require 'acceptance_test'
require 'rspec/expectations'
require 'capybara/rspec'

RSpec::configure do |config|
  config.include Capybara::RSpecMatchers
end

# profile = Selenium::WebDriver::Chrome::Profile.new
# # profile['download.prompt_for_download'] = false
# profile['webdriver.chrome.driver'] = "c:\\work\\selenium-server\\chromedriver.exe"
#
# # properties[:profile] = profile
#
# properties = {}
# properties[:url] = "http://10.111.74.226:4444/wd/hub"
# properties[:browser] = :remote
# properties[:desired_capabilities] = Selenium::WebDriver::Remote::Capabilities.chrome(:profile => profile)
#
#
# # ENV['webdriver.chrome.driver'] = "c:\work\selenium-server\chromedriver.exe"
# #properties[:desired_capabilities]['webdriver.chrome.driver'] = "c:\work\selenium-server\chromedriver.exe"

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

require 'test_helper'
require 'pages/wikipedia_pages'

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

  let(:pages) { WikipediaPages.new(self) }

  before do |example|
    AcceptanceTest.instance.setup page, example.metadata

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

  after do |example|
    AcceptanceTest.instance.teardown page, example.metadata
  end

  it "searches on wikipedia web site" do
    pages.execute do
      visit_home_page

      enter_word "Capybara"

      submit_request

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
acceptance_test-1.9.13 spec/acceptance/search_with_pages_spec.rb
acceptance_test-1.9.12 spec/acceptance/search_with_pages_spec.rb
acceptance_test-1.9.11 spec/acceptance/search_with_pages_spec.rb
acceptance_test-1.9.10 spec/acceptance/search_with_pages_spec.rb
acceptance_test-1.9.9 spec/acceptance/search_with_pages_spec.rb