2

I am trying to run a git bisect while using our automated tests to check the commit if it is the one causing the defect. The structure of our program is:

app
  - cucumber_tests
    - features/
      - main_features/
    - cucumber.yml
  - src/

Obviously this is not the default/standard folder structure for running Cucumber tests as you would want the features folder to be at top-level of your app. This was not my choice and cannot be changed.

I can run the tests by cd into cucumber_test and then run. However, in order to run git bisect it must be done at same level as the .git folder.

My question is: is there a way to run the Cucumber tests from a parent directory of the features folder in Cucumber? Being able to read the cucumber.yml file would also be very beneficial.

Is there a way to tell Cucumber that you are not using the standard folder structure?

Edit: I have been able to get the tests started by using cucumber -r cucumber_tests/features cucumber_tests/features/main_features/first.feature. However, it is unable to find some of the step definitions part-way through the test.

It appears that cucumber is looking for files in app/features not app/cucumber_tests/features

adam-beck
  • 5,659
  • 5
  • 20
  • 34
  • I thought you might just be able to do `cucumber -r cucumber_tests/features cucumber_tests/features`, but in my brief experiment that didn't work. – Dave Schweisguth Aug 07 '14 at 17:39
  • @DaveSchweisguth I am still trying different combinations with the `cucumber -r` command. I was able to get the tests started but it was unable to find some of the step definitions. – adam-beck Aug 07 '14 at 17:41
  • Glad you got farther than me. Might help to add your progress to your question. – Dave Schweisguth Aug 07 '14 at 17:42

1 Answers1

1

You can still use the same folder structure. But you need to change the parameters in order to run your features. Otherwise this will not load step definitions. I hope you have step definitions inside the features folder. So now use this command to run the features: cucumber -r <absolute path of the features folder[C:\users\xyz\project\some_folder\features] absolute_path_feature_file[C:\users\xyz\project\some_folder\features\example.feature] This way you cucumber will load your step definitions even if you have a different folder structure.

Sunilkumar V
  • 912
  • 2
  • 8
  • 28