Split up Cucumber and RSpec support
This commit is contained in:
parent
fdeb1b9eb5
commit
5e205ea347
8
lib/persistent_selenium/cucumber.rb
Normal file
8
lib/persistent_selenium/cucumber.rb
Normal 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
|
@ -4,13 +4,6 @@ require 'capybara/selenium/driver'
|
|||||||
# make sure these classes exist on this end
|
# make sure these classes exist on this end
|
||||||
[ Selenium::WebDriver::Error::StaleElementReferenceError, Selenium::WebDriver::Error::UnhandledError, Selenium::WebDriver::Error::ElementNotVisibleError ]
|
[ 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
|
|
||||||
|
|
||||||
Capybara.register_driver :persistent_selenium do |app|
|
Capybara.register_driver :persistent_selenium do |app|
|
||||||
require 'drb'
|
require 'drb'
|
||||||
|
|
||||||
|
10
lib/persistent_selenium/rspec.rb
Normal file
10
lib/persistent_selenium/rspec.rb
Normal 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
|
Loading…
Reference in New Issue
Block a user