Cucumber 努力实现jvm版本4.2.3以实现并行执行

Cucumber 努力实现jvm版本4.2.3以实现并行执行,cucumber,Cucumber,无法连接我要实现的jvm版本4.2.3并行执行的全部内容 我的环境-Cucumber V4.2.3 | Selenium V3.8.1 | Junit-4.2 下面是eclipse控制台的输出。然而,什么都不会被执行 [INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ TheDayAfterTomorrow --- [INFO] Changes detected - recompil

无法连接我要实现的jvm版本4.2.3并行执行的全部内容

我的环境-Cucumber V4.2.3 | Selenium V3.8.1 | Junit-4.2

下面是eclipse控制台的输出。然而,什么都不会被执行

    [INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ TheDayAfterTomorrow ---
    [INFO] Changes detected - recompiling the module!
    [INFO] Compiling 14 source files to D:\photon-workspace\TheDayAfterTomorrow\target\test-classes
    [INFO] 
    [INFO] --- maven-surefire-plugin:2.19:test (default-test) @ TheDayAfterTomorrow ---
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD SUCCESS
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 5.986 s
    [INFO] Finished at: 2019-02-18T23:18:26+05:30
    [INFO] ------------------------------------------------------------------------
我也在使用Pico容器来实现DI

这是我的RunCuke实现

    package com.jacksparrow.automation.suite.runner;

    import org.junit.runner.RunWith;
    import cucumber.api.CucumberOptions;
    import cucumber.api.junit.Cucumber;

    @RunWith(Cucumber.class)
    @CucumberOptions(features = "classpath:features/functional/",
                         glue = {"com.jacksparrow.automation.steps_definitions.functional" },
                       plugin = { "pretty","json:target/cucumber-json/cucumber.json",
                                  "junit:target/Cucumber.xml", "html:target/cucumber-reports"},
                       strict = false,
                       dryRun = false,
                   monochrome = true)

    public class FunctionalRunCuke {
    }
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <compilerVersion>1.8</compilerVersion>
                </configuration>
        </plugin>
POM.XML

        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-java</artifactId>
            <version>4.2.3</version>
        </dependency>

        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-junit</artifactId>
            <version>4.2.3</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
        </dependency>

        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>datatable</artifactId>
            <version>1.1.12</version>
        </dependency>

        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-testng</artifactId>
            <version>4.2.3</version>
        </dependency>

        <dependency>
            <groupId>io.cucumber</groupId>
            <artifactId>cucumber-picocontainer</artifactId>
            <version>4.2.3</version>
        </dependency>

        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-java</artifactId>
            <version>${selenium.version}</version>
        </dependency>

        <dependency>
            <groupId>io.github.bonigarcia</groupId>
            <artifactId>webdrivermanager</artifactId>
            <version>3.0.0</version>
        </dependency>

黄瓜
黄瓜爪哇
4.2.3
黄瓜
黄瓜刺柏
4.2.3
朱尼特
朱尼特
4.12
黄瓜
数据表
1.1.12
黄瓜
黄瓜试验
4.2.3
黄瓜
黄瓜皮容器
4.2.3
org.seleniumhq.selenium
硒爪哇
${selenium.version}
io.github.bonigarcia
webdrivermanager
3.0.0
Maven编译器插件

    package com.jacksparrow.automation.suite.runner;

    import org.junit.runner.RunWith;
    import cucumber.api.CucumberOptions;
    import cucumber.api.junit.Cucumber;

    @RunWith(Cucumber.class)
    @CucumberOptions(features = "classpath:features/functional/",
                         glue = {"com.jacksparrow.automation.steps_definitions.functional" },
                       plugin = { "pretty","json:target/cucumber-json/cucumber.json",
                                  "junit:target/Cucumber.xml", "html:target/cucumber-reports"},
                       strict = false,
                       dryRun = false,
                   monochrome = true)

    public class FunctionalRunCuke {
    }
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <compilerVersion>1.8</compilerVersion>
                </configuration>
        </plugin>

org.apache.maven.plugins
maven编译器插件
3.8.0
1.8
1.8
1.8
Maven Surefire插件

           <plugin>
               <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.19</version>

                <configuration>
                    <parallel>methods</parallel>
                    <threadCount>4</threadCount>
                </configuration>
            </plugin>

org.apache.maven.plugins
maven surefire插件
2.19
方法
4.

请指导此处缺少的内容或实现jvm v4并行执行的步骤。如果有人能分享详细的步骤,我将不胜感激,因为我已经尝试实现它一周了,但到目前为止还没有成功。

问题是因为依赖testNG导致Surefire忽略JUnit包装类。我删除了所有TestNG依赖项,或者您可以调用2 define 2 execution-For TestNG&JUnit,并根据您的需要禁用一个,我正在使用Maven Surefire 3.0.0-M3版

尝试在运行程序类名后面添加“Test”,以便Surefire自动获取。这个类在src/test/java文件夹结构中吗?嘿@Grasshopper,我添加了runner文件名。然而,当我运行Maven时,它仍然一次只执行一个特性。我们是否也需要添加jvmjar以使其运行?在我的POM中,我还有maven编译器插件。希望它不会影响,Cumber Junit V为4.2.3/4.0.0。和JUnit4.12。请在这里指出问题所在。我已经尝试过V4.0.0和V4.2.3**/*RunCukeTest.java也都遵循了这个链接。但运气不好,所以“农家之心”在想,我是否缺少任何特定的依赖性。我们是否需要添加(尝试但没有成功)io.cucumber cucucumber jvm 4.0.0 pom io.cucumber cucumber core 4.0.0可能需要删除cucumber testng依赖项。你有没有试过并行运行简单的junit测试,而没有任何类似的东西。