Cucumber class extending step definitions and hooks

天大地大妈咪最大 提交于 2019-12-01 03:53:30

Check this discussion.

Hope this Helps.

Servio Andrés Pantoja Rosero

As I understand your problem, you want to reduce the logic for steps. Here is the solution.

1) Define a common class in this case A with steps in a general package like co.com.test

2) Define the steps config to use the base package

@CucumberOptions(format = {"pretty", "html:target/html/"},
features = {"src/test/resources/acceptance/general/general.feature"},
glue = {"co.com.test"})

3) Doesn't inheritance from class B with specific steps to A

It will cause that steps will be searched in all packages and will find the common steps and the specific steps.

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