特拉維斯
Travis 是最初的持續整合服務,在 Meteor 社群中很受歡迎。它堅固可靠,長期以來一直擁有開源託管層,並且多年來已經執行了數十萬個 Nightwatch 測試。
.travis.yml
只需將 .travis.yml
檔案放在應用程式的根目錄中,如下所示:
# this travis.yml file is for the leaderboard-nightwatch example, when run standalone
language: node_js
node_js:
- "0.10.38"
services:
- mongodb
sudo: required
env:
global:
- TRAVIS=true
- CONFIG_PREFIX=`npm config get prefix`
- DISPLAY=:99.0
- NODE_ENV=`travis`
matrix:
cache:
directories:
- .meteor/local/build/programs/server/assets/packages
- .meteor
before_install:
# set up the node_modules dir, so we know where it is
- "mkdir -p node_modules &"
# install nightwatch, selenium, , so we can launch nightwatch and selenium
- "meteor npm install nightwatch selenium-server-standalone-jar chromedriver"
# fire up xvfb on port :99.0
- "sh -e /etc/init.d/xvfb start"
# set the xvfb screen size to 1280x1024x16
- "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16"
# install meteor
- "curl https://install.meteor.com | /bin/sh"
# give meteor a few seconds after installing
- "sleep 10"
# setup Meteor app
- "cd webapp"
- "meteor &"
# give Meteor some time to download packages, init data, and to start
- "sleep 60"
# then run nightwatch using the chromedriver
script: "nightwatch -c .meteor/nightwatch.json"