我正在尝试将宁静弹簧集成到我的自动化项目中(java + Serenity + cucumber),但是测试,但是测试无法执行
我添加了这种依赖性
<dependency>
<groupId>net.serenity-bdd</groupId>
<artifactId>serenity-spring</artifactId>
<version>${serenity.version}</version>
</dependency>
我使用serenityRunner修改了cumul-serenity-runner.vm ti运行测试
#parse("/array.java.vm")
#if ($packageName)
package $packageName;
#end##
import org.apache.logging.log4j.ThreadContext;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import net.serenitybdd.junit.runners.SerenityRunner;
import cucumber.api.CucumberOptions;
import net.serenitybdd.junit.spring.integration.SerenityRunner;
@RunWith(SerenityRunner.class)
@CucumberOptions(
features = {"$featureFile"},
glue = #stringArray($glue))
public class $className {
@BeforeClass
public static void startUp() {
String featureFilePath = "$featureFile";
ThreadContext.put("threadId", featureFilePath.substring(featureFilePath.lastIndexOf("/")+1));
}
@AfterClass
public static void tearDown() {
ThreadContext.remove("threadId");
}
}
我有这个错误
[INFO] Running Parallel30IT
[ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0 s <<< FAILURE! - in Parallel30IT
[ERROR] initializationError(Parallel30IT) Time elapsed: 0 s <<< ERROR!
java.lang.Exception: No runnable methods