[英]When running the cucumber tests they get skipped why?
我對 Cucumber 測試和 Spring Boot 都很陌生。 我在 pom.xml 文件中添加了 Cucumber-java 和 Cucumber-junit `
CucumberIntergration.test
@RunWith(Cucumber.class)
@CucumberOptions(features = "src/test/resources/features/", plugin =
{"pretty", "html:target/cucumber"},dryRun = true,glue =
{"com.villvay.gudppl.ws"})
這是 Version.feature 文件,用於 Api 版本驗證的功能文件。
Feature: the version can be retrieved
Scenario: client makes call to GET /version
Given the client makes the api call for verification
When the client retrieve the response
Then the client verify the response
這是我定位測試的 VersionStepDefinitions.java 文件的一小部分。
@Given("^the client makes the api call for verification")
public void wants(){
LOG.info("Client wants to verify the version");
someUrl = "http://localhost:8080/Gudppl-WS/services/api/summary";
httpPost = new HttpPost(someUrl);
}
@When("^the client retrieve the response")
public void call() throws IOException {
getResult = httpsClient.execute(httpPost);
}
@Then("^the client verify the response")
public void test() {
Assert.assertNotNull(getResult);
Assert.assertEquals(200, getResult);
}
}
但是當我運行測試時,這些測試會被跳過。
任何人都可以幫忙嗎?
轉dryRun=false
或者只是不指定它是真的。
它用於驗證黃瓜是否能夠識別您的所有步驟。 您可以添加以確保您的日志可讀的一件事是添加monochrome=true
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.