【发布时间】:2020-05-16 09:27:27
【问题描述】:
我目前正在评估 CodeceptJS 作为我们繁重的 Java/Selenium/Cucumber 堆栈的替代方案。我是这样组织项目的:
- 使用 BDD(一切都以功能文件开头)。
- 功能文件中的每个步骤都有步骤定义。
- 步骤定义使用相应页面对象中的方法。
当我运行示例项目时,我得到如下输出:
USER REGISTRATION --
As someone who is not a member
I would like the ability to sign up
So that I can enjoy the benefits of Widget XYZ's services
Register account from the signed out homepage
Given I open the homepage
signedOutHomePage: open
✔ OK in 3230ms
上述测试使用:
npx codeceptjs run --steps
是否可以抑制页面对象的输出(即不显示signedOutHomePage: open 行)?
更新(另一个问题):如果我使用 BDD,我什至应该使用 PageObjects 吗?
【问题讨论】:
-
您应该避免一次问多个问题。并且可以将页面对象与 BDD 一起使用。我一直都这样做。您可以发布页面对象的代码吗?看起来有些东西正在写入标准输出,这就是您所看到的。
标签: bdd codeceptjs