您在每个步骤定义中都这样做吗? “鉴于我已登录”
我是黄瓜新手。
对于网站的大部分功能,您都必须登录。
因此,在编写 Cucumber 时,您是否会编写假设我已登录
每个步骤定义?
I am new to cucumber.
And for most of the site's functionality, you have to be logged in.
So when writing cucumber, do you write, given that I am logged in
for every step definition?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我通常会这样做,是的。对我来说,当您阅读测试并查看控制台中的输出时,情况似乎更清楚。
如果您不想重复,可以使用 背景 来设置常见的内容文件中的所有场景。
I typically do, yes. For me, it seems clearer when you're reading the tests and seeing the output in the console.
If you don't want the duplication you can use a Background to setup stuff that's common to all the scenarios in the file.