anshooarora / extentreports-csharp

Community version of Extent API for .NET has moved to https://github.com/extent-framework/
http://extentreports.com/
Other
47 stars 43 forks source link

Add Optional Parameters for Log Timestamps #7

Closed cameronws closed 8 years ago

cameronws commented 8 years ago

I'm wanting to create a Report from an already executed test/test set and need to specify the Timestamp on the following levels: Test Start and End Times, Step execution timestamp, Total Time for all tests, from an execution extract of our Test repository. I am currently able to override the start and end times for Tests yet unable to specify the Timestamp on a Step level to match that from the extracted data, as that timestamp is specified/created at the time the Log method is called.

anshooarora commented 8 years ago

It is possible to access all logs (and set timestamp) of the test this way:

var test = extent.StartTest("Test");
test.GetTest().LogList.ForEach(x => x.Timestamp = DateTime.Now);
cameronws commented 8 years ago

Not really ideal but it should be fine. Thanks.

anshooarora commented 8 years ago

Version 3 will make it much more straight forward but for now, this is the only way possible..