mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
AAE-22865 - Fixing webdriver version used and installed (#9749)
* Fixing webdriver version used and installed * Fixing webdriver selenium version * Disabling Code flow for grant password auth * Removing the install from the script as it's done in the postinstall now * It's funny how this tests work * Having codeflow disabled by default * Checking if Core tests pass * Refreshing as SSO button is broken after clicking apply
This commit is contained in:
@@ -1,12 +1,50 @@
|
||||
#!/bin/bash
|
||||
#set -x
|
||||
BROWSER_TYPE=mac-x64
|
||||
#!/usr/bin/env bash
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
|
||||
if [ ! -z "$1" ]; then BROWSER_TYPE=$1 ; fi
|
||||
echo "Getting currently installed Chrome Version"
|
||||
|
||||
PATH_TO_COMMANDS=../../node_modules/webdriver-manager/built/lib/cmds
|
||||
PATH_TO_BINARIES=../../node_modules/webdriver-manager/built/lib/binaries
|
||||
PATH_TO_SELENIUM=../../node_modules/webdriver-manager/selenium
|
||||
if [ "$CI" = "true" ]; then
|
||||
chromeVersion=$(google-chrome --version )
|
||||
else
|
||||
chromeVersion=$(/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --version )
|
||||
fi
|
||||
|
||||
chromeVersion=${chromeVersion:14:20}
|
||||
|
||||
echo "Intalling webdriver for version: $chromeVersion"
|
||||
|
||||
function show_error() {
|
||||
echo -e "\e[31m===============================================================\e[0m"
|
||||
echo -e "\e[31mFAILED TO UPDATE WEBDRIVER-MANAGER, PLEASE DO IT MANUALLY!\e[0m"
|
||||
echo -e "\e[31mRun the following command (sometimes needs more than one kick):\e[0m"
|
||||
echo -e ""
|
||||
echo -e "\e[31mnpx webdriver-manager update --gecko=false\e[0m"
|
||||
echo -e ""
|
||||
echo -e "====== WINDOWS USERS : PLEASE RUN THIS COMMAND: "
|
||||
echo -e "npm run update-webdriver:windows"
|
||||
echo -e "====== WINDOWS USERS ADVISORY END =================="
|
||||
echo -e ""
|
||||
echo -e "\e[31m===============================================================\e[0m"
|
||||
}
|
||||
|
||||
ROOTDIR="$DIR/.."
|
||||
|
||||
if [ "$(uname)" == "Darwin" ]; then
|
||||
BROWSER_TYPE="mac-x64"
|
||||
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
|
||||
BROWSER_TYPE="linux64"
|
||||
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then
|
||||
BROWSER_TYPE="win32"
|
||||
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
|
||||
BROWSER_TYPE="win64"
|
||||
fi
|
||||
|
||||
echo "BROWSER => $BROWSER_TYPE"
|
||||
|
||||
|
||||
PATH_TO_COMMANDS=./node_modules/webdriver-manager/built/lib/cmds
|
||||
PATH_TO_BINARIES=./node_modules/webdriver-manager/built/lib/binaries
|
||||
PATH_TO_SELENIUM=./node_modules/webdriver-manager/selenium
|
||||
|
||||
# Remove existing drivers
|
||||
rm -rf $PATH_TO_SELENIUM/selenium-server-*
|
||||
@@ -14,16 +52,25 @@ rm -rf $PATH_TO_SELENIUM/chromedriver-*
|
||||
rm -f $PATH_TO_SELENIUM/chromedriver_*
|
||||
|
||||
# Replace browser type in file and create new file
|
||||
sed "s/mac-x64/$BROWSER_TYPE/" chrome_xml_schema.js > chrome_xml.js
|
||||
sed "s/mac-x64/$BROWSER_TYPE/" update_schema.js > update.js
|
||||
echo 'Replacing new webdriver files'
|
||||
sed "s/mac-x64/$BROWSER_TYPE/" $DIR/chrome_xml_schema.js > $DIR/chrome_xml.js && sed "s/mac-x64/$BROWSER_TYPE/" $DIR/update_schema.js > $DIR/update.js;
|
||||
|
||||
if [ "$?" -ne 0 ]; then
|
||||
show_error
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "============== Trying to update the files =============="
|
||||
sleep 2
|
||||
|
||||
# Replace webdriver files
|
||||
cp -f update.js $PATH_TO_COMMANDS/update.js
|
||||
cp -f chrome_xml.js $PATH_TO_BINARIES/chrome_xml.js
|
||||
echo "cp -f $DIR/update.js $PATH_TO_COMMANDS/update.js"
|
||||
cp -f $DIR/update.js $PATH_TO_COMMANDS/update.js
|
||||
cp -f $DIR/chrome_xml.js $PATH_TO_BINARIES/chrome_xml.js
|
||||
|
||||
rm -f $DIR/update.js
|
||||
rm -f $DIR/chrome_xml.js
|
||||
|
||||
node ./node_modules/webdriver-manager/bin/webdriver-manager update --gecko=false --versions.chrome=$chromeVersion
|
||||
|
||||
rm -f update.js
|
||||
rm -f chrome_xml.js
|
||||
|
||||
#$(npm bin)/webdriver-manager update --gecko=false
|
||||
node ../../node_modules/webdriver-manager/bin/webdriver-manager update --gecko=false
|
Reference in New Issue
Block a user