Enable jasmine's stopSpecOnExpectationFailure feature for protractor #3234
Description
(See also: http://stackoverflow.com/questions/37334069/protractor-jasmine-and-stopping-test-on-first-fail )
Jasmine 2.3.0 added an option stopSpecOnExpectationFailure that when set to true will stop a test on the first failure. However, attempting to set this option with jasmineNodeOpts failed.
/*
* conf.js
*/
exports.config = {
framework: 'jasmine',
specs: ['search-spec.js'],
useAllAngular2AppRoots: true,
jasmineNodeOpts: {
stopSpecOnExpectationFailure: true
}
};
Additional information from user alecxe:
From what I see in the protractor and jasmine-npm (the jasmine runner that protractor uses) source code, it is not as simple as adding the stopSpecOnExpectationFailure or stopOnFailure jasmine node option to the configuration. There has to be changes applied to protractor to support the new stopSpecOnExpectationFailure jasmine node option. Please create an issue/feature request in Protractor issue tracker.
I've also tried to call the throwOnExpectationFailure function, set the stopSpecOnExpectationFailure value throw jasmine.getEnv() in onPrepare() but none of that worked. Perhaps, I am missing something and there is a way to enable the setting.