为什么黄瓜功能文件步骤实现无法识别,即使它们已链接(可通过 cmd+ 单击操作导航到方法)

发布于 2025-01-17 22:16:33 字数 1126 浏览 0 评论 0原文

我有我的场景 [![我的方案AS] [1]] [1]

我能够CMD+单击并导航到步骤实现方法。但是,当我运行方案时,我会收到此消息。

Step undefined
You can implement this step and 2 other step(s) using the snippet(s) below:

@Given("User enable app risk lookup in zconsole")
public void user_enable_app_risk_lookup_in_zconsole() {
    // Write code here that turns the phrase above into concrete actions
    throw new io.cucumber.java.PendingException();
}
@When("User install and activate a new zips app on a device")
public void user_install_and_activate_a_new_zips_app_on_a_device() {
    // Write code here that turns the phrase above into concrete actions
    throw new io.cucumber.java.PendingException();
}
@Then("User validate app risk lookup is enabled on the device")
public void user_validate_app_risk_lookup_is_enabled_on_the_device() {
    // Write code here that turns the phrase above into concrete actions
    throw new io.cucumber.java.PendingException();
}

我在Intellij Idea 2021.3.3(社区版)中做错了什么或缺少什么? [1]: https://i.sstatic.net/ak0so.png

I have my Scenario as
[![my Scenario as][1]][1]

I am able to cmd+click and navigate to the step implementation methods. But I am getting this message when I run the scenario.

Step undefined
You can implement this step and 2 other step(s) using the snippet(s) below:

@Given("User enable app risk lookup in zconsole")
public void user_enable_app_risk_lookup_in_zconsole() {
    // Write code here that turns the phrase above into concrete actions
    throw new io.cucumber.java.PendingException();
}
@When("User install and activate a new zips app on a device")
public void user_install_and_activate_a_new_zips_app_on_a_device() {
    // Write code here that turns the phrase above into concrete actions
    throw new io.cucumber.java.PendingException();
}
@Then("User validate app risk lookup is enabled on the device")
public void user_validate_app_risk_lookup_is_enabled_on_the_device() {
    // Write code here that turns the phrase above into concrete actions
    throw new io.cucumber.java.PendingException();
}

What I am doing wrong or missing in my IntelliJ IDEA 2021.3.3 (Community Edition) ?
[1]: https://i.sstatic.net/ak0So.png

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

失去的东西太少 2025-01-24 22:16:33

您应该在cucumberoptions中检查胶水

在这里,真理的来源是黄瓜测试跑者而不是IDE。

“即使它们已链接(可以通过CMD+单击操作导航到方法)”

Intellijs Gherkin插件扫描了所有测试源代码的步骤定义。即使您在工作区中的子模块中有一个步骤定义,您的步骤定义也可以单击。

希望,它有帮助

You should check glue in your CucumberOptions.

The source of truth, here, is cucumber test runner not IDE.

"even though they are linked(navigable to the methods by cmd+ click action)"

IntelliJs Gherkin plugin scans all test source code for step definitions. Your step definition will be clickable even you have a step definition in a submodule in your workspace.

Hope, it helps

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文