How to instruct phantomjs to avoid timeout when using binding.pry
Asked Answered
D

2

11

at some point, I don't know if you guys call it REPL-driven development or something, but I find myself inspecting the contents of my runtime by inserting a binding.pry call in some test. This works pretty well, except when I'm running Cucumber tests because I've chosen poltergeist as my capybara driver, which uses phantomjs. I can get the REPL to launch but after some time it's killed and I get a timeout error from phantomjs, I wonder whether there's a way to fix this, even if it includes switching to pry-remote or similar. This probably had been asked before but I just couldn't find an answer. Clues?

Dougall answered 16/9, 2013 at 13:31 Comment(2)
Have you tried pry-remote yet? It looks like this would help, since pry would run in a separate process.Theophylline
Did you find a solution for this? It happens to me, too.Leolaleoline
S
2

i put this in my spec_helper so i could set the timeout

Capybara.register_driver :poltergeist do |app|
  Capybara::Poltergeist::Driver.new(app, {timeout: 600, js_errors: false} )
end
Sesquialtera answered 3/6, 2015 at 3:12 Comment(0)
I
0

Within pry you should be able to do:

page.driver.timeout = 10000

or

Capybara.current_session.driver.timeout = 10000

This should get passed all the way down to the socket handling code and I think it will do the job, though I haven't tried it...

Irretentive answered 10/1, 2014 at 6:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.