- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在尝试运行一个 .feature 文件来测试一个简单的 RESTEasy 网络应用程序:https://github.com/dashorst/jaxrs-quickstart-resteasy .
但是,IntelliJ 一直在说:
Undefined step: Given I am an invalid username
Undefined step: When I perform a hello request with null username
Undefined step: Then I receive a http response code of 400
Undefined step: When I perform a hello request with empty username
Undefined step: Then I receive a http response code of 400
You can implement missing steps with the snippets below:
@Given("^I am an invalid username$")
public void I_am_an_invalid_username() throws Throwable {
// Express the Regexp above with the code you wish you had
throw new PendingException();
}
// similar results...
下面是我的hello.feature
文件:
Feature: hello
#-------------------------------------
#next block is got the GET entry point
#-------------------------------------
#verify that with malformed input hello fails
Scenario: invalid username should fail
Given I am an invalid username
When I perform a hello request with null username
Then I receive a http response code of 400
When I perform a hello request with empty username
Then I receive a http response code of 400
#verify that you can get correct hello response with valid username. This is the 'everything works fine' path.
Scenario: User can get correct hello response with valid username
Given I am a valid username
When I perform a hello request with valid username
Then I receive a http response code of 200
import cucumber.annotation.en.Given;
import cucumber.annotation.en.Then;
import cucumber.annotation.en.When;
import cucumber.runtime.PendingException;
我使用了 IntelliJ 选项“生成步骤”并获得了 MyStepdefs
文件。
/**
* Created by z on 5/21/17.
*/
public class MyStepdefs {
@Given("^I am a valid username$")
public void iAmAValidUsername() throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
@Given("^I am an invalid username$")
public void iAmAnInvalidUsername() throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
@When("^I perform a hello request with null username$")
public void iPerformAHelloRequestWithNullUsername() throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
@Then("^I receive a http response code of (\\d+)$")
public void iReceiveAHttpResponseCodeOf(int arg0) throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
@When("^I perform a hello request with empty username$")
public void iPerformAHelloRequestWithEmptyUsername() throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
@When("^I perform a hello request with valid username$")
public void iPerformAHelloRequestWithValidUsername() throws Throwable {
// Write code here that turns the phrase above into concrete actions
throw new PendingException();
}
}
我曾尝试为每个场景指定粘合路径,但它不起作用。我不确定发生了什么。感谢您的任何建议!
我研究了几个现有的问题,但没有一个有帮助:
最佳答案
Sometimes it happens when there are saved references to the old names of the packages. If the packages have been renamed you should check if there are references to the old names (Cucumber Run/Debug Configurations) and delete them.
亲切的问候
关于java - Cucumber 未定义的步骤,虽然使用 IntelliJ 定义,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44102161/
我一直在尝试运行 junit 测试,但不断面临这个问题。我试图在互联网上寻找答案,但没有任何帮助。 ] 1 最佳答案 我遇到了同样的问题,但已通过更新 Intellij 最新版本 2020.3 解决。
我知道这个问题以前曾以各种形式提出过,但我已经检查了所有答案,我认为我们已经排除了所有答案。 错误: java.lang.NoClassDefFoundError: com/lgc/infra/geo
TL; 博士 我如何导入 com.intellij.psi.JavaPsiFacade我的 IntelliJ 插件中的类? 背景资料 我正在尝试开发一个 IntelliJ 插件。我一直在遵循入门指南
我目前正在为 IntelliJ 开发一个插件,并尝试使用另一个内置的 IntelliJ 插件作为依赖项 (git4idea)。如 IntelliJ 插件开发文档中所述,我将所需的 JAR 添加到项目结
我尝试在 MacOS 上安装与 IntelliJ 10 集成的 JProfiler。安装程序试图找到我没有的“IntelliJ 配置文件夹”,我也不知道如何创建。 任何帮助或提示都会很棒。 最佳答案
我记得有一个选项可以在失去对idea windows 的关注时自动构建当前项目(例如,您从intellij 切换到浏览器以测试您的webapp),但是我找不到(idea 12.1.6)。 你知道我在哪
我有两个 Java 项目作为 Bukkit/Spigot 插件。两个项目都使用 gradle、私有(private)存储库,一个项目应该从另一个项目继承。 项目: SpigotCore - 包含数据库
标题说明了一切……只是想让 Glassfish 继续前进。这是我得到的错误 Detected server admin port: 4848 [2015-04-06 07:37:56,138] Art
关闭。这个问题需要details or clarity .它目前不接受答案。 想改进这个问题吗? 通过 editing this post 添加细节并澄清问题. 关闭 7 年前。 Improve t
每次我重新启动系统或安装新插件时,我的 intellij 键盘映射都会重置。如果重要的话,我正在开发容量非常有限的 win XP - 只有 1 个 25 GB 容量的驱动器。但是,仍有 7 GB 的可
这是一段简单代码的输出: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home/bin/java "- javaagent:/Applic
Intellij Idea的状态栏中是否显示选中的行数? (如果选择包括单词,则显示“字符数”选择计数) 最佳答案 评论中提到的功能现已可用。 右击状态栏,选择“行列数”,见图: 然后您在状态栏中看到
我想将大量代码重构到新类中。我需要一个工具来让我将部分旧代码标记为“已完成”,这样我就可以看到还剩下什么要做。 我把它想象成背景或边缘的一些颜色。如果我可以使用不同的颜色或向代码块添加注释,那将是最好
如何查找和排序 TODO项目按字母顺序排列,就像在 Eclipse 中一样? 我不能使用文件搜索功能,因为我只需要查找注释而不是字符串和文字。对于当前混合的源文件/模板/脚本,TODO 至少已经以下列
我正在使用 IntelliJ Idea 开发一个 Spring 项目。我想知道是否有办法从 IntelliJ 日志或其他一些黑暗的方式知道我在这个项目上花了多少时间? 我是在看到 Idea 的 Pro
当您有 todo:在您的评论中,intellij 可以检测到它并将其显示在待办事项列表中。我怎样才能让一些自定义标记被识别?例如,config: . 最佳答案 在“设置”中查看“编辑器”/“待办事项”
我已启用所有 soft wrap可以在 Intellij (2017.3) 中找到的设置: Appearance|General同意该 list : 我点击了“应用”——这通常实际上可以立即查看效果—
我需要调查微服务中的内存泄漏。我看到一些 Profile... Intellij 中的菜单项 单击它后,应用程序将运行。你能告诉我在哪里可以看到分析的结果吗? 最佳答案 此操作用于分析 Android
我将 IntellIJ 安装更新到最新版本 (11.1.4),现在没有出现编辑器窗口。双击文件,跳转到源代码,没有任何 react 。没有错误消息,只是没有出现。如果我双击一个 xml 布局文件,预览
有没有办法在项目中自动构建工件,就像它如何自动构建输出一样?如果存在快捷键也可以使用 -- 现在我需要单击 Build -> Build Artifacts -> Build这很麻烦。 编辑:在这种情
我是一名优秀的程序员,十分优秀!