黄瓜记录 ID
鉴于 Cucumber 中的以下内容:
Given a car exists with title: "Toyota"
And I go to path "/cars"
And I follow "Toyota Page"
And I should be on path "/cars/CAR_ID"
Where CAR_ID is the ID of the car titled "Toyota".
我如何找出该 ID?
谢谢!
Given the following in Cucumber:
Given a car exists with title: "Toyota"
And I go to path "/cars"
And I follow "Toyota Page"
And I should be on path "/cars/CAR_ID"
Where CAR_ID is the ID of the car titled "Toyota".
How do I figure out that ID?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以这样写:
最后一步的定义可以是:
You could write it like:
The definition for the last step could be:
查看:http://railscasts.com/episodes/186-pickle-with-cucumber
特别看一下他创建产品的 pickle 示例:
请注意他如何将创建的产品称为该产品。 Pickle 会为你解决这个问题。
祝你好运。
Check out: http://railscasts.com/episodes/186-pickle-with-cucumber
In particular look at the pickle example where he creates a product:
Note how he refers to the created product as that product. Pickle will take care of that for you.
Good luck.