Reputation: 101
For full transparency, I started learning about Cucumber an hour ago. I've been following a concise tutorial on using Selenium in Ruby with Cucumber and I've had no issues until this point.
In essence, I'm trying to run a test scenario(?) but I am receiving this error:
C:\Ruby27-x64\bin\ruby.exe -EUTF-8 C:\Ruby27-x64\bin\cucumber C:/Users/kanwo/RubymineProjects/untitled/features/1.feature --format Teamcity::Cucumber::Formatter --expand --color -r features
Testing started at 7:09 am ...
wrong number of arguments (given 1, expected 2)
Error creating formatter: Teamcity::Cucumber::Formatter (ArgumentError)
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/lib/cucumber/formatter/io.rb:12:in `ensure_io'
C:/Program Files/JetBrains/RubyMine 2020.3.2/plugins/ruby/rb/testing/patch/bdd/teamcity/cucumber/cucumber_4_formatter.rb:20:in `initialize'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/lib/cucumber/formatter/io.rb:30:in `new'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/lib/cucumber/formatter/io.rb:30:in `new'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/lib/cucumber/runtime.rb:206:in `create_formatter'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/lib/cucumber/runtime.rb:195:in `block in formatters'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/lib/cucumber/configuration.rb:209:in `block in formatter_factories'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/lib/cucumber/configuration.rb:207:in `map'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/lib/cucumber/configuration.rb:207:in `formatter_factories'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/lib/cucumber/runtime.rb:194:in `formatters'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/lib/cucumber/runtime.rb:174:in `report'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/lib/cucumber/runtime.rb:76:in `run!'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/lib/cucumber/cli/main.rb:29:in `execute!'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/cucumber-5.3.0/bin/cucumber:9:in `<top (required)>'
C:/Ruby27-x64/bin/cucumber:23:in `load'
C:/Ruby27-x64/bin/cucumber:23:in `<main>'
Errors are usually pretty straight-forward but I don't feel I know enough about frameworks(? again, bare with me as I've just jumped into this) so I did some research and found that this has been an issue for a while, as per these instances:
This first link is ugly, you've been warned
Granted, these aren't all exactly the same error(s) as mine, but they seem to share a theme; versions.
So from my understanding, this is a conflict between versions of Cucumber, RubyMine, and TeamCity. With that said, am I essentially out of luck here? Can I perform this in something like VSCode instead? I don't like to just dump questions into forums if I don't have to but I can't even begin to know where to start to figure this out.
Also, if it helps, this is what I was running:
Feature: Feature Name
Scenario: Logging in
Given I am on the login page
When I enter my password correctly
Then I will be logged in and provided a confirmation
and these are my local gems:
activesupport (6.1.3)
ast (2.4.2)
benchmark (default: 0.1.0)
bigdecimal (default: 2.0.0)
builder (3.2.4)
bundler (default: 2.1.4)
cgi (default: 0.1.0)
childprocess (3.0.0)
concurrent-ruby (1.1.8)
csv (default: 3.1.2)
cucumber (5.3.0)
cucumber-core (8.0.1)
cucumber-create-meta (2.0.4)
cucumber-cucumber-expressions (10.3.0)
cucumber-gherkin (15.0.2)
cucumber-html-formatter (9.0.0)
cucumber-messages (13.2.1)
cucumber-tag-expressions (2.0.4)
cucumber-wire (4.0.1)
date (default: 3.0.0)
dbm (default: 1.1.0)
delegate (default: 0.1.0)
did_you_mean (default: 1.4.0)
diff-lcs (1.4.4)
etc (default: 1.1.0)
fcntl (default: 1.0.0)
ffi (1.15.0 x64-mingw32)
fiddle (default: 1.0.0)
fileutils (default: 1.4.1)
forwardable (default: 1.3.1)
gdbm (default: 2.1.0)
getoptlong (default: 0.1.0)
i18n (1.8.9)
io-console (default: 0.5.6)
ipaddr (default: 1.2.2)
irb (default: 1.2.6)
jar_wrapper (0.1.8)
json (default: 2.3.0)
logger (default: 1.4.2)
matrix (default: 0.2.0)
middleware (0.1.0)
minitest (5.13.0)
multi_test (0.1.2)
mutex_m (default: 0.1.0)
net-pop (default: 0.1.0)
net-smtp (default: 0.1.0)
net-telnet (0.2.0)
observer (default: 0.1.0)
open3 (default: 0.1.0)
openssl (default: 2.1.2)
ostruct (default: 0.2.0)
parallel (1.20.1)
parser (3.0.0.0)
power_assert (1.1.7)
prime (default: 0.1.1)
protobuf-cucumber (3.10.8)
pstore (default: 0.1.0)
psych (default: 3.1.0)
racc (default: 1.4.16)
rainbow (3.0.0)
rake (13.0.1)
rdoc (default: 6.2.1)
readline (default: 0.0.2)
regexp_parser (2.1.1)
reline (default: 0.1.5)
rexml (default: 3.2.3)
rss (default: 0.2.8)
rubocop (1.11.0)
rubocop-ast (1.4.1)
ruby-progressbar (1.11.0)
rubyzip (2.3.0)
sdbm (default: 1.0.0)
selenium (0.2.11)
selenium-webdriver (3.142.7)
singleton (default: 0.1.0)
stringio (default: 0.1.0)
strscan (default: 1.0.3)
sys-uname (1.2.2)
test-unit (3.3.4)
thor (1.1.0)
thread_safe (0.3.6)
timeout (default: 0.1.0)
tracer (default: 0.1.0)
tzinfo (2.0.4)
unicode-display_width (2.0.0)
uri (default: 0.10.0)
webrick (default: 1.6.0)
xmlrpc (0.3.0)
yaml (default: 0.1.0)
zeitwerk (2.4.2)
zip (2.0.2)
zlib (default: 1.1.0)
Any insight is appreciated!
Upvotes: 0
Views: 819
Reputation: 21
I faced same issue but solved by updating Run settings in RubyMine as per below steps:
Run->Edit Configurations->Templates->Cucumber->Configuration-> Runner Options as "--color -r features -f pretty"
Upvotes: 1
Reputation: 458
This is a RubyMine bug. Nothing we can fix on the Cucumber end.
You can either consult a non-recommended monkeypatch / hack. Or downgrade to an early version of Cucumber5.
See https://youtrack.jetbrains.com/issue/RUBY-27294 for more information, including other possible workarounds and a time-frame for the fix from Jetbrains.
Luke - Cucumber Ruby committer.
Upvotes: 1