I’m currently writing up some cucumber specs, and I’m trying to keep features organised by module. So, for example, my admin/posts controller is stored in features/admin/posts
The difficulty is whenever I run the feature from that directory it doesn’t recognise any of the steps in features/step_definitions.
In short, how do I include all base step_definitions in my feature subdirectories?
If you’re actually in that folder, then you would need to tell cucumber to
requirethe step definitions on the command line e.g.It’s a bit messy as you would also have to include the location of any support files, if you use them:
A slightly easier way would be to always run cucumber from your root directory, and specify which features you want to be run, and just
requirethe whole features folder:Would run all the features in the admin/posts directory, and also pull in the necessary step definitions and support files.