【问题标题】:“invalid option” error when running cucumber with “--retry”使用“--retry”运行黄瓜时出现“无效选项”错误
【发布时间】:2020-09-07 19:40:27
【问题描述】:

这是我在 RubyMine 中 cucumber.yml 文件中的一行

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

这很好,但是当我添加 --retry 2 时

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

我现在得到如下错误

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

我正在使用 cucumber 3.1.2 和 ruby​​ 2.6.5

各位有什么想法吗?

【问题讨论】:

  • 请解释您收到给定错误消息的上下文。你做了什么会触发这个错误?你在运行命令吗?你在 RubyMine 做点什么吗?
  • 如果直接从命令行运行cucumber会出现这个错误吗?
  • 嗨@diabolist,有趣的是,这适用于命令行 - cucumber --no-source --color --format pretty --format html --out testresults/reportch.html --retry 2 - -标签。
  • 您可能需要将完整的 cucumber.yml 粘贴到问题中。 cucumber.yml 也与 RubyMine 无关,它是 Cucumber 的一部分。我们在这里试图找出的是你是如何调用 Cucumber 的。我怀疑您是通过 RubyMine 执行此操作的。如果是这样,问题可能是(a)坏 cucumber.yml,(b)坏 RubyMine
  • 在 v3.0.0 中添加了 --retry 选项。您是否有可能使用旧版本的 Cucumber?例如,检查您安装的 Cucumber 版本和 Gemfile(如果有的话)。

标签: ruby cucumber watir


【解决方案1】:

感谢您的提示,你们都帮我弄清楚了。 问题出在我的 gemfile 中,即使命令行 cucumber --version 返回 3.1.2,它也被锁定为旧版本的 cucumber (2.2.0)

现在它是 gem 'cucumber', '3.1.2' 并且在一个不错的包安装重试之后工作

再次感谢

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多