Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Intellij、cucumber测试和双spring上下文配置_Spring_Intellij Idea_Cucumber - Fatal编程技术网

Intellij、cucumber测试和双spring上下文配置

Intellij、cucumber测试和双spring上下文配置,spring,intellij-idea,cucumber,Spring,Intellij Idea,Cucumber,我的项目有两个不同的cucumber测试,每个测试都需要不同的spring上下文配置 我遇到的问题是,当我从Intellij单独运行每个测试时,它们加载正确的Spring上下文,测试通过,但我按run all test,没有一个通过 运行maven测试时,两个测试都通过了 这是我的代码: @RunWith(fcscumber.class) @cumber.Options(strict=true) //,标记={“~@ignore”} //,标记={@Only} ,glue=“feature.s

我的项目有两个不同的cucumber测试,每个测试都需要不同的spring上下文配置

我遇到的问题是,当我从Intellij单独运行每个测试时,它们加载正确的Spring上下文,测试通过,但我按run all test,没有一个通过

运行maven测试时,两个测试都通过了

这是我的代码:

@RunWith(fcscumber.class)
@cumber.Options(strict=true)
//,标记={“~@ignore”}
//,标记={@Only}
,glue=“feature.scenario1”
,features=“src/test/resources/feature/scenario1/”
)
@FCSApplicationProperties(commonProps=“config/scenario1/exec.common.properties”,
environmentProps=“src/test/resources/scenario1 test.properties”)
公共类Tescenario1特性{
}
问题在于,正在使用运行测试,而根本不使用JUnit runner。这会造成一些限制,比如要求在步骤定义类上使用spring注释,而不是运行程序,或者默认情况下要求步骤定义与场景文件位于同一个包中

在您的示例中,我实际上希望运行单个测试也会失败,除非
/cumber scenario{1,2}.xml
文件也引用了正确的应用程序属性

我看到的标准cucumber实现的唯一选择是将测试提取到单独的项目中

实际上,我正在开发一个具有改进的spring集成的。但它还没有与IntelliJ完全集成