1

If i run inside eclipse -> Run As -> Maven test, I have an allure-results directory created no problem in /target - Great!

If I call mvn from the command line and pass in some arguments.... I have no allure-results folder generated, I am very confused.

Why would some arguments not be resulting in successful build of allure-reports?

Instead of creating /allure-reports, when i pass in my arguments I can see instead a /cucumber-parallel directory, I assume there is a problem with my POM.XML?

<dependencies>
    <dependency>
      <groupId>org.seleniumhq.selenium</groupId>
      <artifactId>selenium-java</artifactId>
      <version>3.0.0</version>
    </dependency>

    <dependency>
        <groupId>org.hamcrest</groupId>
        <artifactId>hamcrest-junit</artifactId>
        <version>2.0.0.0</version>
    </dependency>

    <dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-server</artifactId>
        <version>3.0.0</version>
        <scope>test</scope>
    </dependency>

     <dependency>
        <groupId>ru.yandex.qatools.allure</groupId>
        <artifactId>allure-cucumber-jvm-adaptor</artifactId>
        <version>1.6.3</version>
    </dependency>

    <dependency>
        <groupId>info.cukes</groupId>
        <artifactId>cucumber-java</artifactId>
        <version>1.2.4</version>
        <scope>test</scope>
    </dependency>

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

    <dependency>
        <groupId>com.google.guava</groupId>
        <artifactId>guava</artifactId>
        <version>16.0.1</version>
    </dependency>
    <dependency>
        <groupId>net.masterthought</groupId>
        <artifactId>cucumber-reporting</artifactId>
        <version>3.7.0</version>
    </dependency>
    <dependency>
  <groupId>com.microsoft.sqlserver</groupId>
  <artifactId>mssql-jdbc</artifactId>
  <version>6.1.0.jre8</version>
  <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.codehaus.jackson</groupId>
        <artifactId>jackson-core-asl</artifactId>
        <version>1.9.13</version>
    </dependency>
    <dependency>
        <groupId>com.github.temyers</groupId>
        <artifactId>cucumber-jvm-parallel-plugin</artifactId>
        <version>2.1.0</version>
    </dependency>
</dependencies>

<profiles>
    <profile>
        <id>read-properties</id>
        <activation>
            <file>
                <exists>src/test/resources/config.properties</exists>
            </file>
        </activation>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.codehaus.mojo</groupId>
                    <artifactId>properties-maven-plugin</artifactId>
                    <version>1.0-alpha-2</version>
                    <executions>
                        <execution>
                        <phase>validate</phase>
                        <goals>
                            <goal>read-project-properties</goal>
                        </goals>
                        <configuration>
                            <files>
                                <file>src\test\resources\config.properties</file>
                            </files>
                        </configuration>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </build>
    </profile>
</profiles>
    <build>
        <plugins>
