【发布时间】:2013-04-09 04:36:22
【问题描述】:
我目前正在对 Filepicker.io 上传表单进行功能测试,但无法让文件上传正常工作。我正在为 Capybara 使用Poltergeist 驱动程序,并且从我能够进行的调试中,Filepicker iframe 永远不会加载。我已经通过 Poltergeist 的远程调试确认了这一点。
这是一个测试代码示例:
within_fieldset 'Photos' do
click_button 'Find Photo'
end
within_frame 'filepicker_dialog' do
attach_file '#fileUploadInput', Rails.root.join('spec', 'files', 'photo.jpg')
end
以及正在产生的错误:
Failure/Error: within_frame '#filepicker_dialog' do
Capybara::Poltergeist::TimeoutError:
Timed out waiting for response to {"name":"push_frame","args":["#filepicker_dialog"]}. It's possible that this happened because something took a very long time (for example a page load was slow). If so, setting the Poltergeist :timeout option to a higher value will help (see the docs for details). If increasing the timeout does not help, this is probably a bug in Poltergeist - please report it to the issue tracker.
尝试通过 javascript 控制台手动触发 Filepicker 也不会产生任何结果。
【问题讨论】:
-
我能够遵循本指南mscottford.com/post/30910962407/…,并使用 Poltergeist 进行远程调试。进一步检查页面后,我可以看到 Filepicker 界面和 iframe 没有打开,但是没有给出控制台错误。
标签: ruby rspec capybara filepicker.io poltergeist