behat 中的配置问题

Configuration issue in behat

我使用 behat v3.0.15,我想将我的功能放在 ./app/features 存储库中。

正如我在文档中看到的那样 http://docs.behat.org/en/v3.0/guides/6.profiles.html#custom-autoloading 我所要做的就是在我的 behat.yml 文件中添加这些行

 # behat.yml

 default:
     autoload:
         '': %paths.base%/app/features/bootstrap

遗憾的是它不起作用

当我尝试使用此命令初始化 behat 时 ./bin/behat --config ./app/config/behat.yml --init,程序会在 config 文件夹下创建一个 features 文件夹。

那我该怎么办?

您已配置自动加载器。功能的位置在 paths section 中配置。

default:
    autoload: %paths.base%/app/features/bootstrap
    suites:
        default:
            paths:
                - %paths.base%/app/features

paths and autoloader is documented on different pages, so it's confusing. Behat 2.5 documentation 的配置好一点(但 yaml 结构不同)。

示例取自feature test for custom paths

这是定义自定义 php featureContext 文件的方式:

自动加载: '': %paths.base%/features/bootstrap 套房: 默认: 上下文: -