Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

End to End testing with protractor giving error

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?

like image 899
anwarshahriar Avatar asked Jun 14 '14 08:06

anwarshahriar


People also ask

Why Protractor is getting deprecated?

Why is Protractor being deprecated? Protractor was created in 2013. During that time WebDriver APIs were not yet standard, because of which testers and developers faced difficulties in writing end to end tests as there was very little support for async/await.

When was Protractor deprecated?

Earlier this year, the Angular team announced that they would cease development for open source end-to-end automated testing tool Protractor at the end of 2022. As a popular and long-established tool for automated web application testing, Protractor was an early pioneer in enabling behavior-driven end-to-end testing.

How long should E2E tests be?

The other option is to have a special database that is seeded with the correct data and is reset when the tests are run each time. Speed is a big problem when running E2E tests, as it can take 4–8 hours to test a large suite of tests.

How do you run a Protractor test in multiple browsers?

Testing Against Multiple Browsers If you would like to test against multiple browsers, use the multiCapabilities configuration option. Protractor will run tests in parallel against each set of capabilities. Please note that if multiCapabilities is defined, the runner will ignore the capabilities configuration.


2 Answers

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

like image 57
Andrew Savory Avatar answered Nov 12 '22 23:11

Andrew Savory


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.

like image 37
David Z. Avatar answered Nov 13 '22 00:11

David Z.