当使用Cucumber TestNG适配器时,如何在Extent Report-Cucumber TestNG框架中生成日志

当使用Cucumber TestNG适配器时,如何在Extent Report-Cucumber TestNG框架中生成日志,cucumber,testng,extent,Cucumber,Testng,Extent,我使用这两个Maven依赖项生成Cucumber的扩展报告(我还在并行测试框架中使用TestNG): 1.Extentreports-cucumber4-adapter-版本1.07和2。扩展报告-版本4.09 我正在使用TestRunner类来执行功能文件中的场景 除了上述两个依赖项之外,我没有任何类来生成扩展数据块报告 我的问题是-如何在数据块报告中生成日志?我需要在TestRunner类中做哪些更改?我不想在每个步骤定义文件中添加代码 对堆栈溢出进行了研究 这是我的测试跑步者课程: imp

我使用这两个Maven依赖项生成Cucumber的扩展报告(我还在并行测试框架中使用TestNG): 1.Extentreports-cucumber4-adapter-版本1.07和2。扩展报告-版本4.09

我正在使用TestRunner类来执行功能文件中的场景

除了上述两个依赖项之外,我没有任何类来生成扩展数据块报告

我的问题是-如何在数据块报告中生成日志?我需要在TestRunner类中做哪些更改?我不想在每个步骤定义文件中添加代码

对堆栈溢出进行了研究

这是我的测试跑步者课程:

import org.junit.runner.RunWith;
import org.testng.ITestResult;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeSuite;
import org.testng.annotations.DataProvider;

import com.aventstack.extentreports.ExtentReports;
import com.aventstack.extentreports.ExtentTest;

//import com.cucumber.listener.Reporter;
import cucumber.api.CucumberOptions;
import cucumber.api.junit.Cucumber;
import cucumber.api.testng.TestNGCucumberRunner;
import io.cucumber.testng.AbstractTestNGCucumberTests;

@RunWith(Cucumber.class)
@CucumberOptions(

        features="src/test/resources/features/APIPortingGET.feature" ,
        glue= {"stepDefinition"}, //step definition file
        plugin = {"pretty", "html:test-output", "json:target/cucumber-json-report.json", "junit:junit_xml/cucumber.xml", "com.aventstack.extentreports.cucumber.adapter.ExtentCucumberAdapter:test-output/HtmlReport/SOAReport.html"},
        monochrome = true,//displays the console output in a readable format
        dryRun = false//to check mapping is proper between feature and step def file
        //strict = true // will fail the test if there are undefined steps in the step def file or the mapping between the feature file and step def file is wrong
        //tags= {"@debug"}
        )


public class TestRunner extends AbstractTestNGCucumberTests {

    private static TestNGCucumberRunner testNGCucumberRunner;
    ExtentTest test;
    ExtentReports extent;   
        @Override
        @DataProvider(parallel=true)
        public Object[][] scenarios() {
          return super.scenarios();
        }




}

您是否查看了数据块适配器的文档?是的,我没有看到关于如何在测试级别的数据块报告中获取日志(我在Eclipse中获取的控制台日志)的任何直接参考。您是否查看了数据块适配器的文档?是的,我没有看到关于如何获取日志的任何直接参考(我在Eclipse中得到的控制台日志)在测试级别的扩展报告中。