6
votes

I was trying to going through the tutorial in the angularjs.org's angular-phonecat. In the stetp three I'm getting error for end to end testing with protractor. here's the error code.

Using ChromeDriver directly...
Cannot read property 'matcherFn_' of undefined
[launcher] Runner Process Exited With Error Code: 1

npm ERR! [email protected] protractor: `protractor test/protractor-conf.js`

npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] protractor script.
npm ERR! This is most likely a problem with the angular-phonecat package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     protractor test/protractor-conf.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls angular-phonecat
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.2.9200
npm ERR! command "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nodej
s\\node_modules\\npm\\bin\\npm-cli.js" "run" "protractor"
npm ERR! cwd c:\angular-phonecat\angular-phonecat
npm ERR! node -v v0.10.28
npm ERR! npm -v 1.4.9
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     c:\angular-phonecat\angular-phonecat\npm-debug.log
npm ERR! not ok code 0

What;s going wrong in here?

5
run npm install or npm update on your directory, it looks like a corrupted filemaurycy

5 Answers

3
votes

The problem seems to be caused by the latest 1.0.0 version of minijasminenode. As a temporary workaround this hack worked:

  • edit node_modules/protractor/package.json and change the minijasminenode dependency to <1.0.0 so it now reads like this:

"minijasminenode": "<1.0.0",

  • remove the minijasminenode directory:

rm -r node_modules/protractor/node_modules/minijasminenode

  • reinstall the required modules:

cd node_modules/protractor && npm install

Your e2e tests should now run. There's probably a more graceful way to achieve this.

See also https://github.com/angular/protractor/issues/931

2
votes

Andrew's answer works for me. Thanks Andrew.

By the way, I also changed 'browserName': 'chrome' into 'browserName': 'firefox', as no chrome is installed in my linux box. Then it works.

0
votes

Adding firefox made the protractor tests run on my windows 7, where as on mac chrome was running fine, here is the full test/protractor-conf.js file

exports.config = {
   allScriptsTimeout: 11000,

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

   capabilities: {
    'browserName': 'firefox'
   },

  firefoxOnly: true,

  baseUrl: 'http://localhost:2000/',

  framework: 'jasmine',

  jasmineNodeOpts: {
    defaultTimeoutInterval: 30000
  }
};
0
votes

I was running into a similar issue regardless of which posted solution I could find anywhere. As I run most of my projects through XAMPP, I found that my issue was due to the port been set wrong on the config page.

\test\protractor-config.js

 baseUrl: 'http://localhost:8383/',     <-- Altered to suit xampp localhost port

Was previously

 baseUrl: 'http://localhost:8000/',

Hope this can help others out too.

0
votes

I tried all the solutions but was still getting errors. Changing the protractor version in the main package.json file to "~0.20.1" so that it read "protractor": "~0.20.1", and running the command line as administrator worked for me.

After running it for the first time, it gives a ChromeDriver error. I fixed this simply by replacing the chromeOnly: True property in the protractor-conf.js file with the complete path to the driver itself, in my case: chromeDriver: 'F:/Documents/Angular/angular-phonecat/node_modules/protractor/selenium/chromedriver_2.9.zip'

Not particularly sure whether using an earlier version is a good idea though.