Falcon
Falcon

Reputation: 1

When jasmine-reporters used to generated output,it is in root directory not in specified directory

  1. I used Jasmine-reporters to generate reporters,i specified the path where to generate the reporter file in config file,but the report is generated in root directory.

I added the following command in my config.file

onPrepare: function() {
    var jasmineReporters = require('C:/Users/KB_PRASHA_QA/AppData/Roaming/npm/node_modules/jasmine-reporters');


jasmine.getEnv().addReporter(
    new jasmineReporters.NUnitXmlReporter ('C:/Users/KB_PRASHA_QA/AppData/Roaming/npm/node_modules/protractor/example/outputdir', true, true)
);
}
  1. In the above command true is mentioned twice after the path,that true indicates which thing?

Upvotes: 0

Views: 252

Answers (1)

giri-sh
giri-sh

Reputation: 6962

Answering your first question and referring to jasmine-reporters repository, you should be passing an object with savePath property to the reporter to have your report stored in a custom path. Here's how -

jasmine.getEnv().addReporter(
    new jasmineReporters.NUnitXmlReporter ({savePath: 'C:/Users/KB_PRASHA_QA/AppData/Roaming/npm/node_modules/protractor/example/outputdir'})
);

Here's an example implementation of it in the github repo.

As per your second question, i don't think you can just pass in an argument like true to the reporter, as most of the reporters identify an argument based on the property/key name. The github repo for jasmine-reporters points that you can pass the arguments with following properties for NUnitXmlReporter - savePath, filename, reportName.

Hope it helps.

Upvotes: 1

Related Questions