EAP-1364: Steps not recognized
I have the following step definition:
Given /^ein Benutzer "([^\"]*)\/([^\"]*)"$/ do |login, password|
# code snipped
end
which in not recognized in the Cucumber features file.
Other steps in the same step definition file are working as expected
Please sign in to leave a comment.
Hi Jens-Christian,
I've filed an issue http://www.jetbrains.net/jira/browse/RUBY-4755
In RM 3.0.1 the features of my app (written in german) are recognized and listed properly, but RM doesn't seem to recognize any of the step definitions in /features/step_definitions or /features/step_definitions/subfolder. They are all listed as not yet implemented. E.g.:
You can implement step definitions for undefined steps with these snippets:
Und /^ich bin registriert und eingeloggt$/ do
pending # express the regexp above with the code you wish you had
end
Cucumber runner options are set to default: --color -r features
No problem with the recognition of my step definitions (even in subfolders of /features/step_definitions) using rake features outside of RM.
Any idea how to fix this?
Hubert
RM 3.0.1/Rails 3.0.3/Ruby 1.9.2p136
cucumber (0.10.0)
cucumber-rails (0.3.2)
gherkin (2.3.3)
P.S. It is probably not a recognition problem – in the editor only missing step definitions are marked as unimplemented (unlike in console). Cucumber log ist empty, btw. So it seems to be a runtime issue.
Hubert
It seems like I'm the only one who cannot run features from within RM ....?!
I extracted the shell command that RM uses:
/Users/hs/.rvm/rubies/ruby-1.9.2-p136/bin/ruby -e $stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /Users/hs/code/quintessenz/script/cucumber /Users/hs/code/quintessenz/features --format Teamcity::Cucumber::Formatter --expand --backtrace --verbose -r features --color
Result (within RM): step definitions are totally ignored
In the terminal (Mac OSX 10.6.6) the following command throws an error (as expected):
/Users/hs/code/quintessenz/script/cucumber /Users/hs/code/quintessenz/features --format Teamcity::Cucumber::Formatter --expand --backtrace --verbose -r features --color
Result: no such file to load -- teamcity/cucumber/formatter
In the terminal (Mac OSX 10.6.6) the following command returns the test results correctly (the parameter -format Teamcity::Cucumber::Formatter removed):
/Users/hs/code/quintessenz/script/cucumber /Users/hs/code/quintessenz/features --expand --backtrace --verbose -r features --color
Result: Using the default profile... (tests are performed)
Why isn't it possible to run the features within RM? Any help appreciated!
Hubert
It seems like the RM runner options are the main cause of the problem.
I can perform the whole set of feature tests in my app only if I DELETE the default options in RM ( --color -r features)
When I try to run a single feature file I get a weird error message:
database configuration does not specify adapter (ActiveRecord::AdapterNotSpecified)
I have to delete the default options in the corresponding configuration ( --color -r features) to perform the feature tests but in this case the step definitions are not recognized.
Hubert
RM 3.1 RC (103.87)
Hi,
Its important that you have bundler environment loaded.
You have to use bundle exec cucumber as default.
you can set this in the spec / feature you are running.
Please consider, that spork is not working (because, you cannot choose this option for spork / drb server)
But there is already an issue, which will be fixed soon.
greetings
Rafael
Attachment(s):
Bildschirmfoto 2011-02-14 um 09.58.28.png
Rafael,
thanks for the tip! The single feature files are running fine, when I check the bundle exec option.
Unfortunately, the configuration file is generated automatically with the wrong settings when it is executed for the first time. So I have to fix it in every single configuration file.
And bundle exec option is not a solution if I try to run all the features in a folder. I still have to delete the runner options.
The default settings of the configuration files don't work. My workaround is this:
1) all features files: delete runner options (bundle exec option turned on or off doesn't make any difference)
2) single feature file: turn bundle exec option on (after if fails for the first time using cmd-R)
The cucumber part should be fixed, before 3.1 goes final.
Hubert
Hi Hubert,
it is, watch the screenshot (you have to unfold / expand the defaults)
Attachment(s):
Bildschirmfoto 2011-02-14 um 10.26.57.png
Oups, I haven't noticed that I can change the default values myself – only checked in the preferences/settings for that. Stupid me.
Thanks a lot!
Hubert