当我使用 Capybara/webkit 运行集成测试时,我收到以下错误消息:
undefined|36|TypeError: Result of expression 'node' [undefined] is not an object.
但是,它不会导致测试失败,也不会总是发生。当它确实发生时,它似乎发生在测试中的同一点(就在最终断言之前)
测试:
it "does something with things" do
#....
within('#dialog_box') do
click_button 'Save'
end
puts 'after within'
page.should have_content(thing_attrs[:name])
puts 'after assertion'
end
最终输出:
after within
undefined|36|TypeError: Result of expression 'node' [undefined] is not an object.
after assertion
does something with things [pass]
我怎样才能缩小造成这种情况的原因?它使测试输出变得丑陋:)