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.
- Start rubymine 3.2
- Quick Start > Open Directory
- 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.
- I expand the features folder in the project tree
- I right click the feature file that I want to run
- I click the "Create run configuration from context" option
- I keep the default settings for the run configuration and click OK
- I right click on the feature file again, and I run the configuration
- 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)
- 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
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?
请先登录再写评论。
Hi, which working directory is set in your run configuration settings?
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.
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.
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.
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.