gpt4 book ai didi

java - IntelliJ 和 cucumber 不工作

转载 作者:行者123 更新时间:2023-12-02 02:04:31 25 4
gpt4 key购买 nike

我正在使用 IntelliJ Idea Ultimate 2018.1,在我的 java 项目中,我使用 Cucumber 和 Gherkin 实现了一些 BDD。当我尝试右键单击功能文件并运行它时,我看到以下错误

Exception in thread "main" java.lang.NoClassDefFoundError: gherkin/formatter/Formatter
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
at cucumber.runtime.formatter.PluginFactory.loadClass(PluginFactory.java:174)
at cucumber.runtime.formatter.PluginFactory.pluginClass(PluginFactory.java:166)
at cucumber.runtime.formatter.PluginFactory.getPluginClass(PluginFactory.java:223)
at cucumber.runtime.formatter.PluginFactory.isStepDefinitionReporterName(PluginFactory.java:206)
at cucumber.runtime.RuntimeOptions$ParsedPluginData.addPluginName(RuntimeOptions.java:456)
at cucumber.runtime.RuntimeOptions.parse(RuntimeOptions.java:160)
at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:112)
at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:105)
at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:97)
at cucumber.api.cli.Main.run(Main.java:30)
at cucumber.api.cli.Main.main(Main.java:18)
Caused by: java.lang.ClassNotFoundException: gherkin.formatter.Formatter
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

这种情况已经发生了好几天了。过去工作得很好。安装了 cucumber for java 和 gherkin 插件。我尝试下载新版本的 IntelliJ,但没有成功。

我的项目中的依赖项如下

    <dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-java</artifactId>
<version>${cucumber.version}</version>
</dependency>

<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-junit</artifactId>
<version>${cucumber.version}</version>
</dependency>

<dependency>
<groupId>io.cucumber</groupId>
<artifactId>cucumber-spring</artifactId>
<version>${cucumber.version}</version>
</dependency>

我的功能文件类似于以下内容

功能:拦截器累积

Scenario: Blocker Accumulation
Given I am logged as a user
And I have an In-progress activity
And it has been previously blocked for 16 days
And now is not blocked
When I block the activity for other more 6 days
Then the total blocking days is 22

我可以尝试什么?我有什么错?谢谢

最佳答案

您需要更新 Cucumber for Java 插件。 (这可能包括卸载/安装以使其正常工作)。

关于java - IntelliJ 和 cucumber 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51014612/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com