http://www.technicalpage.net/search/label/SQL

BDD_Cucumber_Different Report formats


Different report formats:
Report/Console to display in readable format:

package testRunner_PKG;

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

@RunWith(Cucumber.class)
@Cucumber.Options(
features="features",//path of feature file. To run all feature file give path of the folder, to run specific feature file give pathh of the feature file.
glue={"stepORtestDefinitions"},//path of Step definition . To run all classes in side the package, give path of the package. To run selected step definition class , give path of that class.
format={"pretty"},//this will show output on console
OR
format={"pretty:target1/cucumber-pretty.txt"}, //this will show same output in txt file
monochrome=true/false,//to display console out put in a readable format.
dryRun=true/false,
strict=true/false//If this is true , dry run should be false
)
public class TestRunner {

}

Other different reporting approaches:
package testRunner_PKG;

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

@RunWith(Cucumber.class)
@Cucumber.Options(
features="features",
glue={"stepORtestDefinitions"},
format={"html:test_output"}, //This will create an extra folder test_output inside which it creates a report index.html
OR
format={"json:json_output/report.json"},//This will create an extra folder test_output inside which it creates a report report.json
OR // these are two different Json formats
format={"json:json_output/report.json","usage:targetFolder/report.json"}, 
OR
format={"usage:targetFolder/report.json"},
OR
format={"usage:target/report.json"}
OR
format={"junit:junit_xml/report.xml"},//This will create an extra folder junit_xml inside which it creates a report report.xml
OR
format={"pretty", "html:test_output","json:json_output/report.json","junit:junit_xml/report.xml"}, //combination of more than one type reports
OR
format={"html:output/report_html"},//creates output folder inside which report_html folder inside which index.html report is created. There are two folders.
//The plugin is: plugin={"html:target/cucumber-html-report"}
//target is default folder in Maven
OR
format={"html:target","json:target/jsonReport.json","junit:target/xmlReport.xml","usage:target/jsonReport1.json","pretty:target/prettyReport.txt"}, //To print all reports in same  folder.

monochrome=true/false,
dryRun=true/false,
strict=true/false//If this is true , dry run should be false
)
public class TestRunner {

}

No comments:

Post a Comment