From 448fc23e4743198f2c1bf3cd10eb515eeb9f424b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Thu, 8 Jun 2017 11:55:07 +0200 Subject: Let PhantomJS load local images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change fix a memory leak due to a Webkit bug: https://github.com/ariya/phantomjs/issues/12903 Also: - Whitelist only localhost and 127.0.0.1 in Capybara + JS specs - Blacklist all requests to media such as images, videos, PDFs, CSVs etc. - Log all the requests made. Signed-off-by: Rémy Coutable --- spec/support/capybara.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'spec/support') diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index b8ca8f22a3d..c34e76fa72f 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -14,8 +14,10 @@ Capybara.register_driver :poltergeist do |app| js_errors: true, timeout: timeout, window_size: [1366, 768], + url_whitelist: %w[localhost 127.0.0.1], + url_blacklist: %w[.mp4 .png .gif .avi .bmp .jpg .jpeg], phantomjs_options: [ - '--load-images=no' + '--load-images=yes' ] ) end -- cgit v1.2.3