Save jasmin spec report to variable or file

515 Views Asked by At

how to save JASMIN-SPEC-REPORTER the test result in the variable or file, , which will later be sent to slack after test?

1

There are 1 best solutions below

1
DonerKebab On

From https://github.com/bcaudan/jasmine-spec-reporter/tree/master/examples/protractor. Add it to your config:

let SpecReporter = require('jasmine-spec-reporter').SpecReporter;

exports.config = {
   // your config here ...

   onPrepare: function () {
     jasmine.getEnv().addReporter(new SpecReporter({
      spec: {
        displayStacktrace: true
  }
}));
}
}

Or you can check out a very cool reporer: https://github.com/mlison/protractor-jasmine2-screenshot-reporter. It will take screen shorts and generate your test result to a html file.