Cucumber with TestNG

蹲街弑〆低调 提交于 2019-12-20 18:09:45

问题


We have a very extensive framework in TestNG with Selenium WebDriver and I want to be able to continue using it, but use Cucumber BDD with it.I am aware that Cucumber works with JUnit, but not sure if it works with TestNG.

Can anyone let me know if this is going to be available anytime soon ? If not, are there any workarounds so that I can use Cucumber with TestNG?

Also, are there any other BDDs that are available in the market which can be used with TestNG ?


回答1:


Dependency in maven's pom:

    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-testng</artifactId>
        <version>1.1.5</version>
        <scope>test</scope>
    </dependency>

Test running the features:

import cucumber.api.testng.AbstractTestNGCucumberTests;

public class CucumberTets extends AbstractTestNGCucumberTests {

}


来源:https://stackoverflow.com/questions/15595047/cucumber-with-testng

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!