2

我正在尝试git bisect使用我们的自动化测试运行一段时间来检查提交是否是导致缺陷的提交。我们程序的结构是:

app
  - cucumber_tests
    - features/
      - main_features/
    - cucumber.yml
  - src/

显然,这不是运行 Cucumber 测试的默认/标准文件夹结构,因为您希望该features文件夹位于应用程序的顶层。这不是我的选择,也无法改变

我可以运行测试cd然后cucumber_test运行。但是,为了运行git bisect它必须与.git文件夹处于同一级别。

我的问题是:有没有办法从 Cucumberfeatures文件夹的父目录运行 Cucumber 测试?能够读取cucumber.yml文件也将非常有益。

有没有办法告诉 Cucumber 你没有使用标准的文件夹结构?

编辑:我已经能够使用cucumber -r cucumber_tests/features cucumber_tests/features/main_features/first.feature. 但是,它无法在测试的中途找到一些步骤定义。

看来黄瓜正在寻找app/features文件app/cucumber_tests/features

4

1 回答 1

1

您仍然可以使用相同的文件夹结构。但是您需要更改参数才能运行您的功能。否则这将不会加载步骤定义。我希望您在 features 文件夹中有步骤定义。所以现在使用这个命令来运行这些特性:cucumber -r <absolute path of the features folder[C:\users\xyz\project\some_folder\features] absolute_path_feature_file[C:\users\xyz\project\some_folder\features\example.feature] 这样即使你有不同的文件夹结构,你的黄瓜也会加载你的步骤定义。

于 2015-06-03T14:18:00.787 回答