Ruby on rails RSpec Capybara::ElementNotFound Ajax字段
在页面加载中,我有Ruby on rails RSpec Capybara::ElementNotFound Ajax字段,ruby-on-rails,ruby-on-rails-4,rspec,capybara,integration-testing,Ruby On Rails,Ruby On Rails 4,Rspec,Capybara,Integration Testing,在页面加载中,我有 <table id="identity"> <thead>...</thead> <tfooter>...</tfooter> </table> 这将返回错误: Failure/Error: page.find("#identity tbody").should have_content "TEST CONTENT" Capybara::ElementNotFound:
<table id="identity">
<thead>...</thead>
<tfooter>...</tfooter>
</table>
这将返回错误:
Failure/Error: page.find("#identity tbody").should have_content "TEST CONTENT"
Capybara::ElementNotFound:
Unable to find css "#identity tbody"
测试是在默认的等待时间下运行的,因此它显然不是在等待元素。默认等待时间是否有遗漏?根据此处的文档: 应该是这样的:
find("#identity").find("tbody").should have_content "TEST CONTENT"
你试过这个吗
Capybara.page.find("#identity").should have_content "TEST CONTENT"
当语法出现问题时,它不会等待默认时间
Capybara.page.find("#identity").should have_content "TEST CONTENT"