Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/database/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 如何指导phantomjs在使用binding.pry时避免超时_Ruby On Rails_Capybara_Phantomjs_Pry_Poltergeist - Fatal编程技术网

Ruby on rails 如何指导phantomjs在使用binding.pry时避免超时

Ruby on rails 如何指导phantomjs在使用binding.pry时避免超时,ruby-on-rails,capybara,phantomjs,pry,poltergeist,Ruby On Rails,Capybara,Phantomjs,Pry,Poltergeist,在某种程度上,我不知道你们是否称之为REPL驱动的开发或其他什么,但我发现自己通过在一些测试中插入binding.pry调用来检查运行时的内容。除了运行Cucumber测试外,它工作得非常好,因为我选择了poltergeist作为我的capybara驱动程序,它使用phantomjs。我可以让REPL启动,但在一段时间后它被终止,并且我从phantomjs得到一个超时错误,我想知道是否有办法解决这个问题,即使它包括切换到pry remote或类似的。这个问题以前可能有人问过,但我就是找不到答案。

在某种程度上,我不知道你们是否称之为REPL驱动的开发或其他什么,但我发现自己通过在一些测试中插入
binding.pry
调用来检查运行时的内容。除了运行Cucumber测试外,它工作得非常好,因为我选择了
poltergeist
作为我的
capybara
驱动程序,它使用
phantomjs
。我可以让REPL启动,但在一段时间后它被终止,并且我从
phantomjs
得到一个超时错误,我想知道是否有办法解决这个问题,即使它包括切换到
pry remote
或类似的。这个问题以前可能有人问过,但我就是找不到答案。线索?

在pry中,您应该能够:

page.driver.timeout = 10000


这应该一直传递到套接字处理代码,我认为它可以完成这项工作,尽管我还没有尝试过…

我把它放在我的spec\u助手中,以便设置超时

Capybara.register_driver :poltergeist do |app|
  Capybara::Poltergeist::Driver.new(app, {timeout: 600, js_errors: false} )
end

你试过撬遥控器了吗?看起来这会有所帮助,因为pry将在一个单独的进程中运行。您找到解决方案了吗?这也发生在我身上。
Capybara.register_driver :poltergeist do |app|
  Capybara::Poltergeist::Driver.new(app, {timeout: 600, js_errors: false} )
end