我已经创建了 Cucumber 测试项目并通过 cucumber-guice 成功配置了 Guice 支持。当我添加 serenity-cucmber 并使用 CucumberWithSerenity 配置测试运行器时,出现错误:
More than one Cucumber ObjectFactory was found in the classpath
You probably may have included, for instance, cucumber-spring AND cucumber-guice as part of
your dependencies. When this happens, Cucumber falls back to instantiating the
DefaultJavaObjectFactory implementation which doesn't provide IoC.
In order to enjoy IoC features, please remove the unnecessary dependencies from your class path.
原因是有两个 ObjectFactory 实现:
cucumber.runtime.java.guice.impl.GuiceFactory(在 cucumber-guice 中)
cucumber.runtime.SerenityObjectFactory(在 serenity-cucumber 中)
是否可以将宁静黄瓜与黄瓜酱一起使用?