Получение ошибки «Причина: java.lang.IllegalArgumentException & java.net.URISyntaxException:» при выполнении параллельного подключаемого модуля Cuvumber JVM - PullRequest
0 голосов
/ 16 февраля 2019

огурец V. 4.2.3 |Селен V.3.8.1 |JUnit V.4.12 |cucumber-jvm- параллельный плагин V.2.0.0 |maven-surefire-плагин V.2.19 |maven-compiler- plugin v.3.3

при запуске тестовых сценариев через параллельный плагин Cucumber-JVM, ошибка получения

        -------------------------------------------------------
         T E S T S
        -------------------------------------------------------
        Running Parallel01IT
        Running Parallel02IT
        Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 
0.156 sec 
        <<< FAILURE! - in Parallel01IT
        initializationError(Parallel01IT)  Time elapsed: 0.014 sec  <<< 
ERROR!
        java.lang.IllegalArgumentException: D:/Learning/Eclipse Projects 
     Backup/TheTransformer(CucumberParallelExecutionWithJVMPlugin)/src/test/resou 
        rces/features/AddEditShipAddrOrdRev.feature is not valid. Try URI[:LINE]*
        Caused by: java.lang.IllegalArgumentException: Illegal character in path at index 19: D:/Learning/Eclipse Projects Backup/TheTransformer(CucumberParallelExecutionWithJVMPlugin)/src/test/resources/features/AddEditShipAddrOrdRev.feature
        Caused by: java.net.URISyntaxException: Illegal character in path at index 19: D:/Learning/Eclipse Projects Backup/TheTransformer(CucumberParallelExecutionWithJVMPlugin)/src/test/resources/features/AddEditShipAddrOrdRev.feature

        Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.189 sec <<< FAILURE! - in Parallel02IT
        initializationError(Parallel02IT)  Time elapsed: 0.004 sec  <<< ERROR!
        java.lang.IllegalArgumentException: D:/Learning/Eclipse Projects Backup/TheTransformer(CucumberParallelExecutionWithJVMPlugin)/src/test/resources/features/LogIn.feature is not valid. Try URI[:LINE]*
        Caused by: java.lang.IllegalArgumentException: Illegal character in path at index 19: D:/Learning/Eclipse Projects Backup/TheTransformer(CucumberParallelExecutionWithJVMPlugin)/src/test/resources/features/LogIn.feature
        Caused by: java.net.URISyntaxException: Illegal character in path at index 19: D:/Learning/Eclipse Projects Backup/TheTransformer(CucumberParallelExecutionWithJVMPlugin)/src/test/resources/features/LogIn.feature


        Results :

        Tests in error: 
          Parallel01IT.initializationError » IllegalArgument D:/Learning/Eclipse Project...
          Parallel02IT.initializationError » IllegalArgument D:/Learning/Eclipse Project...

        Tests run: 2, Failures: 0, Errors: 2, Skipped: 0

        [INFO] ------------------------------------------------------------------------
        [INFO] BUILD FAILURE
        [INFO] ------------------------------------------------------------------------
        [INFO] Total time: 8.041 s
        [INFO] Finished at: 2019-02-17T00:01:37+05:30
        [INFO] ------------------------------------------------------------------------
        [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19:test (default-test) on project CaptainJackSparrow: There are test failures.
        [ERROR] 
        [ERROR] Please refer to D:\Learning\Eclipse Projects Backup\TheTransformer(CucumberParallelExecutionWithJVMPlugin)\target\surefire-reports for the individual test results.
        [ERROR] -> [Help 1]
        org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19:test (default-test) on project CaptainJackSparrow: There are test failures.

        Please refer to D:\Learning\Eclipse Projects Backup\TheTransformer(CucumberParallelExecutionWithJVMPlugin)\target\surefire-reports for the individual test results.
            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.MojoFailureException: There are test failures.

        Please refer to D:\Learning\Eclipse Projects Backup\TheTransformer(CucumberParallelExecutionWithJVMPlugin)\target\surefire-reports for the individual test results.
            at org.apache.maven.plugin.surefire.SurefireHelper.reportExecution(SurefireHelper.java:91)
            at org.apache.maven.plugin.surefire.SurefirePlugin.handleSummary(SurefirePlugin.java:318)
            at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:880)
            at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:739)
            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] Re-run Maven using the -X switch to enable full debug logging.
        [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

и Surefireреализация -

        <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.19</version>
                <configuration>
                    <forkCount>5</forkCount>
                    <reuserForks>true</reuserForks>

                    <includes>
                        <include>**/Parallel*IT.class</include>
                    </includes>
                </configuration>
            </plugin>

И конфигурация плагина Maven Compiler: -

        <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>1.8</source>
                    <target>1.8</target>
                </configuration>
            </plugin> 

конфигурация параллельного плагина cuvumber jvm для создания бегунов во время выполнения

    <plugin>
            <groupId>com.github.temyers</groupId>
            <artifactId>cucumber-jvm-parallel-plugin</artifactId>
            <version>2.0.0</version>
            <executions>
                <execution>
                    <id>generateRunners</id>
                    <phase>validate</phase>
                    <goals>
                        <goal>generateRunners</goal>
                    </goals>
                    <configuration>
                        <glue>com.ann.automation.test.steps</glue>


    <featuresDirectory>src/test/resources/features/</featuresDirectory>
                            <cucumberOutputDir>target/cucumber-parallel</cucumberOutputDir>

                        <format>json,html</format>
                        <tags>"@fp"</tags>
                    </configuration>
                </execution>
            </executions>
        </plugin>

Файл функции входа в систему:

Функция: Войти в систему как зарегистрированный пользователь

 @fp
  Scenario: Log into the Site as Registered User
    Given User is on Brand Home Page "https://factory.anntaylor.com"
    When User clicks on the Sign In link, She lands on the Sign In Page
    And User choose to enter Email ID & Password of the registered account, She lands on the My Account Page

И второй файл функции-

Добавление: доставка Добавить (добавить / редактировать) как зарегистрированный пользователь

  @fp
  Scenario: Add/Edit Shipping Address from Order Review Page as Reg User
    Given User is on Brand Home Page "https://factory.anntaylor.com"
    When User clicks on Super & Sub Category from Mega Menu, She lands on the PLP Page
    And User selects a product on PLP & SKU on PDP
    And User moves to Shopping Bag and choose to log into site as Registered User
    Then Verify User shall land on Order Review Page
    And User choose to Add New Shipping Add clicking on Add New Button
    Then Verify New Shipping Address reflects on Order Review Page
    And User choose to Edit Shipping Add clicking on Edit Button
    Then Verify Updated Shipping Add on Order Review Page       

Файл RunCuke: -

            package com.ann.automation.runner;

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

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

            public class RunCuke {  

            }

Конфигурация POM.xml

                <properties>
                    <project.build.sourceEncoding>UTF-

            8</project.build.sourceEncoding>

                    <selenium.version>3.8.1</selenium.version>
                </properties>

                <dependencies>

                <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>
                    <scope>test</scope>
                </dependency>

                <dependency>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                    <version>4.12</version>
                    <scope>test</scope>
                </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>
                    <scope>test</scope>
                </dependency>

                    <dependency>
                        <groupId>com.google.code.gson</groupId>
                        <artifactId>gson</artifactId>
                        <version>2.8.2</version>
                    </dependency>

                    <dependency>
                        <groupId>net.masterthought</groupId>
                        <artifactId>cucumber-sandwich</artifactId>
                        <version>0.0.4</version>
                    </dependency>

                    <dependency>
                        <groupId>javax.mail</groupId>
                        <artifactId>javax.mail-api</artifactId>
                        <version>1.5.5</version>
                    </dependency>

                    <dependency>
                        <groupId>log4j</groupId>
                        <artifactId>log4j</artifactId>
                        <version>1.2.17</version>
                    </dependency>

                    <dependency>
                        <groupId>org.apache.poi</groupId>
                        <artifactId>poi</artifactId>
                        <version>3.11-beta3</version>
                    </dependency>

                    <dependency>
                        <groupId>org.apache.poi</groupId>
                        <artifactId>poi-ooxml</artifactId>
                        <version>3.9</version>
                    </dependency>

                    <dependency>
                        <groupId>xml-apis</groupId>
                        <artifactId>xml-apis</artifactId>
                        <version>2.0.2</version>
                    </dependency>

                    <dependency>
                        <groupId>org.hamcrest</groupId>
                        <artifactId>hamcrest-all</artifactId>
                        <version>1.3</version>
                    </dependency>

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

                    <dependency>
                        <groupId>com.vimalselvam</groupId>
                        <artifactId>cucumber-extentsreport</artifactId>
                        <version>3.1.1</version>
                    </dependency>

                    <dependency>
                        <groupId>com.aventstack</groupId>
                        <artifactId>extentreports</artifactId>
                        <version>3.1.1</version>
                    </dependency>

                    <dependency>
                        <groupId>commons-io</groupId>
                        <artifactId>commons-io</artifactId>
                        <version>2.6</version>
                    </dependency>

                    <dependency>
                        <groupId>io.appium</groupId>
                        <artifactId>java-client</artifactId>
                        <version>3.4.0</version>
                    </dependency>

                    <dependency>
                        <groupId>com.itextpdf</groupId>
                        <artifactId>itextpdf</artifactId>
                        <version>5.4.0</version>
                    </dependency>

                    <dependency>
                        <groupId>com.lowagie</groupId>
                        <artifactId>itext</artifactId>
                        <version>1.3.1</version>
                    </dependency>

                    <dependency>
                        <groupId>com.codeborne</groupId>
                        <artifactId>phantomjsdriver</artifactId>
                        <version>1.2.1</version>
                    </dependency>

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

                    <dependency>
                        <groupId>com.CA.ATU21</groupId>
                        <artifactId>ATUTestRecorder</artifactId>
                        <version>2.1</version>
                    </dependency>

                    <dependency>
                        <groupId>com.googlecode.json-simple</groupId>
                        <artifactId>json-simple</artifactId>
                        <version>1.1.1</version>
                    </dependency>

                </dependencies>

                <build>
              <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->

                    <pluginManagement>
                        <plugins>
                            <plugin>
                                <groupId>org.eclipse.m2e</groupId>
                                <artifactId>lifecycle-mapping</artifactId>
                                <version>1.0.0</version>
                                <configuration>
                                    <lifecycleMappingMetadata>
                                        <pluginExecutions>
                                            <pluginExecution>
                                                <pluginExecutionFilter>


            <groupId>com.github.temyers</groupId>
                                                        <artifactId>cucumber-jvm-parallel-plugin</artifactId>
                                                        <versionRange>[2.0.0,)</versionRange>

                                                    <goals>
                                                        <goal>generateRunners</goal>
                                                    </goals>
                                                </pluginExecutionFilter>
                                                <action>
                                                    <ignore />
                                                </action>
                                            </pluginExecution>
                                            <pluginExecution>
                                                <pluginExecutionFilter>
                                                    <groupId>
                                                        org.apache.maven.plugins
                                                    </groupId>
                                                    <artifactId>
                                                        maven-compiler-plugin
                                                    </artifactId>
                                                    <versionRange>
                                                        [3.3,)
                                                    </versionRange>
                                                    <goals>
                                                        <goal>testCompile</goal>
                                                    </goals>
                                                </pluginExecutionFilter>
                                                <action>
                                                    <ignore></ignore>
                                                </action>
                                            </pluginExecution>
                                        </pluginExecutions>
                                    </lifecycleMappingMetadata>
                                </configuration>
                            </plugin>
                        </plugins>
                    </pluginManagement>
                    <plugins>

                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.3</version>
                    <configuration>
                        <source>1.8</source>
                        <target>1.8</target>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.19</version>
                    <configuration>
                        <forkCount>5</forkCount>
                        <reuserForks>true</reuserForks>

                        <includes>
                            <include>**/Parallel*IT.class</include>
                        </includes>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>com.github.temyers</groupId>
                    <artifactId>cucumber-jvm-parallel-plugin</artifactId>
                    <version>2.0.0</version>
                    <executions>
                        <execution>
                            <id>generateRunners</id>
                            <phase>validate</phase>
                            <goals>
                                <goal>generateRunners</goal>
                            </goals>
                            <configuration>
                                <glue>com.ann.automation.test.steps</glue>


            <featuresDirectory>src/test/resources/features/</featuresDirectory>
                                    <cucumberOutputDir>target/cucumber-parallel</cucumberOutputDir>

                                <format>json,html</format>
                                <tags>"@fp"</tags>
                            </configuration>
                        </execution>
                    </executions>
                </plugin>

              </plugins>
            </build>
            </project>  

Может кто-нибудь сказать мне, почему я сталкиваюсь с этой ошибкой

            initializationError(Parallel01IT)  Time elapsed: 0.014 sec  <<< ERROR!
            java.lang.IllegalArgumentException: D:/Learning/Eclipse Projects 

            Backup/TheTransformer(CucumberParallelExecutionWithJVMPlugin)/src/test/resources/features/AddEditShipAddrOrdRev.feature is not valid. Try URI[:LINE]*
                Caused by: java.lang.IllegalArgumentException: Illegal character in path at index 19: D:/Learning/Eclipse Projects Backup/TheTransformer(CucumberParallelExecutionWithJVMPlugin)/src/test/resources/features/AddEditShipAddrOrdRev.feature
                Caused by: java.net.URISyntaxException: Illegal character in path at index 19: D:/Learning/Eclipse Projects Backup/TheTransformer(CucumberParallelExecutionWithJVMPlugin)/src/test/resources/features/AddEditShipAddrOrdRev.feature

Кроме того, я неконечно, обязательно ли использовать плагин компилятора maven?Если так, то кто-нибудь может сказать мне, какова зависимость от версии параллельного плагина cucumber-jvm, плагина surefire и плагина компилятора

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...