我目前正在开发一个使用Flask的Web应用程序,并且需要在其中一个测试中使用PhantomJS。我使用GitLab作为远程git存储库,并使用GitLab CI作为CI工具。GitLab CI无法安装/使用PhantomJS
不幸的是,我似乎不能得到GitLab CI的共享亚军安装和运行PhantomJS。它的输出:
Failed PhantomJS Run Screenshot
一个片段从我.gitlab-ci.yml
:
image: python:2.7.11
before_script:
- ...
- mkdir ~/tmp
- pushd ~/tmp
- wget https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2
- tar xf $PHANTOM_JS.tar.bz2
- mv $PHANTOM_JS phantomjs
- ln -s ~/tmp/phantomjs/bin/phantomjs /usr/bin/phantomjs
- phantomjs --version
- popd
- ...
$Phantom_JS
指PhantomJS的特定版本。
有谁知道解决方案?或者是否有其他方法来安装和运行PhantomJS?
谢谢。
sudo npm install -g phantomjs-prebuilt < - 将下载并安装正确系统的最新二进制文件。 – larsemil