Search code examples
rubycucumberwatir

“invalid option” error when running cucumber with “--retry”


This is a line from my cucumber.yml file in RubyMine

default: RDEE_BROWSER=chrome --no-source --color --format pretty --format html --out testresults/reportch.html --tags @current_tests

This works fine but when I add --retry 2 thus

default: RDEE_BROWSER=chrome --no-source --color --format pretty --format html --out testresults/reportch.html --retry 2 --tags @current_tests

I now get error as follows

invalid option: --retry (OptionParser::InvalidOption)

I am using cucumber 3.1.2 and ruby 2.6.5

Any ideas folks?


Solution

  • thanks for the tip, you all helped me figure it out. The problem was in my gemfile, it was locked to an older version of cucumber (2.2.0) even though command line cucumber --version returned 3.1.2

    Now it is gem 'cucumber', '3.1.2' and after a nice bundle install retry is working

    Thanks again