小编Ale*_*nko的帖子

Capybara/Poltergeist - 等待 JavaScript 完成

在我通过设计登录后,我点击带有附加 javascript 的按钮,这使得一些 HTML 可见。

<button id="btn_simple_search" 
        class="btn btn-primary btn-md well_button" 
        data-toggle="button"
>
   Search
</button>
Run Code Online (Sandbox Code Playgroud)

调用函数

$("#btn_simple_search").click(function(){
   $("#simple_search").toggle(500);
});
Run Code Online (Sandbox Code Playgroud)

我希望水豚测试等到这个功能完成(我不知道 - 比如一些回调或其他东西)而不是sleep 0.6在我点击其他按钮或从新显示的 HTML 块中选择一些选项之前进行。我使用 Minitest 作为测试框架。怎么做?

上面的 javascript 直接嵌入在页面上。

ruby-on-rails capybara poltergeist

5
推荐指数
1
解决办法
2338
查看次数

行动超时 - 高塞拉

伙计们,昨天我升级到High Sierra.

之后 - 我无法启动我的项目导致此错误:

2017-09-27 16:52:48 +0300: Rack app error handling request { GET /unauthenticated }
#<Errno::ETIMEDOUT: Operation timed out - user specified timeout>
Run Code Online (Sandbox Code Playgroud)

下一个日志:

/Users/alex/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/socket.rb:61:in `connect_internal'
/Users/alex/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/socket.rb:137:in `connect'
/Users/alex/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/socket.rb:627:in `block in tcp'
/Users/alex/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/socket.rb:227:in `each'
/Users/alex/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/socket.rb:227:in `foreach'
/Users/alex/.rvm/rubies/ruby-2.4.1/lib/ruby/2.4.0/socket.rb:617:in `tcp'
/Users/alex/.rvm/gems/ruby-2.4.1/gems/webpacker-3.0.1/lib/webpacker/dev_server.rb:9:in `running?'
/Users/alex/.rvm/gems/ruby-2.4.1/gems/webpacker-3.0.1/lib/webpacker/dev_server_proxy.rb:7:in `rewrite_response'
/Users/alex/.rvm/gems/ruby-2.4.1/gems/rack-proxy-0.6.2/lib/rack/proxy.rb:57:in `call'
/Users/alex/.rvm/gems/ruby-2.4.1/gems/railties-5.1.4/lib/rails/engine.rb:522:in `call'
/Users/alex/.rvm/gems/ruby-2.4.1/gems/puma-3.10.0/lib/puma/configuration.rb:225:in `call'
/Users/alex/.rvm/gems/ruby-2.4.1/gems/puma-3.10.0/lib/puma/server.rb:605:in `handle_request'
/Users/alex/.rvm/gems/ruby-2.4.1/gems/puma-3.10.0/lib/puma/server.rb:437:in `process_client'
/Users/alex/.rvm/gems/ruby-2.4.1/gems/puma-3.10.0/lib/puma/server.rb:301:in `block in run'
/Users/alex/.rvm/gems/ruby-2.4.1/gems/puma-3.10.0/lib/puma/thread_pool.rb:120:in `block in spawn_thread'
Run Code Online (Sandbox Code Playgroud)

是否有人已经为自己修好了?

ruby puma webpacker macos-high-sierra

3
推荐指数
1
解决办法
391
查看次数