Cucumber project setup

I'm a new user to cucumber in rubymine, and I'm unable to run an existing cucumber project folder (not originally created in rubymine).  Here are the steps that I followed.

  1. Start rubymine 3.2
  2. Quick Start > Open Directory
  3. Navigate to the existing project folder for a cucumber suite (the base folder, not the features folder).  The folder opens correctly and loads the feature folder and all my feature files and the step_definitions folder with the ruby step definition files.
  4. I expand the features folder in the project tree
  5. I right click the feature file that I want to run
  6. I click the "Create run configuration from context" option
  7. I keep the default settings for the run configuration and click OK
  8. I right click on the feature file again, and I run the configuration
  9. The test "instantiates" in the status window" and then immediately shows failure for all the features and steps (big red circle with X in the middle)
  10. The log indicates the following:


C:\Ruby192\bin\ruby.exe -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) C:\Ruby192\bin/cucumber "C:/Test Project/features/create report.feature" --format Teamcity::Cucumber::Formatter --expand --color -r features

Testing started at 4:07 PM ...



You can implement step definitions for undefined steps with these snippets:


Given /^I navigate to the report portal$/ do
  pending # express the regexp above with the code you wish you had
end


The step definitions for the gherkin step is already defined in a ruby step definition file in the step_definitions directory and is easily run through the command line without hassle.  

What other configuration do I need to make to have rubymine recognize the step definition files I have already created and know works outside of the IDE?
4 comments
Comment actions Permalink

Hi, which working directory is set in your run configuration settings?

0
Comment actions Permalink

Ah, that's what was set incorrectly.  It was set to the project's feature directory.  When I set it to the project folder root directory, the run configuration worked as expected.   Thank you, for the response.

0
Comment actions Permalink

A quick follow-up, it seems that the default run configuration "working directory" gets reverted back to the "features" folder.  How do I make it stick?  The save configuration, the close and the ok buttons don't seem to do the trick anymore.

I got this to stick once, now it keeps reverting back to the features folder.

0
Comment actions Permalink

Please check defaults in Main Menu | Run| Edit Confiugrations | Defaults | Cucumber. If work dir isn't set in defaults RubyMine uses project root folder as working directory.

A quick follow-up, it seems that the default run configuration "working directory" gets reverted back to the "features" folder.  How do I make it stick?  The save configuration, the close and the ok buttons don't seem to do the trick anymore.

I got this to stick once, now it keeps reverting back to the features folder.

If you launch file/folder from context menu RubyMine creates temporary run confugration which isn't persisted and can be deleted/rewritten. See our documentation related to run configurations.

0

Please sign in to leave a comment.