extent-framework / extentreports-cucumber4-adapter

Cucumber4 Adapter for Extent Framework
http://extentreports.com/docs/versions/4/java/cucumber2.html
Apache License 2.0
39 stars 22 forks source link

How to attach log files to top of extent reports #82

Open skhandekar1 opened 2 years ago

skhandekar1 commented 2 years ago

I want to attach my log files to my extent reports. I saw the following from @anshooarora, but it does not solve my issue completely

https://github.com/anshooarora/extentreports-java/issues/249

The problem is that the log gets attached to the last testcase that ran, since I put the command to attach log on my Extent Listener in onExecutionFinish() method:

    @Override
    public void onExecutionFinish() {
        ExtentLogger.logInfo("<a href='file:///C:/Users/skhandekar/eclipse-workspace/Nalu.CP.Automation/nalu-med-mob-app/Outputs/Execution Logs/ExecutionLog.log'>Execution Logs</a>");
        ExtentManager.getInstance().flush();
    }

I want my log to instead be attached on top of the reports as shown in the image below:

image

Any idea how this can be achieved? Thanks in advance!

skhandekar1 commented 2 years ago

With this I was able to attach the execution log to the Log view of the Extent reports, but I want it to be on the main page where all the test results are displayed:

String path = "<a href='file:///C:/Users/abc/eclipse-workspace/CP.Automation/med-mob-app/Outputs/Execution Logs/ExecutionLog.log'>Execution Logs</a>";
        extent.addTestRunnerOutput(path);

image

How can i put this in the desired location?