awaken
awaken

Reputation: 809

protractor fdescribe and fit does not work with jasmine-reporters

I have this in my 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'
      })); **/
    },      
};

in my test_spec.js I have

fdescribe('my tests', function() {

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

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

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

}

When I run my tests it will output

[launcher] Running 1 instances of WebDriver
Started


No specs found
Finished in 0.002 seconds

if I comment out the jasmine reporters declaration in my conf.js and run again it will run the correct test and output

[launcher] Running 1 instances of WebDriver
Started
test2
.


1 spec, 0 failures
Finished in 5.675 seconds

Why is jasmine-reporters interfering with focused spec testing? I would like to have jasmine-reporters enable while running with fdescribe and fit. I'm using

protractor: 1.8.0 jasmine-reporters: 2.0.4

Upvotes: 2

Views: 3416

Answers (2)

bloveridge
bloveridge

Reputation: 271

The problem is solved in [email protected].

Apparently when using fit, jasmine does not call the suiteStarted or suiteDone callbacks. jasmine-reporters relies upon these methods being called, and was blowing up as a result. As of 2.0.5, it now tries to detect if these methods have been called and adapt.

Upvotes: 3

Andres D
Andres D

Reputation: 8900

Did you provide the framework='jasmine2' setting in your config file? https://github.com/angular/protractor/blob/master/docs/referenceConf.js#L253

Upvotes: 0

Related Questions