java - 运行平均种子时 jasmine_node 失败

标签 java node.js selenium yeoman-generator jasmine-node

运行由 yeoman 生成器生成的名为mean-seed 的项目时遇到问题。我已经花了几天时间修补它并尝试了一些事情。我遇到问题的地方是运行“jasmine_node”任务:

Running "jasmine_node" task
>> Error: Unable to access jarfile node_modules/protractor/selenium/selenium-server-standalone-2.39.0.jar
Warning: Done, with errors. Use --force to continue.

Aborted due to warnings.

所以我首先尝试识别缺少的 npm 软件包来安装

  744  npm install && bower update && bower install
  755  npm install protractor
  760  npm install npm install selenium-standalone
  761  npm install -g protractor
  765  npm install protractor-tester
  767  npm install protractor-selenium-server-vagrant
  768  npm install selenium-standalone@2.39.0-2.8.0-2

这些实际上都没有在 node_modules 目录中创建文件 selenium-server-standalone-2.39.0.jar 。我运行了一个 find 来检查,但是安装了其他几个 jar。

$ find . -name "*.jar" -print
./node_modules/grunt-jasmine-node-coverage-validation/node_modules/jasmine-node/node_modules/jasmine-reporters/ext/jline.jar
./node_modules/grunt-jasmine-node-coverage-validation/node_modules/jasmine-node/node_modules/jasmine-reporters/ext/js.jar
./node_modules/selenium-standalone/.selenium/2.39.0/server.jar

我找到了 selenium 服务器下载,因此我尝试下载并将其复制到我必须创建的引用目录中 https://code.google.com/p/selenium/downloads/detail?name=selenium-server-standalone-2.39.0.jar

我再次运行 grunt。它遍历任务然后运行 ​​jasmine_node 任务

Running "jasmine_node" task
TEST configFile: /Users/jgs/Projects/mean/app/test/../configs/config.test.json
configFile: ./app/configs/config.test.json
   info  - socket.io started
waiting for server to be running..
[success] connected to db at localhost:27017/test_temp
>> Feb 01, 2014 3:03:54 PM org.openqa.grid.selenium.GridLauncher main
>> INFO: Launching a standalone server
>> Setting system property webdriver.chrome.driver to node_modules/protractor/selenium/chromedriver

------------------
[ERROR]
Run `node run.js config=test`
Server not connected. Ensure you have a node server running with the `config=test` command line option so this server connects to the TEST database - the same one used here for the tests. Do NOT connect to the live database for doing tests!
------------------

[success] connected to db at localhost:27017/test_temp

all tests - 2526 ms
    should test everything - 2525 ms

Failures:

  1) all tests should test everything
   Message:
     Expected 'ERROR - check the logs above to fix the problem then try again' to be false.
   Stacktrace:
     Error: Expected 'ERROR - check the logs above to fix the problem then try again' to be false.
    at /Users/jgs/Projects/mean/app/test/all.spec.js:6:2935
    at _rejected (/Users/jgs/Projects/mean/node_modules/q/q.js:808:24)
    at /Users/jgs/Projects/mean/node_modules/q/q.js:834:30
    at Promise.when (/Users/jgs/Projects/mean/node_modules/q/q.js:1079:31)
    at Promise.promise.promiseDispatch (/Users/jgs/Projects/mean/node_modules/q/q.js:752:41)
    at /Users/jgs/Projects/mean/node_modules/q/q.js:574:44
    at flush (/Users/jgs/Projects/mean/node_modules/q/q.js:108:17)
    at process._tickCallback (node.js:415:13)

Finished in 2.53 seconds
1 test, 1 assertion, 1 failure, 0 skipped


Warning: Task "jasmine_node" failed. Use --force to continue.

Aborted due to warnings.
$ 

知道为什么 Jasmine 任务仍然失败吗?

最佳答案

运行./node_modules/protractor/bin/webdriver-manager update,请参阅此处了解更多信息: https://github.com/jackrabbitsgroup/generator-mean-seed/issues/5

我还没有更新 protractor 升级的所有文档,对此感到抱歉!

关于java - 运行平均种子时 jasmine_node 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21503019/

相关文章:

java - 如何使用 SWT 访问网络摄像头

java - JAVA中特殊字符之间的匹配字符串

java - Eclipse 文本编辑器拖放鼠标单击组合键

javascript - 向 Node 提交 JSON 字符串时防止格式化

javascript - Node.js Oracle DB 日期返回错误值

javascript - 如何在selenium中控制滚动到底部的速度

java - 如何修复 ArrayIndexOutOfBoundsException

arrays - Mongodb Node.js 组织数组结果

Python selenium 等待页面无条件加载

java - Selenium 测试在 headless 模式下失败