Custom Jasmine reporter in Protractor tests

后端 未结 4 1552
旧时难觅i
旧时难觅i 2021-01-04 00:40

I can not find how to change reporter style in protractors runner using jasmine framework.

What I have right now is:

相关标签:
4条回答
  • 2021-01-04 01:14

    To extend @fer's answer:

    You can add these settings to jasmineNodeOpts to both see the current test and get stack trace right when test fails:

      jasmineNodeOpts: {
        showColors: true,
        isVerbose: true,
        realtimeFailure: true,
        includeStackTrace: true,
        defaultTimeoutInterval: 30000
      },
    
    0 讨论(0)
  • 2021-01-04 01:24

    I am building a jasmine reporter that does exactly what you want, jasmine-spec-reporter.

    0 讨论(0)
  • 2021-01-04 01:25

    Add this dependency to your project:
    npm install jasmine-spec-reporter --save-dev

    And add this to your config file:

    onPrepare: function(){
        var SpecReporter = require('jasmine-spec-reporter').SpecReporter;
        jasmine.getEnv().addReporter(new SpecReporter({displayStacktrace: 'all'}));
    }
    
    0 讨论(0)
  • 2021-01-04 01:26

    Add the isVerbose flag to the protractor config, it's false by default:

    exports.config = {
      . . .
    
      // Options to be passed to Jasmine-node.
      jasmineNodeOpts: {
        showColors: true,
        defaultTimeoutInterval: 30000,
        isVerbose: true
      }
    };
    
    0 讨论(0)
提交回复
热议问题