How to make a list of failed specs using jasmine custom reporter to post to slack?

烈酒焚心 提交于 2019-12-21 05:14:15

问题


I am trying to work on a custom jasmine reporter and get a list of all the failed specs in the specDone function:

specDone: function(result) {
    if(result.status == 'failed') {          
        failedExpectations.push(result.fullName);
        console.log(failedExpectations);         
    }       
}

where failedExpectations will store an entire list of the failed specs and i need to access this in the afterLaunch function in the protractor config file. But due to the fact that the config file loads everytime a new spec runs it basically gets overwritten and scoping is such that I cannot access it in the afterLaunch function, that is where I am making the call to the slack api. Is there a way to achieve this?

This is what i have it based on : http://jasmine.github.io/2.1/custom_reporter.html

来源:https://stackoverflow.com/questions/39232415/how-to-make-a-list-of-failed-specs-using-jasmine-custom-reporter-to-post-to-slac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!