您在每个步骤定义中都这样做吗? “鉴于我已登录”

发布于 2024-09-27 08:34:26 字数 100 浏览 0 评论 0原文

我是黄瓜新手。

对于网站的大部分功能,您都必须登录。

因此,在编写 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

得不到的就毁灭 2024-10-04 08:34:26

我通常会这样做,是的。对我来说,当您阅读测试并查看控制台中的输出时,情况似乎更清楚。

如果您不想重复,可以使用 背景 来设置常见的内容文件中的所有场景。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文