量角器fdescribe和fit不适用于茉莉花 - 记者

时间:2015-03-07 00:29:22

标签: jasmine protractor

我在conf.js中有这个

onPrepare: function() {
    /**if comment out then spec runs, if uncomment then spec doesn't run
    var jasmineReporters = require('jasmine-reporters');
    jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
    consolidateAll: true,
    filePrefix: 'portal_tests_xmloutput',
        savePath: './test_results_report'
      })); **/
    },      
};

在我的test_spec.js中我有

fdescribe('my tests', function() {

it('test1', function(){
});

fit('test2', function(){
});

it('test3', function(){
});

}

当我运行我的测试时,它将输出

[launcher] Running 1 instances of WebDriver
Started


No specs found
Finished in 0.002 seconds

如果我在我的conf.js中注释掉jasmine记者声明并再次运行它将运行正确的测试和输出

[launcher] Running 1 instances of WebDriver
Started
test2
.


1 spec, 0 failures
Finished in 5.675 seconds

为什么茉莉花 - 记者会干扰重点测试?我希望在使用fdescribe和fit运行时启用jasmine-reporter。我正在使用

量角器:1.8.0 茉莉花 - 记者:2.0.4

2 个答案:

答案 0 :(得分:3)

问题在jasmine-reporters@2.0.5解决了。

显然,在使用fit时,jasmine不会调用suiteStartedsuiteDone回调。 jasmine-reporters依赖于这些被调用的方法,并因此而被炸毁。从2.0.5开始,它现在试图检测这些方法是否已被调用和适应。

答案 1 :(得分:0)

您是否在配置文件中提供了framework='jasmine2'设置? https://github.com/angular/protractor/blob/master/docs/referenceConf.js#L253

相关问题