<plugin>
  <groupId>com.github.temyers</groupId>
  <artifactId>cucumber-jvm-parallel-plugin</artifactId>
  <version>4.1.0</version>
  <executions>
     <execution>
     <id>generateRunners</id>
     <phase>generate-test-sources</phase>
     <goals>
       <goal>generateRunners</goal>
     </goals>
     <configuration>
         <!-- Mandatory -->
         <!-- comma separated list of package names to scan for glue code -->
         <glue>
          <package>webDriver</package>
          <package>censored</package>
          <package>censored2</package>
          <package>testRunner</package>
        </glue>
         <outputDirectory>${project.build.directory}/generated-test-sources/cucumber</outputDirectory>
          <!-- The directory, which must be in the root of the runtime classpath, containing your feature files.  -->
           <featuresDirectory>src/test/java/</featuresDirectory>
          <!-- Directory where the cucumber report files shall be written  -->
          <cucumberOutputDir>target/cucumber-parallel</cucumberOutputDir>
          <!-- comma separated list of output formats json,html,rerun.txt -->
          <format>json</format>
          <!-- CucumberOptions.strict property -->
          <strict>true</strict>
          <!-- CucumberOptions.monochrome property -->
          <monochrome>true</monochrome>
          <!-- The tags to run, maps to CucumberOptions.tags property you can pass ANDed tags like "@tag1","@tag2" and ORed tags like "@tag1,@tag2,@tag3" -->
         <tags></tags>
         <!-- If set to true, only feature files containing the required tags shall be generated. -->
         <filterFeaturesByTags>false</filterFeaturesByTags>
         <!-- Generate TestNG runners instead of default JUnit ones. --> 
         <useTestNG>false</useTestNG>
         <!-- The naming scheme to use for the generated test classes.  One of 'simple' or 'feature-title' --> 
        <namingScheme>simple</namingScheme>
        <!-- The class naming pattern to use.  Only required/used if naming scheme is 'pattern'.-->
        <namingPattern>Parallel{c}IT</namingPattern>
        <!-- One of [SCENARIO, FEATURE]. SCENARIO generates one runner per scenario.  FEATURE generates a runner per feature. -->
        <parallelScheme>FEATURE</parallelScheme>
        </configuration>
       </execution>
     </executions>
   </plugin>


     <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.2</version>
                <configuration>
                    <encoding>UTF-8</encoding>
                    <source>1.7</source>
                    <target>1.7</target>
                    <compilerArgument>-Werror</compilerArgument>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-failsafe-plugin</artifactId>
                <version>2.18.1</version>
            </plugin>

    <plugin>
      <groupId>ru.yandex.qatools.allure</groupId>
      <artifactId>allure-maven-plugin</artifactId>
     <version>2.6</version>
    </plugin>

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-surefire-plugin</artifactId>
        <version>2.19.1</version>
        <configuration>
        <testFailureIgnore>false</testFailureIgnore> 
        <argLine>
         -javaagent:${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar
         -Dcucumber.options="--plugin ru.yandex.qatools.allure.cucumberjvm.AllureReporter"
        </argLine>
        <properties>
        <property>
        <name>RunListener</name>
        <value>/src/test/java/testRunner/setupTeardown.java</value>
        </property>
        </properties>
            <forkCount>10</forkCount>
            <reuseForks>true</reuseForks>
            <includes>
                <include>**/*IT.class</include>
            </includes>
        </configuration>
         <dependencies>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjweaver</artifactId>
                        <version>${aspectj.version}</version>
                    </dependency>
                </dependencies>
    </plugin>

        </plugins>
        <pluginManagement>
            <plugins>
                <!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.codehaus.mojo
                                        </groupId>
                                        <artifactId>
                                            properties-maven-plugin
                                        </artifactId>
                                        <versionRange>
                                            [1.0-alpha-2,)
                                        </versionRange>
                                        <goals>
                                            <goal>
                                                read-project-properties
                                            </goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            com.github.temyers
                                        </groupId>
                                        <artifactId>
                                            cucumber-jvm-parallel-plugin
                                        </artifactId>
                                        <versionRange>
                                            [4.1.0,)
                                        </versionRange>
                                        <goals>
                                            <goal>generateRunners</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore></ignore>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>
3

2 Answers 2

0

This solution was a mix up in the listeners used by maven surefire, when running as a standard test run inside maven it was referencing the allure reporter correctly, passing in arguments I was not correctly passing in the allure reporter as -Dcucumber.Options in mvn.

--plugin ru.yandex.qatools.allure.cucumberjvm.AllureReporter
0

Make sure you have 1. proper version of aspectjweaver with allure junit 2. you have allure maven reporter. Example :

 <reporting>
    <excludeDefaults>true</excludeDefaults>
    <plugins>
        <plugin>
            <groupId>ru.yandex.qatools.allure</groupId>
            <artifactId>allure-maven-plugin</artifactId>
            <version>2.5</version>
        </plugin>
    </plugins>
</reporting>

this will create a folder structure on mvn site command which can be seen using jenkins allure plugins.

An example can be seen here allure pom with junit

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.