From 430d8e0e26eb4b8f5d05b28764c1687db9a16d9c Mon Sep 17 00:00:00 2001 From: Aref Shafaei Date: Sun, 17 Sep 2023 15:40:33 -0700 Subject: [PATCH] bring back chrome install + set protractor chrome location --- .github/workflows/e2e.yml | 6 ++++-- test/e2e/utils/protractor.configuration.js | 10 ++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index ce668485c..7a2c770f9 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -40,8 +40,6 @@ jobs: export TZ=America/Los_Angeles export PATH="$(systemd-path user-binaries):$PATH" sudo apt-get -y update - sudo apt-get --only-upgrade install google-chrome-stable - chrome --version sudo apt-get -y install libcurl4-openssl-dev libjson-c-dev sudo service postgresql stop || true sudo service postgresql start 12 @@ -67,6 +65,10 @@ jobs: uses: actions/setup-java@v1 with: java-version: 1.8 + - name: Install latest chrome + uses: browser-actions/setup-chrome@v1 + with: + chrome-version: stable - name: Install webauthn run: | sudo useradd -m -r webauthn diff --git a/test/e2e/utils/protractor.configuration.js b/test/e2e/utils/protractor.configuration.js index 8aa6491e5..ce662e4e4 100644 --- a/test/e2e/utils/protractor.configuration.js +++ b/test/e2e/utils/protractor.configuration.js @@ -1,3 +1,5 @@ +const execSync = require('child_process').execSync; + exports.getConfig = function(options) { var config = { framework: 'jasmine2', @@ -76,6 +78,12 @@ exports.getConfig = function(options) { if (process.env.HEADLESS == "true") { config.capabilities.chromeOptions.args.push('--headless=new'); config.capabilities.chromeOptions.args.push('--disable-gpu'); + + if (process.env.CI) { + const chormeBinary = execSync('which chrome').toString().trim(); + console.log(`chrome binary location is ${chormeBinary}`); + config.capabilities.chromeOptions.binary = chormeBinary; + } } } @@ -130,7 +138,6 @@ exports.getConfig = function(options) { } } - var execSync = require('child_process').execSync; var remoteChaiseDirPath = process.env.REMOTE_CHAISE_DIR_PATH; var cmd = 'sudo cp ' + chaiseFilePath + " " + ("/var/www/html/chaise/chaise-config.js"); @@ -144,7 +151,6 @@ exports.getConfig = function(options) { var code = execSync(cmd); - console.log(code); if (code == 0) console.log("Copied file " + chaiseFilePath + " successfully to chaise-config.js \n"); else { console.log("Unable to copy file " + chaiseFilePath + " to chaise-config.js \n");