1
votes

I have following versions in my system

jasmine - [email protected]
node - v4.5.0
protractor - 4.0.10

and I am not able to generate any result file. for my scripts Is it some compatibility issues with these versions, I have also tried with jasmine-reporters - 2.0.0 still no luck.

Please help me thanks

my conf.js looks like

capabilities: {
        'browserName': 'firefox
    },

    onPrepare: function() {

       //The require statement must be down here, since jasmine-reporters
       //needs jasmine to be in the global and protractor does not guarantee
       // this until inside the onPrepare function.
        browser.driver.manage().window().maximize();
        require('jasmine-reporters');
        jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter('testresults', true, true));
    },

    specs: [
            'Apps/ImportApp/importEMC.js',
    ],

I have also tried with jasmine-reporters 2.0.0 and code was

framework: 'jasmine2',
onPrepare: function() {
var jasmineReporters = require('jasmine-reporters');
jasmine.getEnv().addReporter(new jasmineReporters.JUnitXmlReporter({
    consolidateAll: true,
    savePath: 'testresults',
    filePrefix: 'xmloutput'
}));
},

for this it gave me error as

jasmineReporters.JUnitXmlReporter is not a function

Error Log

at exports.config.onPrepare (D:\HalomemTestScripts\halosysNewScripts\localWorkspace\halosysus_halomem-newtests\conf_importapp.js:33:38) at C:\Users\tanushree.y\AppData\Roaming\npm\node_modules\protractor\built\util.js:48:49 at Function.promise (C:\Users\tanushree.y\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:682:9) at Object.runFilenameOrFn_ (C:\Users\tanushree.y\AppData\Roaming\npm\node_modules\protractor\built\util.js:38:16) at C:\Users\tanushree.y\AppData\Roaming\npm\node_modules\protractor\built\runner.js:93:27 at _fulfilled (C:\Users\tanushree.y\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:834:54) at Promise.then.Q.nextTick.self.promiseDispatch.done (C:\Users\tanushree.y\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:863:30) at Promise.promise.promiseDispatch (C:\Users\tanushree.y\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:796:13) at C:\Users\tanushree.y\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:556:49 at runSingle (C:\Users\tanushree.y\AppData\Roaming\npm\node_modules\protractor\node_modules\q\q.js:137:13) [11:42:23] E/launcher - Process exited with error code 100

1
did you properly install the npm module using the command npm install jasmine-reporters?Sudharsan Selvaraj
put () like new jasmineReporters().JUnitXmlReporter({........ not jasmineReporters.JUnitXmlReporter({........radio_head
Could you share the complete stack trace of the error?Vishal Aggarwal
@SudharsanSelvaraj Yes I have installed the jasmine-reporters with following command npm install --save-dev jasmine-reporters@^2.0.0Tanushree
@Danny after trying framework: 'jasmine2', onPrepare: function() { var jasmineReporters = require('jasmine-reporters'); jasmine.getEnv().addReporter(new jasmineReporters().JUnitXmlReporter({ consolidateAll: true, savePath: 'testresults', filePrefix: 'xmloutput' })); }, I am getting this error E/launcher - Error: TypeError: jasmineReporters is not a functionTanushree

1 Answers

0
votes

jasmine-reporters should be updated not only in our system but also in the project repository we have node-modules folder. there also we need to update the jasmine-reporters version. This was the mistake I was doing I was updating jasmine in my system but it worked for me when I updated jasmine-reporters in node-modules in the project repository. Its very silly thing to be missed out.