将输入标签与 Cucumber/Webrat 匹配
我正在学习 Cucumber,但我无法仅匹配输入标签。
我在视图中看到的是
<input type="submit" value="Press!" />
,我在 Cucumber 中尝试过的是,
Then the "input" field should contain "Press!"
Then the "type" field should contain "submit"
我只是想确认具有某些值的输入标签的存在。没有互动。
I'm learning Cucumber, but I can't make a step for just matching input tags.
What I have in the view is
<input type="submit" value="Press!" />
And what I tried in Cucumber are
Then the "input" field should contain "Press!"
Then the "type" field should contain "submit"
I just wanna confirm the existence for the input tags with certain values. No interaction.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
试试这个:
然后我应该看到“按!”在“输入[类型=\”提交\“]”内
Try this:
Then I should see "Press!" within "input[type=\"submit\"]"
webrat 也明确支持它们。即使您找不到 Cucumber 的内置支持,您也可以随时放入自己的步骤定义中。
来源:http://cheat.errtheblog.com/s/webrat/
They're also explicitly supported in webrat. Even if you can't find the built-in support in cucumber, you can always just drop into your own step definitions.
source: http://cheat.errtheblog.com/s/webrat/
您可以使用类似以下内容:
或
You can use something like:
or