简体   繁体   中英

Cucumber Java: Features File Mapping to Step Definitions

If i have 5 features file and 5 steps definitions. How cucumber know how to map the correct feature file to class? Besides, is there any problem running multiple features file with multiple step definitions class?

Please help. Thanks.

@peterwkc-它不会将特定的.feature文件映射到具有步骤定义的特定类-而是将特定的步骤从.feature文件映射到胶中包含的步骤定义方法的相应注释。

1.How cucumber know how to map the correct feature file to class? A: In Runner file "features=''" will direct where to go and read the features. Once it reads the scenario it will look at glue in runner file "glue=''" that directs to all the step definitions. Then looks for the relevant snippet step that match to your scenario steps.

  1. is there any problem running multiple features file with multiple step definitions class? A: All it looks for is unique snippet. It doesn't matter how many step definition classes you have for a feature file. However deriving too many step definitions for one feature file makes the framework complex, but if that suits your requirement then no problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM