有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java Cucumberspring依赖性问题

我正在尝试使用cucumber为DAO编写集成测试。 当我尝试添加以下依赖项时

<dependency>
    <groupId>info.cukes</groupId>
    <artifactId>cucumber-spring</artifactId>
    <version>1.1.5</version>
</dependency>

我有以下错误

Error message

当我取出spring的依赖项时,功能文件正在运行并生成步骤定义,但我无法将Springbean注入到步骤定义中

任何建议。 谢谢


共 (1) 个答案

  1. # 1 楼答案

    您的依赖项看起来像这样吗(对不起,gradle不是Maven):

    compile 'info.cukes:cucumber-java8:1.2.3'
    compile 'info.cukes:cucumber-junit:1.2.3'
    compile 'info.cukes:cucumber-spring:1.2.3'
    compile 'info.cukes:cucumber-java:1.2.3'
    compile 'junit:junit:4.12'
    compile 'org.springframework:spring-beans:4.1.1.RELEASE'
    compile 'org.springframework:spring-context:4.1.1.RELEASE'
    compile 'org.springframework:spring-test:4.1.1.RELEASE'
    compile 'org.springframework:spring-jdbc:4.1.1.RELEASE'
    compile 'org.springframework:spring-web:4.1.1.RELEASE'
    compile 'org.jasypt:jasypt-spring31:1.9.2'
    compile 'com.fasterxml.jackson.core:jackson-core:2.6.3'
    compile 'com.fasterxml.jackson.core:jackson-databind:2.6.3'
    
    /* Selenium */
    compile 'org.seleniumhq.selenium:selenium-java:2.50.1'
    compile 'org.seleniumhq.selenium:selenium-chrome-driver:2.50.1'
    compile 'org.seleniumhq.selenium:selenium-support:2.50.1'
    
    
    /* MDSC */
    compile 'log4j:log4j:1.2.17'
    compile 'org.codehaus.jackson:jackson-mapper-lgpl:1.9.13'
    
    /* Apache Commons DBCP software implements Database Connection Pooling */
    compile 'org.apache.commons:commons-dbcp2:2.0'