无法在Eclipse中运行以空手道编写的特征文件作为黄瓜特征

萨拉瓦南17

我安装了我的黄瓜月食插件。我用空手道编写了简单的功能文件,当我尝试将其作为黄瓜测试运行时,被要求实施缺少的步骤。当我使用专用运行程序运行相同的功能文件时,它执行时没有任何问题。要求您对此提供帮助。我正在尝试不使用专用跑步机来进行此测试

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] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

空手道中特征文件的异步执行

如何在加特林模拟中运行多个空手道特征文件?

如何在空手道框架中多次运行特征文件?

空手道特征文件中的无法打印标题

有没有一种方法可以从黄瓜特征文件方案中调用空手道特征文件方案?

如何用空手道特征文件中的.js文件的参数调用Javascript函数

空手道中的特征文件中如何循环播放

空手道特征文件中的String.split()返回异常

如何在空手道框架的特征文件中读取响应头值?

在空手道中循环具有不同参数的相同特征文件

如何在空手道特征文件变量中存储Java方法结果?

如何在空手道特征文件中传递身体类型?

空手道是否使用解释器或编译器来运行基于特征文件的代码?

加特林(Gatling)模拟完成后如何运行空手道特征文件

如何将参数传递给Selenium Java测试文件中的空手道特征文件

如何在空手道中的特征文件中设置和检索全局变量的值?

如何将特征文件关键字连接到空手道中的 Java 代码?

如果使用空手道在特征文件中满足条件,如何跳过下一步

我如何匹配来自空手道特征文件中的外部方法的布尔值

空手道API-为什么响应未返回被调用的特征文件

从具有多个场景的特征文件返回变量-空手道

如何在空手道框架的特征文件中正确传递表单域范围?

如何从空手道特征文件中集成Cassandra以删除测试数据

空手道:处理来自调用特征文件的肥皂响应

空手道-在当前特征文件中生成随机字母数字字符串

黄瓜特征文件按顺序运行

空手道/黄瓜新手:空手道配置中的baseUrl无法识别

调用空手道特征文件返回响应对象,包括父场景先前响应对象的多个副本

空手道-无法使用空手道0.9.5生成黄瓜报告