Created
June 6, 2013 16:18
-
-
Save afgomez/5722807 to your computer and use it in GitHub Desktop.
Easy way to allow remote inspection in poltergeist/capybara
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spec/features/random_spec.rb | |
require 'spec_helper' | |
describe "Random feature" do | |
it "Does't have debugging" do | |
# ... | |
# page.driver.debug | |
end | |
debugit "Does have debugging" do | |
# ... | |
page.driver.debug | |
end | |
end | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# spec/spec_helper.rb | |
# ... | |
require 'capybara/poltergeist' | |
Capybara.register_driver :poltergeist_debug do |app| | |
Capybara::Poltergeist::Driver.new(app, :inspector => true) | |
end | |
# ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# support/spec_methods.rb | |
def debugit( *args, &block ) | |
it( *args, { driver: :poltergeist_debug, inspector: true }, &block ) | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment