【问题标题】:Undefined Step Definitions when Running Cucumber scripts in command line在命令行中运行 Cucumber 脚本时未定义的步骤定义
【发布时间】:2018-05-18 15:08:05
【问题描述】:

我以前使用 RubyMine 运行黄瓜测试脚本,它工作得很好,但我正在寻找从命令行运行这些脚本的替代方法。

当我尝试从 cmd 运行特定的 .feature 文件时,我收到一条错误消息,指出我的 Ruby 步骤定义未定义。我假设这是因为它们与我尝试运行的 .feature 文件不在同一目录中。

这是我的 cmd 输出: Undefined Steps error output

欢迎提出任何建议!谢谢

【问题讨论】:

  • 请不要发布截图。使用适当的格式将错误代码剪切/粘贴到问题中。
  • 请分享您的跑步者课程

标签: ruby command-line cucumber


【解决方案1】:

如果您从your_directory 运行cucumber。那么你的.feature 文件应该在your_directory/features 中,并且在your_directory/features/step_definitions 子文件夹中的步骤定义(.rb 文件)是受支持的。

看https://docs.cucumber.io/guides/10-minute-tutorial/

如果您运行的是 Win10,请查看WSL - 让您的生活更美好;-)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-08-19
    • 1970-01-01
    • 1970-01-01
    • 2021-12-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多