2013-01-26 00:01:49 +00:00
|
|
|
# capybara drivers for fast testing
|
|
|
|
#
|
2013-07-09 21:11:22 +00:00
|
|
|
<% if rails %>
|
2013-01-26 00:01:49 +00:00
|
|
|
# this one runs your entire test suite
|
|
|
|
require 'capybara/poltergeist'
|
|
|
|
|
|
|
|
# this one runs while you continuously test via guard
|
|
|
|
require 'persistent_selenium/driver'
|
|
|
|
|
|
|
|
# you can override the driver with the DRIVER environment variable
|
|
|
|
ENV['DRIVER'] ||= 'persistent_selenium'
|
|
|
|
|
2013-02-25 18:19:44 +00:00
|
|
|
# if PhantomJS is having problems clicking something, use dom_click
|
|
|
|
class Capybara::Node::Element
|
|
|
|
def dom_click
|
|
|
|
synchronize do
|
|
|
|
begin
|
|
|
|
trigger('click')
|
|
|
|
rescue NotImplementedError, Capybara::NotSupportedByDriverError
|
|
|
|
click
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2013-07-09 21:11:22 +00:00
|
|
|
<% end %>
|