Click here to Skip to main content
15,884,298 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am trying to create allure report using cucumber, maven project but allure-result folder with json files in it not getting created.

Below is my POM.xml file.

	<version>0.0.1-SNAPSHOT</version>
	<properties>
		<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
		<allure.version>1.5.2</allure.version>
		<aspectj.version>1.8.4</aspectj.version>
	</properties>
	
	<dependencies>
		<dependency>
			<groupId>net.masterthought</groupId>
			<artifactId>cucumber-reporting</artifactId>
			<version>1.0.0</version>
		</dependency>
		<dependency>
			<groupId>info.cukes</groupId>
			<artifactId>gherkin</artifactId>
			<version>2.12.2</version>
		</dependency>
		<dependency>
			<groupId>junit</groupId>
			<artifactId>junit</artifactId>
			<version>3.8.1</version>
		</dependency>
		<dependency>
			<groupId>info.cukes</groupId>
			<artifactId>cucumber-junit</artifactId>
			<version>1.2.5</version>
		</dependency>
		<dependency>
			<groupId>jdom</groupId>
			<artifactId>jdom</artifactId>
			<version>1.1</version>
		</dependency>
		<dependency>
			<groupId>info.cukes</groupId>
			<artifactId>cucumber-core</artifactId>
			<version>1.2.5</version>
		</dependency>
		<dependency>
			<groupId>info.cukes</groupId>
			<artifactId>cucumber-jvm</artifactId>
			<version>1.2.5</version>
			<type>pom</type>
		</dependency>
		<dependency>
			<groupId>log4j</groupId>
			<artifactId>log4j</artifactId>
			<version>1.2.17</version>
		</dependency>
		<dependency>
			<groupId>info.cukes</groupId>
			<artifactId>cucumber-java</artifactId>
			<version>1.2.2</version>
		</dependency>
		
		<dependency>
            <groupId>ru.yandex.qatools.allure</groupId>
            <artifactId>allure-core</artifactId>
            <version>${allure.version}</version>
            <type>pom</type>
        </dependency>
        <dependency>
            <groupId>ru.yandex.qatools.allure</groupId>
            <artifactId>allure-java-aspects</artifactId>
            <version>${allure.version}</version>
            <type>jar</type>
        </dependency>
        <dependency>
            <groupId>ru.yandex.qatools.allure</groupId>
            <artifactId>allure-commons</artifactId>
            <version>${allure.version}</version>
            <type>jar</type>
        </dependency>      
<dependency>
    <groupId>io.qameta.allure</groupId>
    <artifactId>allure-cucumber-jvm</artifactId>
    <version>2.13.2</version>
</dependency>
    
	</dependencies>
	<build>
		<plugins>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-compiler-plugin</artifactId>
				<version>2.3.2</version>
				<configuration>
					<source>1.8</source>
					<target>1.8</target>
					<fork>true</fork>

				</configuration>
			</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>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.aspectj</groupId>
                        <artifactId>aspectjweaver</artifactId>
                        <version>${aspectj.version}</version>
                    </dependency>
                </dependencies>
            </plugin>          
            <plugin>
            <groupId>io.qameta.allure</groupId>
            <artifactId>allure-maven</artifactId>
            <version>2.9</version>
        </plugin>
			
		</plugins>
	</build>




below is step Defination file:
<pre>package stepDefination;
import org.openqa.selenium.WebDriver;
import cucumber.api.java.en.Given;
import cucumber.api.java.en.Then;
import cucumber.api.java.en.When;
public class CustomerInfoVerification {

	@Given("^user is already on home Page$")
	public void user_is_already_on_home_Page() throws Throwable {
		System.out.print(" thid is Given");
	}

	@When("^click on Pattinson, Robert provider$")
	public void click_on_Pattinson_Robert_provider() throws Throwable {
		System.out.print("  thid is When");
	}

	@Then("^user verifies unm and password$")
	public void userVerifiesGeography() throws Throwable {
		System.out.print(" thid is Then");

	}

}


Below is my feature File:

Feature: Rule management module
Scenario: Provider information module
Given user is already on home Page
When click on Pattinson, Robert provider
Then user verifies unm and password


What I have tried:

CSS

i have tried to run below test runner file my test cases are getting executed and passed but Allure-results folder is not getting generated

test Runner:

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

@RunWith(Cucumber.class)
@CucumberOptions(features = { "classpath:featureFile/clinicRule.feature" }, 
glue = { "stepDefination" },
monochrome = true, 
plugin = { "pretty", "html:target/cucumber-html-reports",
		"json:target/cucumber-html-reports/cucumber.json","rerun:target/failed_scenarios.txt" })
public class TestRunner {

}
Posted
Updated 9-Sep-20 6:09am

1 solution

You have wrote stepDefination instead of stepDefinition in your glue of the TestRunner class.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900