[英]Check if JS box exists with RSpec + capybara-webkit
I'm using RSpec + capybara, and the capybara-webkit as driver. 我正在使用RSpec + capybara,以及capybara-webkit作为驱动程序。 I have to check if a JS box exists in the page after clicking on a button, but with no results.
单击按钮后,我必须检查页面中是否存在JS框,但没有结果。 If I use selenium as a driver, the test passes, but I need to use capybara-webkit.
如果我使用硒作为驱动程序,则测试通过,但是我需要使用capybara-webkit。
I'm using 我正在使用
expect(page).to have_selector(#js_window)
My configuration is 我的配置是
Capybara.run_server = false
Capybara.default_selector = :css
Capybara.default_max_wait_time = 1
Capybara.javascript_driver = :webkit
RSpec.configure do |config|
config.include Capybara::DSL
end
In the end, it was a problem with my config.block_unknown_urls (I was blocking the url I needed) and the default_max_wait_time (I changed it from 1 to 3). 最后,这是我的config.block_unknown_urls(我阻止了所需的URL)和default_max_wait_time(我将其从1更改为3)的问题。 Solved now!
现在解决了!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.