Ci selenium fix (#863)

* Added --no-sandbox argument to chrome on travis
* Added xvfb screen display settings
* Updated chromedriver version
This commit is contained in:
Risto Lahtela 2018-12-27 21:06:10 +02:00 committed by GitHub
parent 94e62cb63c
commit ac6ae09a05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -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);

View File

@ -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