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?
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.
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.
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.
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.
The problem seems to be caused by the latest 1.0.0 version of minijasminenode. As a temporary workaround this hack worked:
"minijasminenode": "<1.0.0",
rm -r node_modules/protractor/node_modules/minijasminenode
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With