End-to-end testing with protractor feed error

I tried to go through the tutorial at angularjs.org angular -phonecat. In three stages of stetp, I get an error for end-to-end testing with a protractor. here is the error code.

Using ChromeDriver directly... Cannot read property 'matcherFn_' of undefined [launcher] Runner Process Exited With Error Code: 1 npm ERR! angular-phonecat@0.0.0 protractor: `protractor test/protractor-conf.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the angular-phonecat@0.0.0 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 on here?

+6
source share
5 answers

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

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

"minijasminenode": "<1.0.0",

  • delete the minijasminenode directory:

rm -r node_modules / protractor / node_modules / minijasminenode

  • reinstall the necessary modules:

cd node_modules / protractor && & npm install

Your e2e tests should now run. This is probably a more graceful way to achieve this.

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

+3
source

Andrew is responsible for me. Thank you, Andrey.

By the way, I also changed 'browserName': 'chrome' to 'browserName': 'firefox' since chrome is not installed in my linux window. Then it works.

+2
source

Adding firefox caused the handler tests to run in my windows 7, where, like on mac chrome, it worked fine, here is the full file test / protractor-conf.js

 exports.config = { allScriptsTimeout: 11000, specs: [ 'e2e/*.js' ], capabilities: { 'browserName': 'firefox' }, firefoxOnly: true, baseUrl: 'http://localhost:2000/', framework: 'jasmine', jasmineNodeOpts: { defaultTimeoutInterval: 30000 } }; 
0
source

I had a similar problem, no matter what solution you can find anywhere. When I started most of my projects through XAMPP, I found that my problem was due to incorrect port settings on the configuration page.

\ Test \ protractor-config.js

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

Was earlier

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

Hope this helps others too.

0
source

I tried all solutions but still got errors. Change the protractor version in the main package.json file to "~ 0.20.1" so that it reads " "protractor": "~0.20.1", and "protractor": "~0.20.1", command line, since the administrator worked for me.

After launching 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 full path to the driver itself, in my case: chromeDriver: 'F:/Documents/Angular/angular-phonecat/node_modules/protractor/selenium/chromedriver_2.9.zip'

Not sure if using an earlier version is a good idea.

0
source

Source: https://habr.com/ru/post/970830/


All Articles