我编写了一个测试框架(支持Selenuim)。 它的工作方式是这样的,当我创建测试时,我只需要扩展基类..
class NewTest extend BaseTest {
@Test
public ABC() {
this.sel.driver. ....
}
}
我的问题是如何将 Cucumber 集成到我的框架中,其中框架是 Selenium 驱动程序、数据库连接、屏幕截图等的提供者
我们的想法是使其不干扰 Cucumber 的正常编程流程。
我还使用 maven 和 junit。
最佳答案
@Test 适用于 Junit
,不适用于 cucumber
。
使用小 cucumber 语言的 cucumber
您可以从下面的教程中查看cucumber的设置和使用
https://www.toolsqa.com/cucumber-tutorial/
My question is how to integrate Cucumber into my framework, where the Framework is the provider of the Selenium driver, db connections,screenshots, ...etc
只需创建一个包并将 db、selenium 等类添加到其中,就像我们在普通框架中一样在脚本中调用它们。
请注意,cucumber 只是提供了一个从功能和使用钩子(Hook)运行项目的流程。所以学习并在 cucumber 中进行 poc,你就会明白你需要在哪里调用什么。
关于java - 将 Cucumber 集成到测试框架中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58293748/