Окружающая среда - Огурец V. 4.2.3 | Selenium V.3.8.1 | JUnit V.4.12 | cucumber-jvm- parallel-plugin V.1.2.1 | maven-surefire-plugin V.2.19.1 | maven-compiler- плагин v.3.3 При выполнении плагина cucumber-jvm parallel & maven surefire я сталкиваюсь с ошибкой ниже

    [ERROR] COMPILATION ERROR : 
    [INFO] -------------------------------------------------------------
    [ERROR] /D:/photon-workspace/TheDayAfterTomorrow/target/generated-test- 
    sources/Parallel03IT.java:[9,14] cannot find symbol
      symbol:   method format()
      location: @interface cucumber.api.CucumberOptions
    [ERROR] /D:/photon-workspace/TheDayAfterTomorrow/target/generated-test- 
    sources/Parallel01IT.java:[9,14] cannot find symbol
      symbol:   method format()
      location: @interface cucumber.api.CucumberOptions
    [ERROR] /D:/photon-workspace/TheDayAfterTomorrow/target/generated-test- 
    sources/Parallel02IT.java:[9,14] cannot find symbol
      symbol:   method format()
      location: @interface cucumber.api.CucumberOptions
    [INFO] 3 errors 
    [INFO] -------------------------------------------------------------
    [INFO] ------------------------------------------------------------------ 
    ------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------ 
    ------
    [INFO] Total time: 6.169 s
    [INFO] Finished at: 2019-02-17T13:43:48+05:30
    [INFO] ------------------------------------------------------------------ 
    ------
    [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-

    plugin:3.3:testCompile (default-testCompile) on project 
    TheDayAfterTomorrow: Compilation failure: Compilation failure:` 

    [ERROR] /D:/photon-workspace/TheDayAfterTomorrow/target/generated-test- 
    sources/Parallel03IT.java:[9,14] cannot find symbol
    [ERROR]   symbol:   method format()
    [ERROR]   location: @interface cucumber.api.CucumberOptions
    [ERROR] /D:/photon-workspace/TheDayAfterTomorrow/target/generated-test- 
    sources/Parallel01IT.java:[9,14] cannot find symbol
    [ERROR]   symbol:   method format()
    [ERROR]   location: @interface cucumber.api.CucumberOptions
    [ERROR] /D:/photon-workspace/TheDayAfterTomorrow/target/generated-test- 
    sources/Parallel02IT.java:[9,14] cannot find symbol
    [ERROR]   symbol:   method format()
    [ERROR]   location: @interface cucumber.api.CucumberOptions
    [ERROR] -> [Help 1]
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute 

    goal org.apache.maven.plugins:maven-compiler-plugin:3.3:testCompile (default-testCompile) on project TheDayAfterTomorrow: Compilation failure
            at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:213)
            at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)

        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
        at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:290)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:194)
        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.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
    Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
        at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:911)
        at org.apache.maven.plugin.compiler.TestCompilerMojo.execute(TestCompilerMojo.java:153)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
        ... 20 more
    [ERROR] 
    [ERROR] 
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

Я понимаю, что в параллельном плагине cucumber jvm должна быть некоторая неправильная конфигурация, вероятно, не в maven surefire, поскольку я получаю ошибку компиляции при выполнении POM.XML через eclipse с помощью команды -e clean install

Cucumber JVM Parallel Plugin Configuration
        <plugin>
            <groupId>com.github.temyers</groupId>
            <artifactId>cucumber-jvm-parallel-plugin</artifactId>
            <version>1.2.1</version>
            <executions>
                <execution>
                    <id>generateRunners</id>
                    <phase>generate-test-sources</phase>
                    <goals>
                        <goal>generateRunners</goal>
                    </goals>
                    <configuration>
                        <glue>com.jacksparrow.automation.steps_definitions.functional</glue>
                        <outputDirectory>${project.build.directory}/generated-test-sources</outputDirectory>
                        <featuresDirectory>src/test/resources/features/functional/</featuresDirectory>
                        <cucumberOutputDir>target/cucumber-parallel</cucumberOutputDir>
                        <format>json,html</format>
                        <tags>"@guest_plp"</tags>
                    </configuration>
                </execution>
            </executions>
        </plugin>

Maven Surefire Plugin Configuration

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.19.1</version>
            <configuration>
                <forkCount>2</forkCount>
                <reuserForks>true</reuserForks>
                <!-- <parallel>all</parallel> -->
                <!-- <useUnlimitedThreads>true</useUnlimitedThreads> -->
                <!-- <threadCountMethods>2</threadCountMethods> -->
                <includes>
                    <include>**/Parallel*IT.class</include>
                </includes>
            </configuration>
        </plugin>

**Maven Compiler Plugin**

        <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                    <compilerVersion>1.8</compilerVersion>
                </configuration>
        </plugin>

Не могу понять, что именно вызывает эту ошибку. Пожалуйста, это сгенерированный jvm файл бегуна **

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

    @RunWith(Cucumber.class)
    @CucumberOptions(strict = true,
        features = {"classpath:functional/CheckoutOrderPlacement.feature"},
        format = {"json:target/cucumber-parallel/1.json", 
    "html:target/cucumber-parallel/1.html", "pretty"},
        monochrome = false,
        tags = {"@guest_plp"},
        glue = { "com.jacksparrow.automation.steps_definitions.functional" })
    public class Parallel01IT {
    }
0
TheSociety 17 Фев 2019 в 11:33

2 ответа

Лучший ответ

Проблема заключалась в том, что параметр был задан как формат, а не параметр плагина. Поскольку я использую Cucumber v.4, и он уже обесценился. Таким образом, изменение формата плагина в pom.xml решило проблему.

0
TheSociety 23 Фев 2019 в 11:58

Удалите двойные кавычки "@guest_plp"

0
user3870889 7 Май 2019 в 21:48