title: Extent Report: Add Class Name Method Name to fail test
body: <p>I"m running Cucumber selenium extent report in my test project. I wonder how to add class name + method name into extent report for pass/fail test results. Below is my code: </p>
  
  <pre><code>    @CucumberOptions(
          features = "src/Feature",
          glue = {"Step_Definitions"},
          plugin = {
                  "pretty",
                  "html:target/cucumber-reports/cucumber-pretty",
                  "json:target/cucumber-reports/CucumberTestReport.json",
                  "rerun:target/cucumber-reports/rerun.txt"
      })
  
          public class TestRunner {
              private TestNGCucumberRunner testNGCucumberRunner;
              private ExtentHtmlReporter htmlReporter;
              private ExtentReports extent;
              private ExtentTest logger;
  
      @BeforeTest(alwaysRun = true)
      public void setUp() throws Exception {
          testNGCucumberRunner = new TestNGCucumberRunner(this.getClass());
  
          htmlReporter = new ExtentHtmlReporter(System.getProperty("user.dir") +"/report/Test-Report.html");
          extent = new ExtentReports ();
          extent.attachReporter(htmlReporter);
          extent.setSystemInfo("Host Name", "MyTest");
          extent.setSystemInfo("Environment", "SIT");
          extent.setSystemInfo("User Name", "Peter Wong");
  
          htmlReporter.config().setDocumentTitle("Test Report");
          htmlReporter.config().setReportName("Test Report");
          htmlReporter.config().setTestViewChartLocation(ChartLocation.TOP);
          htmlReporter.config().setTheme(Theme.STANDARD);
      }
  
      @Test(groups = "cucumber", description = "Runs Cucumber Feature", dataProvider = "dataProvider")
      public void feature(CucumberFeatureWrapper cucumberFeature) {
          testNGCucumberRunner.runCucumber(cucumberFeature.getCucumberFeature());
      }
    /*  
      @Test
      public void passTest(){
          logger = extent.createTest("passTest");
          Assert.assertTrue(true);
          logger.log(Status.PASS, MarkupHelper.createLabel("Test Case Passed is passTest", ExtentColor.GREEN));
  
           try {
              logger.fail("Pass Details", MediaEntityBuilder.createScreenCaptureFromPath("screenshot.png").build());
          } catch (IOException ex) {
              LogManager.logger.log(Level.INFO, "Exception: " + ex.getMessage());
          }
      }
  
    */
  
      @AfterMethod
      public void getResult(ITestResult result){
          if(result.getStatus() == ITestResult.FAILURE) {
              logger.log(Status.FAIL, MarkupHelper.createLabel(result.getName() + " - Test Case Failed", ExtentColor.RED));
              logger.log(Status.FAIL, MarkupHelper.createLabel(result.getThrowable() + " - Test Case Failed", ExtentColor.RED));
          }
          else if(result.getStatus() == ITestResult.SKIP) {
              logger.log(Status.SKIP, MarkupHelper.createLabel(result.getName() + " - Test Case Skipped", ExtentColor.ORANGE)); 
          }
      }
  
      @AfterTest(alwaysRun = true)
      public void tearDown() throws Exception {
          extent.flush();
          testNGCucumberRunner.finish();
      }
  }
  </code></pre>
  
  <p>Questions: </p>
  
  <ol>
  <li>Is it add the capture method name at @Test? How about using Cucumber
  to achieve this? 
  
  <ol start="2">
  <li>What is the best design approach to integrate extent report with Cucumber runner class?</li>
  </ol></li>
  </ol>
  
  <p>Please help. Hope someone who can really help me on this.   </p>
  
  <p><a href="https://i.stack.imgur.com/3GBGQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3GBGQ.png" alt="enter image description here"></a></p>