1

I moved my feature set to the application level. In order to do that, I had to add the context.class parameter to my behat.yml file. The reason I moved them to the application level is that I would like to be able to run all of my features from one place, but have my FeatureContext class files either at application level or in each class's appropriate bundle. Is there a way to supply an array for context.class so that the feature will automatically look in multiple FeatureContext class files in multiple bundles?

4

1 回答 1

1

没有这样的参数(还)。Behat 3.0 将会改变。

目前,任何可以自动加载的类都可以与 Behat 一起使用。您只需要在 behat.yml 中配置一个主上下文类。它通常是一个 FeatureContext 类。

在您的 FeatureContext 中,您可以包含其他上下文作为subcontexts。这些子上下文可以放在任何你想要的地方。

但是,我认为坚持一种方法是好的。我的意思是,如果您希望将所有功能文件放在一个文件夹中,请对您的上下文文件执行相同的操作。

于 2013-09-04T20:22:15.750 回答