黄瓜4 JVM与扩展区报告器并行运行

时间:2019-03-21 16:51:37

标签: maven cucumber cucumber-jvm extentreports

我正在尝试使用Cucumber 4来运行并行测试执行。我也试图与此一起使用程度报告器。 Maven测试版本还应该运行测试代码。我还试图使实现独立于我的测试代码。 除了程度记者,我还有其他工作。 我的专家依赖:

    <dependencies>
    <dependency>
        <groupId>com.sitture</groupId>
        <artifactId>cucumber-jvm-extentreport</artifactId>
        <version>3.1.2</version>
    </dependency>
    <dependency>
        <groupId>com.aventstack</groupId>
        <artifactId>extentreports</artifactId>
        <version>4.0.9</version>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.12</version>
    </dependency>       
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>4.1.1</version>
    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-junit</artifactId>
        <version>4.1.1</version>
    </dependency>
    <dependency>
        <groupId>io.cucumber</groupId>
        <artifactId>cucumber-core</artifactId>
        <version>4.1.1</version>
    </dependency>

    <dependency>
        <groupId>net.masterthought</groupId>
        <artifactId>cucumber-reporting</artifactId>
        <version>3.13.0</version>
    </dependency>

</dependencies>

这是我的跑步者

     @Test
public void test() throws Throwable {
    Main.main(new String[]{
            "--threads", "2",
            "-p", "html:target/cucumber/",
            "-p", "pretty:target/cucumber/cucumber-pretty.txt",
            "-p", "json:target/cucumber/cucumber.json",
            "-p", "junit:target/cucumber/cucumber.xml",
            "-p", "usage:target/cucumber/cucumber-usage.json",
            "-p", "com.sitture.ExtentFormatter:target/output/extent-report/index.html", 
            "-g", "bdd.steps", "src/test/resources"});
}

现在抛出错误:

java.lang.IncompatibleClassChangeError: Found interface cucumber.api.TestCase, but class was expected
at com.sitture.ExtentFormatter.handleStartOfFeature(ExtentFormatter.java:160)
at com.sitture.ExtentFormatter.handleTestCaseStarted(ExtentFormatter.java:110)
at com.sitture.ExtentFormatter.access$100(ExtentFormatter.java:36)
at com.sitture.ExtentFormatter$2.receive(ExtentFormatter.java:63)
at com.sitture.ExtentFormatter$2.receive(ExtentFormatter.java:60)
at cucumber.runner.AbstractEventPublisher.send(AbstractEventPublisher.java:45)
at cucumber.runner.AbstractEventPublisher.sendAll(AbstractEventPublisher.java:52)
at cucumber.runner.CanonicalOrderEventPublisher.handle(CanonicalOrderEventPublisher.java:18)
at cucumber.runtime.formatter.Plugins$1.receive(Plugins.java:55)
at cucumber.runner.AbstractEventPublisher.send(AbstractEventPublisher.java:38)
at cucumber.runner.AbstractEventBus.send(AbstractEventBus.java:9)
at cucumber.runner.TimeServiceEventBus.send(TimeServiceEventBus.java:3)
at cucumber.runtime.Runtime.run(Runtime.java:98)
at cucumber.api.cli.Main.run(Main.java:26)
at cucumber.api.cli.Main.main(Main.java:8)
at bdd.util.TestRunnerParallel.test(TestRunnerParallel.java:11)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

有关详细信息,您可以访问我的测试代码https://github.com/hossainelahi7/Cucumber-JVM4-extentreporter

0 个答案:

没有答案