From 36c068569d5a1ca029d085122faa16a5850f552e Mon Sep 17 00:00:00 2001 From: Theodor Vararu Date: Mon, 15 May 2017 11:23:12 +0100 Subject: [PATCH] Run integration tests on Travis if no SAUCE_ENABLED This should allow us to do integration testing on PRs from forks. See: - https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-xvfb-to-Run-Tests-That-Require-a-GUI - https://github.com/dwyl/learn-nightwatch/issues/8 --- .travis.yml | 12 ++++++++++++ CONTRIBUTING.md | 2 +- test/wdio.config.js | 4 ++-- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index a11a208b..c5272d1a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,18 @@ language: node_js +sudo: required +dist: trusty node_js: - stable +before_install: + - export CHROME_BIN=/usr/bin/google-chrome + - export DISPLAY=:99.0 + - sh -e /etc/init.d/xvfb start + - sudo apt-get update + - sudo apt-get install -y libappindicator1 fonts-liberation + - wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb + - sudo dpkg -i google-chrome*.deb +before_script: + - jdk_switcher use oraclejdk8 addons: sauce_connect: true env: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7ee13af8..fd1c08e0 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,7 +23,7 @@ To run the functional tests in dev mode (automatically reruns when a file change npm run karma:dev ``` -To run the integration tests locally with Chrome and FireFox (specified in [wdio.config.js](test/wdio.config.js)): +To run the integration tests locally with Chrome (specified in [wdio.config.js](test/wdio.config.js)): ```bash npm run wdio diff --git a/test/wdio.config.js b/test/wdio.config.js index 763aa14c..f70250f7 100644 --- a/test/wdio.config.js +++ b/test/wdio.config.js @@ -50,8 +50,8 @@ const sauceConfig = sauceEnabled exports.config = Object.assign({ specs: ['./test/integration/**/*.js'], capabilities: [ - { browserName: 'chrome' }, - { browserName: 'firefox' } + // { browserName: 'firefox' }, + { browserName: 'chrome' } ], baseUrl: 'http://localhost:' + staticServerPort, screenshotPath: './screenshots/',