我安装了我的黄瓜月食插件。我用空手道编写了简单的功能文件,当我尝试将其作为黄瓜测试运行时,被要求实施缺少的步骤。当我使用专用运行程序运行相同的功能文件时,它执行时没有任何问题。要求您对此提供帮助。我正在尝试不使用专用跑步机来进行此测试
Scenario: Validate that the sample webservice is up and running
Given url sampleUrl
When method get
Then status 200
Scenario: Validate a Json key value pair from the received response
Given url sampleUrl
When method get
Then status 200
And match $.RestResponse.result contains {name: 'United States of America', alpha2_code: 'US', alpha3_code: 'USA' }
*** Console output
Feature: Test a sample RESTFUL webservice
15:05:10.725 INFO - Starting scenario: Validate that the sample webservice is up and running
15:05:10.725 INFO - Ending scenario: Validate that the sample webservice is up and running
15:05:10.741 INFO - Starting scenario: Validate a Json key value pair from the received response
#Test Scenarios
Scenario: Validate that the sample webservice is up and running # C:/Users/sxs8680/git/BDDCucumberJVM/src/test/java/com/thd/common/karatesupport/karatesample.feature:6
Given url sampleUrl
When method get
Then status 200
15:05:10.741 INFO - Ending scenario: Validate a Json key value pair from the received response
Scenario: Validate a Json key value pair from the received response # C:/Users/sxs8680/git/BDDCucumberJVM/src/test/java/com/thd/common/karatesupport/karatesample.feature:11
Given url sampleUrl
When method get
Then status 200
And match $.RestResponse.result contains {name: 'United States of America', alpha2_code: 'US', alpha3_code: 'USA' }
2 Scenarios (2 undefined)
7 Steps (7 undefined)
0m0.006s
You can implement missing steps with the snippets below:
Given("^url sampleUrl$", () -> {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
});
When("^method get$", () -> {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
});
Then("^status (\\d+)$", (Integer arg1) -> {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
});
Then("^match \\$\\.RestResponse\\.result contains {name: 'United States of America', alpha(\\d+)_code: 'US', alpha(\\d+)_code: 'USA' }$", (Integer arg1, Integer arg2) -> {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
});
您可能使用了错误的Cucumber Eclipse插件,或者需要进行一些小的配置。
请参考文档的此部分:Cucumber IDE支持故障排除
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句