Webdriver(wd)测试在本地工作但在Travis CI上超时?

时间:2015-03-20 22:32:27

标签: node.js selenium webdriver mocha

我有一些用gulp-mocha-selenium编写的测试,它使用了引擎盖下的wd。重要的是要注意它是' wd'司机不是香草Webdriver。

测试在这里: https://github.com/UWFosterIT/react-starter/blob/master/test/acceptance/hello-spec.js

我的travis.yml是:

language: node_js
node_js:
  - "0.10.37"
before_install:
  - "export DISPLAY=:99.0"
  - "sh -e /etc/init.d/xvfb start"
  - "npm install -g eslint gulp eslint-plugin-react webpack"
before_script:
  - "sleep 30"
script:
  - "gulp check"
  - "gulp test:server"
  - "gulp test:acceptance"
addons:
  firefox: "31"

测试在本地工作正常,但在TravisCI.org上暂停。我不知道从哪里开始寻找。

特拉维斯结果:https://travis-ci.org/UWFosterIT/react-starter/builds/55222925

1 个答案:

答案 0 :(得分:1)

事实证明我需要在TravisCI上下载并启动Selenium

before_script:
  - "wget http://selenium-release.storage.googleapis.com/2.53/selenium-server-standalone-2.53.0.jar"
  - "java -jar selenium-server-standalone-2.53.0.jar > /dev/null &"
  - sleep 3