0

I'm trying to integrate Jasmine reports with Angular end to end test. But while running the test I'm getting the following error(I even tried the same in windows based environement and got the same result),

in on prepare method
Error: Cannot find module 'jasmine-reporters'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at exports.config.onPrepare (/apps/opt/projects/pcp/workspace/pcp/modules/web/public/test/config/protractor-e2e-conf.js:18:6)
    at Runner.runFilenamesOrFns_ (/apps/softwares/node-v0.10.28-linux-x86/lib/node_modules/protractor/lib/runner.js:64:9)
    at Runner.runTestPreparers (/apps/softwares/node-v0.10.28-linux-x86/lib/node_modules/protractor/lib/runner.js:91:8)
    at runner.controlFlow.execute.then.jasmineNodeOpts (/apps/softwares/node-v0.10.28-linux-x86/lib/node_modules/protractor/lib/frameworks/jasmine.js:39:12)
    at webdriver.promise.ControlFlow.runInNewFrame_ (/apps/softwares/node-v0.10.28-linux-x86/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1531:20)
    at webdriver.promise.ControlFlow.runEventLoop_ (/apps/softwares/node-v0.10.28-linux-x86/lib/node_modules/protractor/node_modules/selenium-webdriver/lib/webdriver/promise.js:1396:8)
==== async task ====
run test preparers
    at Object.exports.run (/apps/softwares/node-v0.10.28-linux-x86/lib/node_modules/protractor/lib/frameworks/jasmine.js:38:24)
    at driverprovider_.setupEnv.then.then.then.testResult (/apps/softwares/node-v0.10.28-linux-x86/lib/node_modules/protractor/lib/runner.js:233:28)
    at _fulfilled (/apps/softwares/node-v0.10.28-linux-x86/lib/node_modules/protractor/node_modules/q/q.js:797:54)
    at self.promiseDispatch.done (/apps/softwares/node-v0.10.28-linux-x86/lib/node_modules/protractor/node_modules/q/q.js:826:30)
    at Promise.promise.promiseDispatch (/apps/softwares/node-v0.10.28-linux-x86/lib/node_modules/protractor/node_modules/q/q.js:759:13)
    at /apps/softwares/node-v0.10.28-linux-x86/lib/node_modules/protractor/node_modules/q/q.js:525:49
    at flush (/apps/softwares/node-v0.10.28-linux-x86/lib/node_modules/protractor/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:419:13)
    at Function.Module.runMain (module.js:499:11)

I already added 'Jasmine-reporters' as npm install -g jasmine-reporters

also I can see the folder under,

/node-v0.10.28-linux-x86/lib/node_modules/jasmine-reporters

My protractor config is as follows,

exports.config = {
        seleniumAddress: 'http://172.16.136.181:4444/wd/hub',

        specs: [
                '../e2e/*.js',
              ],

        capabilities: {
            'browserName': 'chrome'
        },

        baseUrl:'http://gdc-java64-13:9000',

        allScriptsTimeout: 96000,

        onPrepare: function() {

        require('jasmine-reporters');
        jasmine.getEnv().addReporter(new jasmine.JUnitXmlReporter(null, true, true, 'testresults.e2e'));

        },


          jasmineNodeOpts: {
                // onComplete will be called just before the driver quits.
                onComplete: null,
                // If true, display spec names.
                isVerbose: false,
                // If true, print colors to the terminal.
                showColors: true,
                // If true, include stack traces in failures.
                includeStackTrace: true,
                // Default time to wait in ms before a test fails.
                defaultTimeoutInterval: 30000
              }

};

Do anyone have any idea.

Thank You

2
  • Did you have several node installations ? Commented Jun 24, 2014 at 12:08
  • No only one configured in my bashrc as,PATH=<some more path values>:/apps/softwares/node-v0.10.28-linux-x86/bin Commented Jun 25, 2014 at 3:12

1 Answer 1

2

This was resolved after I set the NODE_PATH environment variable as,

export NODE_PATH = /apps/softwares/node-v0.10.28-linux-x86/lib/node_modules

according to this

Sign up to request clarification or add additional context in comments.

1 Comment

Same problem here configuring Team City to run Protractor tests on Windows Server 2012 R2. The path I had to use was: C:\Users\Administrator\AppData\Roaming\npm\node_modules. Thanks! This solution worked fine for me

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.