问题描述
我的工作由自耕农生成的样品角项目。结果
我能够在本地运行业力测试(我设定的系统变量 CHROME_BIN
指向铬二进制的,但是这可能在更优雅的方式,只是一个快速的解决方法已经完成。)
I'm working on a sample Angular project generated by yeoman.
I am able to run karma tests locally (I set system variable CHROME_BIN
to point to chromium binary, but this could have been done in more elegant way. Just a quick work-around.)
但是,试图产生一个成功的构建与特拉维斯的时候,我得到以下错误:
However, when attempting to produce a successful build with travis, I get following error:
ERROR [launcher]: Cannot start Chrome
Can not find the binary google-chrome
Please set env variable CHROME_BIN
我已经按照这里步骤所述 - 得到了另一个错误:结果 /home/travis/build.sh:行142:./.travis/scripts/install_chrome.sh:权限被拒绝
I've followed the steps described here (basically using generator-travis-ci
)
Then tried to fix it with this - got another error:/home/travis/build.sh: line 142: ./.travis/scripts/install_chrome.sh: Permission denied
结果
这是一个与约曼创建了一个标准的角应用程序 - 事情应该工作的开箱,而现实情况是不同的...结果
有没有人成功配置呢?
It's a standard angular app created with Yeoman - things should work out of the box, whereas reality is different ...
Has anybody successfully configured it?
我一直在使用的软件版本:
Software versions I've been using:
user@machine:~/somewhere $ yo -v; grunt --version; bower -v
1.0.4
grunt-cli v0.1.9
grunt v0.4.1
1.2.6
我特拉维斯的工作:https://travis-ci.org/vucalur/editor-yeoman-test
推荐答案
我不敢说,你可以只使用Firefox(因为它已经安装在VM)和PhantomJS(因为它的便携和无头)。
I'm afraid to say that you can only run Firefox (because it's already installed in the VM) and PhantomJS (because it's portable and headless).
添加以下到您的 .travis.yml
文件来启动Firefox的:
Add the following into your .travis.yml
file to startup Firefox:
before_install:
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
那你只好让Firefox浏览器在你的configs噶浏览器。
Then you'll just have to enable Firefox as a Karma browser in your configs.
这篇关于如何使特拉维斯在Chrome执行角测试(QUOT;请设置环境变量CHROME_BIN")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!