I have a cucumber feature at features/object/create_object.feature. It passes when I execute all of my features with the 'cucumber' command. I'm trying to execute this feature by itself using these commands:
cucumber features/object/create_object.feature
rake features FEATURE=features/object/create_object.feature
However, all step definitions for this feature come up as undefined:
Using the default profile...
-------UUUUUUUUUUUU
I've also tried disabling the profile with "--no-profile", but to no avail. Thanks in advance!
If Cucumber is telling you that your steps are undefined, when you have defined step definitions, this means that Cucumber cannot find your step definitions. You'll need to make sure to specify the path to your step definitions (glue path) correctly.
Select project from the work space. Apply > Click on Run. Your step definitions suggestion file will be produced in the eclipse console for the test cases in your feature that do not have step definitions for a particular scenario. Copy the entire suggested step definitions steps.
I think you need to tell cucumber how to locate the step definitions when running features in subdirectories of ./features
:
rake features FEATURE=features/object/create_object.feature REQUIRE=features
Using cucumber
from the command line per your example didn't work for me -- I had to add --require
:
cucumber --require features features/object/create_object.feature
More in this blog post.
Better approach is to update your add -r features to cucumber.yml file.
See Cucumber steps not automatically loaded when running features
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With