From 3493321248df4d0d4827f61a6cdc2ecebf893daf Mon Sep 17 00:00:00 2001 From: Jason Chen Date: Sun, 28 Jan 2018 13:48:16 -0500 Subject: [PATCH] Make poltergeist able to show debug web inspector With the poltergeist_debug driver, you can now put 'page.driver.debug' in the cucumber step definitions and capybara will pause when it gets to the line and open a web inspector window of the tests in which you can see the errors. --- features/support/poltergeist.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/features/support/poltergeist.rb b/features/support/poltergeist.rb index bbcfd251..5160e10e 100644 --- a/features/support/poltergeist.rb +++ b/features/support/poltergeist.rb @@ -1,2 +1,7 @@ require 'capybara/poltergeist' -Capybara.javascript_driver = :poltergeist + +Capybara.register_driver :poltergeist_debug do |app| + Capybara::Poltergeist::Driver.new(app, :inspector => true) +end + +Capybara.javascript_driver = :poltergeist_debug