Kenzitron / protractor-jasmine2-html-reporter

HTML reporter for Jasmine2 and Protractor
32 stars 53 forks source link

Reports deleted #23

Open nvsoares opened 8 years ago

nvsoares commented 8 years ago

Hi. In each run is generated a unique identifier for reports and i intend to keep previous reports. How to make the reports directory not eliminated on each run?

s10mcow commented 8 years ago

+1

Kenzitron commented 8 years ago

I think this is something easily included. How would you like to generate those folders? I mean the naming.

Something like: YYYY-MM-DD_HH:MM:SS ? Random ID? Just one per day?

There should be some kind of rotation management?

s10mcow commented 8 years ago

How about by spec name?

On Feb 29, 2016, at 9:25 PM, Kenzitron notifications@github.com wrote:

I think this is something easily included. How would you like to generate those folders? I mean the naming.

Something like: YYYY-MM-DD_HH:MM:SS ? Random ID? Just one per day?

There should be some kind of rotation management?

— Reply to this email directly or view it on GitHub https://github.com/Kenzitron/protractor-jasmine2-html-reporter/issues/23#issuecomment-190403598.

s10mcow commented 8 years ago

Ideally then once we have multiple folders per spec a way to view the entire report of all the tests would rock!

On Feb 29, 2016, at 9:25 PM, Kenzitron notifications@github.com wrote:

I think this is something easily included. How would you like to generate those folders? I mean the naming.

Something like: YYYY-MM-DD_HH:MM:SS ? Random ID? Just one per day?

There should be some kind of rotation management?

— Reply to this email directly or view it on GitHub https://github.com/Kenzitron/protractor-jasmine2-html-reporter/issues/23#issuecomment-190403598.

nvsoares commented 8 years ago

as I said, the scope of this question is to just have no way to delete the folder of reports. By default folder would remain as well as files in it, and replaced if existed by the same name. This would be the first step. Each can create a role for the report name is dynamic.

Another issue is to have different folders for each test. It makes sense, but I think it should be another option to explore especially when working with multiCapabilities. But this already goes beyond the scope of this issue, and so I will register another where we can continue this discussion.

Please see if you can, by default, do not delete the folder of reports. When creating new report if already a file with the same name, delete and create new.

KuchhalAnkit commented 8 years ago

Below code should solve your purpose.

var today = new Date();
   var timeStamp = today.getMonth() + 1 + '-' + today.getDate() + '-' + today.getFullYear() + '-' + 

today.getHours() + 'h-' + today.getMinutes() + 'm-' +today.getSeconds()+'s';

 jasmine.getEnv().addReporter(
            new Jasmine2HtmlReporter({
                savePath: './Reports/testResultsReport '+timeStamp,
                screenshotsFolder: 'screenPrints',
                takeScreenshots: true,
                takeScreenshotsOnlyOnFailures: true,
            })
        ); 
nvsoares commented 8 years ago

Hello, it was not what I wanted but I changed the approach and achieves something. Thank you.