Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Append Extent Report to existing report in v4.0.6 #103

Closed
ghost opened this issue Nov 25, 2019 · 13 comments
Closed

Append Extent Report to existing report in v4.0.6 #103

ghost opened this issue Nov 25, 2019 · 13 comments
Labels
bug Something isn't working
Milestone

Comments

@ghost
Copy link

ghost commented Nov 25, 2019

Hi, i am trying to append the extent report generated from current execution with an existing extent report from previous execution. Is it possible to do this in v 4.0.6?

@anshooarora
Copy link
Member

anshooarora commented Dec 24, 2019

@chiragbhakar89 appendExisting was removed in version 4 but it will be available soon. Marking as an enhancement.

@anshooarora anshooarora added the enhancement New feature or request label Dec 30, 2019
@anshooarora anshooarora reopened this Dec 30, 2019
@anshooarora
Copy link
Member

anshooarora commented Dec 31, 2019

Planned for release 4.10

@anshooarora
Copy link
Member

This is now available starting 4.10.0-SNAPSHOT release. The feature is in experimental stage, and preliminary use is a little crude:

// JsonFormatter is required to created a json file
JsonFormatter json = new JsonFormatter("target/test.json");
extent.attachReporter(json);

Appending to an existing json file:

TestModelReportBuilder modelBuilder = new TestModelReportBuilder();
modelBuilder.recreateModelFromJson(extent, new File("target/test.json"));

Complete example:

ExtentReports extent = new ExtentReports();
TestModelReportBuilder modelBuilder = new TestModelReportBuilder();
modelBuilder.recreateModelFromJson(extent, new File("target/spark/test.json"));
ExtentSparkReporter spark = new ExtentSparkReporter("target/spark/");
JsonFormatter json = new JsonFormatter("target/spark/test.json");
extent.attachReporter(spark,json);

@anshooarora
Copy link
Member

Closing as this being included in milestone release 4.10.0.

@cacciaf
Copy link

cacciaf commented Jul 24, 2020

Is it possible for html reports?
Thank you

@anshooarora
Copy link
Member

Possible in version 5:

ExtentSparkReporter spark = new ExtentSparkReporter("spark.html");
JsonFormatter json = new JsonFormatter("extent.json");
ExtentReports extent = new ExtentReports();
extent.createDomainFromJsonArchive("extent.json");
extent.attachReporter(json, spark);

@cacciaf
Copy link

cacciaf commented Jul 24, 2020

Possible in version 5:

ExtentSparkReporter spark = new ExtentSparkReporter("spark.html");
JsonFormatter json = new JsonFormatter("extent.json");
ExtentReports extent = new ExtentReports();
extent.createDomainFromJsonArchive("extent.json");
extent.attachReporter(json, spark);

It seems to be working (thank you!) however now base64 screenshots are not clickable, it is shown a small preview (which is very good) but if you click the image nothing happens.
I am just executing some random scripts and noticed this.

@anshooarora anshooarora modified the milestones: 4.10.0, 5.0.x Jul 24, 2020
@anshooarora anshooarora added bug Something isn't working and removed enhancement New feature or request labels Jul 24, 2020
@anshooarora
Copy link
Member

Thanks for checking, I am marking this as a bug.

@cacciaf
Copy link

cacciaf commented Jul 24, 2020

Thanks for checking, I am marking this as a bug.

Thank for your amazing job.
I'll be running a few tests these days, can I report to you possible issues?

@anshooarora
Copy link
Member

I would greatly appreciate it :)

@anshooarora anshooarora reopened this Jul 24, 2020
@cacciaf
Copy link

cacciaf commented Jul 24, 2020

I would like to suggest two points, if possible:

  1. Tests should be sortable by execution date (start), or at least they should be appended with the latest on top.
    At the moment the latest execution is appended to the bottom. If i have a large number of tests I will have to scroll down each time to look for my most recent report
    2020-07-24_21h34_21

  2. When taking a screenshot the status is set to "info", I think there should be a way (method) to set the status as pass, info, failed. Some managers do not like to see other than pass or fail.

Again, thank you very much for your effort and have a nice day.

@anshooarora
Copy link
Member

Thanks.

  1. There is already an enhancement request DisplayOrder in Extent report 4 #136
  2. It is possible to attach a screenshot under any status, below shows 3 possible ways with fail, but the same signatures are available for all other status.
test.fail(Media media);
test.fail(String details, Media media);
test.fail(Throwable t, Media media);

@ghost
Copy link

ghost commented Sep 11, 2020

i have tried above code mentioned to merge my 2 spark reports. But its still generating the 2 different json files and 2 different reports. Can you please clarify how to do this during runtime ?

like i have 2 reports generated as below:

UAT1_Scenario_1_09_11_2020_03_23_50.html
UAT1_Scenario_2_09_11_2020_03_23_50.html

how to merge these two ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants