package com.bosch.runner;
import com.aventstack.extentreports.ResourceCDN;
import com.aventstack.extentreports.reporter.ExtentHtmlReporter;
import com.cucumber.listener.Reporter;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.runner.RunWith;
import java.io.File;
@RunWith(Cucumber.class)
@CucumberOptions(features = "src/test/resource/feature",
plugin = {
"com.cucumber.listener.ExtentCucumberFormatter:target/cucumber-reports/report.html",
"json:target/cucumber-reports/cucumber.json",
"pretty",
"html:target/html-report/cucumber-html-reports.html",
"junit:target/cucumber-reports/cucumber.xml" },
glue = {"com.bosch.step_definitions"},
tags = {})
public class RunCucumberTest {
@BeforeClass
public static void setup() {
ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter("target/extent-report/extend/report.html");
htmlReporter.config().setResourceCDN(ResourceCDN.EXTENTREPORTS);
}
@AfterClass
public static void writeExtentReport() {
Reporter.loadXMLConfig(new File("src/test/resource/config/extent-config.xml"));//
Reporter.setSystemInfo("user", System.getProperty("user.name"));
Reporter.setSystemInfo("os", "Windows");
Reporter.setTestRunnerOutput("Sample test runner output message");
}
}
java cucumber maven-Runner 文件
最新推荐文章于 2025-05-28 20:48:31 发布