空手道黄瓜赛跑者抛出“没有这样的方法”

时间:2018-07-02 12:17:21

标签: cucumber karate

升级黄瓜和空手道版本后,我遇到了异常情况。

  

java.lang.NoSuchMethodError:   Cucumber.runtime.RuntimeOptions.cucumberFeatures(Lcucumber / runtime / io / ResourceLoader;)Ljava / util / List;     在   com.intuit.karate.cucumber.CucumberRunner。(CucumberRunner.java:70)     在   com.intuit.karate.testng.KarateRunner.setUpClass(KarateRunner.java:32)     在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)处   sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)     在   sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)     在java.lang.reflect.Method.invoke(Method.java:498)在   org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)     在   org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:59)     在   org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:458)     在org.testng.internal.Invoker.invokeConfigurations(Invoker.java:222)     在org.testng.internal.Invoker.invokeConfigurations(Invoker.java:142)     在   org.testng.internal.TestMethodWorker.invokeBeforeClassMethods(TestMethodWorker.java:168)     在   org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:105)     在org.testng.TestRunner.privateRun(TestRunner.java:648)处   org.testng.TestRunner.run(TestRunner.java:505)在   org.testng.SuiteRunner.runTest(SuiteRunner.java:455)在   org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)在   org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)在   org.testng.SuiteRunner.run(SuiteRunner.java:364)在   org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)在   org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)在   org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)在   org.testng.TestNG.runSuitesLocally(TestNG.java:1137)在   org.testng.TestNG.runSuites(TestNG.java:1049)在   org.testng.TestNG.run(TestNG.java:1017)在   org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132)     在org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236)     在org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81)

这是我的启动器/运行器:

@CucumberOptions(features = "features/PatientMS.feature", plugin = { "pretty", "html:target/cucumber-report/jsonfiles", "json:target/cucumber-report/jsonfiles/PatientMS.json" })
public class PatientMSLauncher extends KarateRunner {

}

空手道和黄瓜依赖项:

<!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-testng -->
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-testng</artifactId>
            <version>3.0.1</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-java -->
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>3.0.1</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/io.cucumber/cucumber-jvm -->
        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-jvm</artifactId>
            <version>3.0.1</version>
            <type>pom</type>
        </dependency>

        <!-- https://mvnrepository.com/artifact/com.intuit.karate/karate-apache -->
        <dependency>
            <groupId>com.intuit.karate</groupId>
            <artifactId>karate-apache</artifactId>
            <version>0.7.0.2</version>
            <scope>test</scope>
        </dependency>

        <!-- https://mvnrepository.com/artifact/com.intuit.karate/karate-core -->
        <dependency>
            <groupId>com.intuit.karate</groupId>
            <artifactId>karate-core</artifactId>
            <version>0.7.0.2</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/com.intuit.karate/karate-testng -->
        <dependency>
            <groupId>com.intuit.karate</groupId>
            <artifactId>karate-testng</artifactId>
            <version>0.7.0.2</version>
        </dependency>

我尝试通过JUnit运行,但是没有运气!| 我该如何处理这个问题?

谢谢:)

1 个答案:

答案 0 :(得分:0)

好像您在pom.xml中混合了空手道和黄瓜3-不支持。

如果您仍然遇到问题,请执行以下过程:https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue