End to End testing with protractor giving error

10,263

Solution 1

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

Solution 2

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.

Share:
10,263
anwarshahriar
Author by

anwarshahriar

Updated on June 30, 2022

Comments

  • anwarshahriar
    anwarshahriar almost 2 years

    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?

  • Venkat
    Venkat almost 10 years
    plus 1 for adding firefox
  • Pratik Pattanayak
    Pratik Pattanayak over 9 years
    +1 for this...what if I want to use IE all versions as browserName:'internet explorer'... what should be replacing internet explorer above to host selenium server on IE (8+)browsers? I referred this code.google.com/p/selenium/wiki/DesiredCapabilities
  • Sajidur Rahman
    Sajidur Rahman about 8 years
    This should be a comment. Not an answer.