From ac6ae09a059d81a7e9e20e62bb2d12f921a4ebcf Mon Sep 17 00:00:00 2001 From: Risto Lahtela Date: Thu, 27 Dec 2018 21:06:10 +0200 Subject: [PATCH] Ci selenium fix (#863) * Added --no-sandbox argument to chrome on travis * Added xvfb screen display settings * Updated chromedriver version --- Plan/common/src/test/java/rules/SeleniumDriver.java | 1 + scripts/prepareTestEnv.sh | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Plan/common/src/test/java/rules/SeleniumDriver.java b/Plan/common/src/test/java/rules/SeleniumDriver.java index aef2d5f89..ee5454285 100644 --- a/Plan/common/src/test/java/rules/SeleniumDriver.java +++ b/Plan/common/src/test/java/rules/SeleniumDriver.java @@ -51,6 +51,7 @@ public class SeleniumDriver extends ExternalResource { ChromeOptions chromeOptions = new ChromeOptions(); chromeOptions.setBinary("/usr/bin/google-chrome-stable"); chromeOptions.setHeadless(true); + chromeOptions.addArguments("--no-sandbox"); chromeOptions.setCapability(SUPPORTS_JAVASCRIPT, true); return new ChromeDriver(chromeOptions); diff --git a/scripts/prepareTestEnv.sh b/scripts/prepareTestEnv.sh index c135dd188..797063890 100644 --- a/scripts/prepareTestEnv.sh +++ b/scripts/prepareTestEnv.sh @@ -1,5 +1,10 @@ +# Start Xvfb screen +export DISPLAY=:99.0 +sh -e /etc/init.d/xvfb start +/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 chromedriver -wget -N http://chromedriver.storage.googleapis.com/2.30/chromedriver_linux64.zip -P ~/ +wget -N https://chromedriver.storage.googleapis.com/2.45/chromedriver_linux64.zip -P ~/ unzip ~/chromedriver_linux64.zip -d ~/ rm ~/chromedriver_linux64.zip sudo chmod -R u=rwx,g=rwx /usr/bin/google-chrome-stable