From 5020dcf4c4d95868f6e61f16f68f95d5b97d9db1 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Mon, 22 Jun 2015 11:24:15 +1200 Subject: [PATCH] refs #8143 install phantomjs2.0 for UI tests --- .travis.yml | 3 +++ plugins/TestRunner/templates/travis.yml.twig | 3 +++ tests/lib/screenshot-testing/run-tests.js | 2 ++ tests/travis/install_phantomjs_2.0.sh | 8 ++++++++ 4 files changed, 16 insertions(+) create mode 100755 tests/travis/install_phantomjs_2.0.sh diff --git a/.travis.yml b/.travis.yml index 23736aab052..b6f56dc686b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -133,6 +133,9 @@ before_script: # Make sure we use Python 2.6 - ./tests/travis/install_python_2.6.sh + - ./tests/travis/install_phantomjs_2.0.sh + - export PATH=$PWD/travis-phantomjs:$PATH > /dev/null + # - PATH cannot be updated in a subprocess, it would be ignored - ./tests/travis/prepare.sh - ./tests/travis/setup_webserver.sh diff --git a/plugins/TestRunner/templates/travis.yml.twig b/plugins/TestRunner/templates/travis.yml.twig index c92dbb3b9a3..7bbe9cb51da 100644 --- a/plugins/TestRunner/templates/travis.yml.twig +++ b/plugins/TestRunner/templates/travis.yml.twig @@ -161,6 +161,9 @@ before_script: # Make sure we use Python 2.6 - ./tests/travis/install_python_2.6.sh + - ./tests/travis/install_phantomjs_2.0.sh + - export PATH=$PWD/travis-phantomjs:$PATH > /dev/null + # - PATH cannot be updated in a subprocess, it would be ignored - ./tests/travis/prepare.sh - ./tests/travis/setup_webserver.sh diff --git a/tests/lib/screenshot-testing/run-tests.js b/tests/lib/screenshot-testing/run-tests.js index 4eb6247ca07..5320ac2ae1e 100644 --- a/tests/lib/screenshot-testing/run-tests.js +++ b/tests/lib/screenshot-testing/run-tests.js @@ -28,6 +28,8 @@ if (config.phpServer.REQUEST_URI.slice(-1) != '/') { config.phpServer.REQUEST_URI += '/'; } +console.log('PhantomJS version: ' + phantom.version.major + '.' + phantom.version.minor + '.' + phantom.version.patch); + require('./support/fs-extras'); phantom.injectJs('./support/globals.js'); diff --git a/tests/travis/install_phantomjs_2.0.sh b/tests/travis/install_phantomjs_2.0.sh new file mode 100755 index 00000000000..29165cac810 --- /dev/null +++ b/tests/travis/install_phantomjs_2.0.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +if [ "$TEST_SUITE" = "UITests" ]; +then + # See https://github.com/travis-ci/travis-ci/issues/3225 + mkdir travis-phantomjs > /dev/null + wget https://s3.amazonaws.com/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -O $PWD/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 > /dev/null + tar -xvf $PWD/travis-phantomjs/phantomjs-2.0.0-ubuntu-12.04.tar.bz2 -C $PWD/travis-phantomjs > /dev/null +fi