disables js fx in specs via poltergeist config

This commit is contained in:
Juanjo Bazán
2016-03-04 11:33:59 +01:00
committed by Juanjo Bazán
parent 2a4adc2e60
commit 4a888e95c2
3 changed files with 5 additions and 6 deletions

View File

@@ -16,11 +16,6 @@
<%= content_for :social_media_meta_tags %> <%= content_for :social_media_meta_tags %>
<%= setting['per_page_code'].try(:html_safe) %> <%= setting['per_page_code'].try(:html_safe) %>
<% if Rails.env.test? %>
<%= javascript_tag "$.fx.off = true;" %>
<% end %>
</head> </head>
<body> <body>
<div class="wrapper"> <div class="wrapper">

View File

@@ -28,7 +28,8 @@ Capybara.register_driver :poltergeist do |app|
Capybara::Poltergeist::Driver.new(app, Capybara::Poltergeist::Driver.new(app,
inspector: true, # allows remote debugging by executing page.driver.debug inspector: true, # allows remote debugging by executing page.driver.debug
phantomjs_logger: File.open(File::NULL, "w"), # don't print console.log calls in console phantomjs_logger: File.open(File::NULL, "w"), # don't print console.log calls in console
phantomjs_options: ['--load-images=no', '--disk-cache=false'] phantomjs_options: ['--load-images=no', '--disk-cache=false'],
extensions: [File.expand_path("../support/phantomjs_ext/disable_js_fx.js", __FILE__)] # disable js effects
) )
end end

View File

@@ -0,0 +1,3 @@
document.addEventListener("DOMContentLoaded", function() {
$.fx.off = true;
});