Problem
If multiple Feature Files that contain Scenarios with the same name are imported and then a Scenario with a name that exists in multiple files is executed, what will Cycle do?
Solution
When multiple Feature Files are imported that have Scenarios with the same names, the Scenario within the Feature File last imported will be executed.
Unique Scenario naming is encouraged when possible. Having Scenarios with the same name will not prevent Cycle from functioning, but repeating Scenario names will make reusing Scenarios and troubleshooting errors more complicated.
Example
In this example FeatureB is the last Feature File to be imported. The Hello World Scenario within FeatureB will be executed, and the output with be “FeatureB”.
Tip
It is best not to have Scenarios in different files with the same name. If they contain the same functionality then place them in a Utility or shared file for reuse by any Feature that requires that specific Scenario execution. If the Scenarios do not contain the same functionality then it is advised to use distinct names.
Comments
0 comments
Article is closed for comments.