I am new to cucumber.I am trying to run cucumber feature files using testng in maven project. for which, in my pom.xml file, I have dependencies for TestNG,cucumber,junit,cucumber junit,cucumber java,selenium java
I have imported CucumberOptions
from io.cucumber.junit.CucumberOptions
and when i used attribute format , eclipse is throwing error that format The attribute format is undefined for the annotation type CucumberOptions
Also eclipse is giving me options to import CucumberOptions from 3 different classes namely
io.cucumber.junit.CucumberOptions
io.cucumber.testng.CucumberOptions
cucumber.api.CucumberOptions
I have 2 questions.
All these 3 packages seems do not support format attribute, what should i do , if i want to have below o/p
format = { "pretty", "html:target/cucumber-reports/cucumber-pretty", "json:target/cucumber-reports/CucumberTestReport.json", "rerun:target/cucumber-reports/rerun.txt" }
I am completely clue less when to use each of these package for what scenario . Please help me.
tried googling for info, few blogs said format is deprecated and now we need to use pretty, at the same time few say we should use format for generating output in different formats
package com.qa.testngcucumberrunner;
import io.cucumber.junit.CucumberOptions;
@CucumberOptions(
dryRun=false,
monochrome=true,
strict=true,
features={"./src/test/resources/com/qa/features"},
glue={"com.qa.stepdef"},
plugin={"json:target/cucumber-
reports/CucumberTestReport.json"},
format = {
"pretty",
"html:target/cucumber-reports/cucumber-pretty",
"json:target/cucumber-reports/CucumberTestReport.json",
"rerun:target/cucumber-reports/rerun.txt"
}
)
public class TestRunner {}
Expectation: Want to know when should i use which import Also want to know what should i do to get report in html,json,return formates as mentioned in TestRunner file