我正在使用扩展 AbstractTestNGCucumberTests 的 TestRunner 类在 Testng 中运行黄瓜功能文件。在我使用 ApprovalTests 验证从数据库获得的响应的最后一步中,我遇到了一个问题。我看到一个异常
"com.spun.util.FormattedException: Didn't find cucumber.api.testng.AbstractTestNGCucumberTests under C:\Users\nsyed\Awris2\LearnDatabase"
有谁知道为什么会出现这个异常?我的跑步者课程是:
@CucumberOptions(features = {"src/test/java/Features/ValidateStagingDB.feature"}
,glue={"StepDefinition"}
,dryRun=false
,strict=true
,public class TestRunner extends AbstractTestNGCucumberTests{}`
例外情况在 Approvals.VerifyAsJso
@Then("^响应应该匹配黄金副本$") public void the_response_should_match_the_golden_copy() throws Throwable {
try {
Approvals.verifyAsJson(DbHelper2.getJsonRepresentationFor(TableData));
}
catch(Exception e) {
System.err.println(e);
}
finally {
System.out.println("Closing the database connection");
connection.close();
}