Travis-CI上的Chromedriver [英] Chromedriver on Travis-CI
问题描述
我在让Travis-CI上的chromedriver用于我的项目时遇到问题 knockout-secure-binding .至少,我正在尝试使用WebdriverJS自动化Chrome浏览器的测试.
我注意到 chromedriver似乎存在一些问题Travis-CI,包括:
- http://github.com/travis-ci/travis-ci/Issues/938
- http://github.com/travis-ci/travis-ci/Issues/272
- https://code.google.com/p/chromedriver/issues/detail?id = 308
该问题似乎是无法访问的Chrome"的一种变体,从我的了解来看,它需要Google进行上游干预才能解决.
错误的详细信息是可通过Travis构建日志获得. /p>
尽管有一种评论提到使用--no-sandbox
,但尚无解决方法,但尚不清楚在WebdriverJS中的何处或如何使用它.
任何对此的想法将由衷地感谢.
-编辑-
出于兴趣的考虑,我使用的是 Sauce Labs 代替Chromedriver.
有一种在Travis CI上启动Chrome的简便方法,只需在addons/apt/sources中指定google-chrome,在addons/apt/中指定google-chrome-package包.
这是我的示例配置,可以使您更好地理解:
sudo: required
dist: trusty
addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
language: node_js
node_js:
- "6"
cache:
directories: node_modules
branches:
only: master
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- npm i -g npm@^3
- sleep 3
I am having trouble getting chromedriver on Travis-CI working for my project knockout-secure-binding. I am trying to use WebdriverJS to automate testing with Chrome, at the least.
I noted that there seems to be some issues with chromedriver on Travis-CI, including:
- http://github.com/travis-ci/travis-ci/issues/938
- http://github.com/travis-ci/travis-ci/issues/272
- https://code.google.com/p/chromedriver/issues/detail?id=308
The issue seems to be a variant of "chrome not reachable", and from what I can gather it requires an upstream engagement by Google to fix it.
The details of the error are available through the Travis build log.
No workaround is apparent, though one comment mentioned using --no-sandbox
, but it is not clear where or how one would employ this in WebdriverJS.
Any thoughts on this would be sincerely appreciated.
—— Edit ——
As a matter of interest I am using Sauce Labs in lieu of Chromedriver.
There's an easier way to launch Chrome on Travis CI, simply specify google-chrome in addons/apt/sources and google-chrome-package in addons/apt/packages.
Here's my sample config for a better understanding:
sudo: required
dist: trusty
addons:
apt:
sources:
- google-chrome
packages:
- google-chrome-stable
language: node_js
node_js:
- "6"
cache:
directories: node_modules
branches:
only: master
before_script:
- export DISPLAY=:99.0
- sh -e /etc/init.d/xvfb start
- npm i -g npm@^3
- sleep 3
这篇关于Travis-CI上的Chromedriver的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!