【问题标题】:IntelliJ cucumber-jvm plugin doesn't run testsIntelliJ cucumber-jvm 插件不运行测试
【发布时间】:2013-11-20 08:30:05
【问题描述】:

运行 .feature 文件给我以下错误:

  " >....< cucumber.cli.Main --format org.jetbrains.plugins.cucumber.java.run.CucumberJvmSMFormatter --monochrome --glue C:/projects/selenium-parent/selenium/src/test/resources/InformationPage.feature
Testing started at 09:20 ...


    Exception in thread "main" java.lang.reflect.UndeclaredThrowableException
        at com.sun.proxy.$Proxy13.feature(Unknown Source)
        at cucumber.runtime.model.CucumberFeature.run(CucumberFeature.java:108)
        at cucumber.runtime.Runtime.run(Runtime.java:94)
        at cucumber.runtime.Runtime.run(Runtime.java:82)
        at cucumber.cli.Main.run(Main.java:20)
        at cucumber.cli.Main.main(Main.java:12)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
    Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at cucumber.runtime.RuntimeOptions$1.invoke(RuntimeOptions.java:94)
        ... 11 more
    Caused by: java.lang.NoSuchMethodError: gherkin.formatter.model.Feature.getLine()Ljava/lang/Integer;
        at org.jetbrains.plugins.cucumber.java.run.CucumberJvmSMFormatter.feature(CucumberJvmSMFormatter.java:89)
        ... 16 more

    Process finished with exit code 1
    Empty test suite.

如果我通过 JUnit 测试调用该功能文件,它就可以工作。那么为什么它报告空测试套件?

Feature: Information Page

Scenario: Has expected components
    Given I navigate to the information page
    Then I should see the table component

【问题讨论】:

    标签: intellij-idea cucumber cucumber-jvm


    【解决方案1】:

    这是因为我没有安装最新的 cucumber-jvm 插件。

    【讨论】:

    • 我正在使用 cucumber for java 插件版本 133.70 并且仍然遇到此错误。尽管我的 pom.xml 使用的是 cucumber-core 1.0.0,但我没有看到任何针对 cucumber-jvm 的特定插件
    【解决方案2】:

    我有

    Caused by: java.lang.ClassNotFoundException: org.jetbrains.plugins.cucumber.java.run.CucumberJvm3SMFormatter
    

    我在 pom 中需要这个

    <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>1.2.2</version>
        </dependency>
        <dependency>
            <groupId>info.cukes</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>1.2.2</version>
        </dependency>
    

    并且需要 cucumber for java 插件安装

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-05-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-01-09
      • 1970-01-01
      相关资源
      最近更新 更多