【问题标题】:Webdriver (wd) tests work locally but time out on Travis CI?Webdriver (wd) 测试在本地工作,但在 Travis CI 上超时?
【发布时间】:2015-03-20 22:32:26
【问题描述】:

我有一些使用 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

【问题讨论】:

  • 我的超时时间高达 30 秒,但仍然超时。我一定是错过了什么。
  • 如果我启动一个独立的 selenium 服务器,我已经让 Firefox 在本地工作。它适用于 Mac 和 Ubuntu。所以我很困惑为什么它不能在 TravisCI 上工作:-(

标签: node.js selenium webdriver mocha.js


【解决方案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

【讨论】:

    猜你喜欢
    • 2019-07-24
    • 1970-01-01
    • 1970-01-01
    • 2017-01-31
    • 1970-01-01
    • 1970-01-01
    • 2023-03-19
    • 2017-07-31
    • 1970-01-01
    相关资源
    最近更新 更多