angularjs - 尝试在 angular js 教程的第 3 步中运行 Protractor

标签 angularjs protractor

我无法使用 Protractor 运行 e2e 测试

当我尝试从 https://docs.angularjs.org/tutorial 运行 angular phonecat 应用程序代码时

它显示此错误

Starting selenium standalone server... 
[launcher] Running 1 instances of  WebDriver [launcher] Process exited with error code 1 
events.js:85      
throw er; // Unhandled 'error' event            
^ Error: spawn java ENOENT     
at exports._errnoException (util.js:746:11)    
at Process.ChildProcess._handle.onexit (child_process.js:1053:32)     
at child_process.js:1144:20   
at process._tickCallback (node.js:355:11)  
npm ERR! Windows_NT 6.3.9600 
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\no un" "protractor"     
npm ERR! node v0.12.7 
npm ERR! 
npm  v2.11.3 
npm ERR! code ELIFECYCLE 
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 'protractor test/pro 
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! Please include the following file with any support request: 
npm ERR!     C:\Users\xxxxx\Documents\GitHub\angular-phonecat\npm-debug.log

最佳答案

您安装了 chrome 和 chrome 驱动程序?

尝试这个:

在 'protractor-conf.js' 中删除 'chromeOnly: true,' 并放置 'directConnect: true,'。

你可以在 angular_phonecat\test 中找到它

关于angularjs - 尝试在 angular js 教程的第 3 步中运行 Protractor ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31732904/

相关文章:

javascript - 如何重构controllers.js,以便将每个 Controller 放在单独的文件中?

javascript - 使用两个文本框用于 AngularJS 中的正方形的简单计算器?

javascript - Protractor : how to compare the text content of the same web element before and after clicking on a button

angularjs - 如何在 Protractor 中使用多个上传按钮上传多个文件?

javascript - 当上面的 it block 失败时如何不执行 it block

javascript - 如何调用规范中的函数 - Protractor

javascript - 使用 WebApi 时处理 AngularJS 中的错误

Javascript:无论滚动如何,查找div相对于视口(viewport)的位置

javascript - Angular JS/文章未定义

javascript - 在 expect() 断言失败时打印消息