Split up Cucumber and RSpec support

This commit is contained in:
John Bintz 2015-01-09 11:40:19 -05:00
parent e738bab0f4
commit ad5d5c5d05
3 changed files with 20 additions and 7 deletions

View File

@ -0,0 +1,8 @@
require_relative './driver'
Before do
if Capybara.current_driver == :persistent_selenium
Capybara.server_port ||= '3001'
Capybara.app_host ||= "http://localhost:#{Capybara.server_port}"
end
end

View File

@ -5,16 +5,11 @@ require 'capybara/selenium/driver'
# make sure these classes exist on this end
[ Selenium::WebDriver::Error::StaleElementReferenceError, Selenium::WebDriver::Error::UnhandledError, Selenium::WebDriver::Error::ElementNotVisibleError ]
Before do
if Capybara.current_driver == :persistent_selenium
Capybara.server_port ||= '3001'
Capybara.app_host ||= "http://localhost:#{Capybara.server_port}"
end
end
require 'persistent_selenium/drb'
Capybara.register_driver :persistent_selenium do |app|
require 'drb'
service = DRb.start_service
browser = DRbObject.new nil, PersistentSelenium.url

View File

@ -0,0 +1,10 @@
require_relative './driver'
RSpec.configure do |c|
c.before :each do
if Capybara.current_driver == :persistent_selenium
Capybara.server_port ||= '3001'
Capybara.app_host ||= "http://localhost:#{Capybara.server_port}"
end
end
end