水豚找不到按名称提交按钮
我在尝试从 webrat 切换到水豚时发生了一些奇怪的情况。错误是这样的:
And I press "Create floob"
# features/step_definitions/web_steps.rb:27
no button with value or id or text 'Create floob' found (Capybara::ElementNotFound)
我的应用程序中的 html 看起来像这样:
<fieldset class="buttons">
<ol>
<input id="floob_submit" name="commit" type="submit" value="Create floob" />
</ol>
</fieldset>
我本以为水豚会查看页面上按钮的 value
,并且阅读文档,情况似乎确实如此,但它不起作用!如果我将 cuke 文件中的行更改为 And I press "floob_submit"
一切正常,但我不想更改我的所有功能...
有谁对为什么会发生这种情况有任何想法如果有解决办法吗?谢谢朋友们!
I have some weirdness occurring while trying to switch from webrat to capybara. The error is this:
And I press "Create floob"
# features/step_definitions/web_steps.rb:27
no button with value or id or text 'Create floob' found (Capybara::ElementNotFound)
The html in my app looks like this:
<fieldset class="buttons">
<ol>
<input id="floob_submit" name="commit" type="submit" value="Create floob" />
</ol>
</fieldset>
I would have thought that capybara would look at the value
of the buttons on the page, and reading the documentation this does seem to be the case, but it's not working! If I change the line in my cuke file to And I press "floob_submit"
everything works, but I'd rather not change all my features...
Does anyone have any thoughts on why this might be happening and if there's a fix? Thanks friends!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我唯一能看到的是您没有将输入包装在
中。这可能足以让 DOM 造成您的问题。
The only thing I can see is that you aren't wrapping your input in an
<li></li>
. This might be confusing enough for the DOM to cause your problem.