Skip to content

Commit

Permalink
fix: chromedriver endpoint change (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanbourdais authored Jul 18, 2023
1 parent e3202fe commit de5fa4e
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 20 deletions.
2 changes: 1 addition & 1 deletion .circleci/test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ workflows:
- int-test-all:
name: test-specific-version-all
executor: cimg-base
chrome-version: "92.0.4515.131"
chrome-version: "114.0.5735.90"
firefox-version: "90.0.1"
filters: *filters
- int-test-all:
Expand Down
6 changes: 3 additions & 3 deletions src/scripts/install-chrome.sh
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ else
if [[ "$ORB_PARAM_CHROME_VERSION" == "latest" ]]; then
ENV_IS_ARM=$(! dpkg --print-architecture | grep -q arm; echo $?)
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | $SUDO apt-key add -
if [ "$ENV_IS_ARM" == "1" ]; then
echo "Google Chrome is not supported on ARM64 architecture."
exit 1
if [ "$ENV_IS_ARM" == "arm" ]; then
echo "Installing Chrome for ARM64"
$SUDO sh -c 'echo "deb [arch=arm64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
else
echo "Installing Chrome for AMD64"
$SUDO sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
Expand Down
62 changes: 46 additions & 16 deletions src/scripts/install-chromedriver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ if [[ $CHROME_RELEASE -lt 70 ]]; then
exit 1
;;
esac
else
CHROMEDRIVER_VERSION=$(curl --silent --show-error --location --fail --retry 3 \
"https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROMEDRIVER_RELEASE")
elif [[ $CHROME_RELEASE -lt 115 ]]; then
CHROMEDRIVER_VERSION=$(curl --silent --show-error --location --fail --retry 3 \
"https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROMEDRIVER_RELEASE")
fi

# installation check
Expand All @@ -141,12 +141,34 @@ if command -v chromedriver >/dev/null 2>&1; then
fi
fi

echo "ChromeDriver $CHROMEDRIVER_VERSION will be installed"

# download chromedriver
curl --silent --show-error --location --fail --retry 3 \
--output chromedriver_$PLATFORM.zip \
"http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_$PLATFORM.zip"

if [[ $CHROME_RELEASE -lt 115 ]]; then
echo "ChromeDriver $CHROMEDRIVER_VERSION will be installed"
curl --silent --show-error --location --fail --retry 3 \
--output chromedriver_$PLATFORM.zip \
"http://chromedriver.storage.googleapis.com/$CHROMEDRIVER_VERSION/chromedriver_$PLATFORM.zip"
else
# shellcheck disable=SC2001
CHROMEDRIVER_VERSION=$(echo $CHROME_VERSION | sed 's/[^0-9.]//g')
echo "$CHROMEDRIVER_VERSION will be installed"
if [[ $PLATFORM == "linux64" ]]; then
PLATFORM="linux64"
curl --silent --show-error --location --fail --retry 3 \
--output chromedriver_$PLATFORM.zip \
"https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/$CHROMEDRIVER_VERSION/linux64/chromedriver-linux64.zip"
elif [[ $PLATFORM == "mac64" ]]; then
PLATFORM="mac-x64"
curl --silent --show-error --location --fail --retry 3 \
--output chromedriver_$PLATFORM.zip \
"https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/$CHROMEDRIVER_VERSION/mac-x64/chromedriver-mac-x64.zip"
else
PLATFORM="win64"
curl --silent --show-error --location --fail --retry 3 \
--output chromedriver_$PLATFORM.zip \
"https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/$CHROMEDRIVER_VERSION/win64/chromedriver-win64.zip"
fi
fi

# setup chromedriver installation
if command -v yum >/dev/null 2>&1; then
Expand All @@ -156,15 +178,23 @@ fi
unzip "chromedriver_$PLATFORM.zip" >/dev/null 2>&1
rm -rf "chromedriver_$PLATFORM.zip"

if [[ $CHROME_RELEASE -gt 114 ]]; then
mv "chromedriver-$PLATFORM" chromedriver
fi

$SUDO mv chromedriver "$ORB_PARAM_DRIVER_INSTALL_DIR"
$SUDO chmod +x "$ORB_PARAM_DRIVER_INSTALL_DIR/chromedriver"
export PATH="/usr/local/bin/chromedriver:$PATH"
# # shellcheck disable=SC1090
# source ~/.bashrc

# test/verify version
if chromedriver --version | grep "$CHROMEDRIVER_VERSION" >/dev/null 2>&1; then
echo "$(chromedriver --version) has been installed to $(command -v chromedriver)"
readonly base_dir="${CIRCLE_WORKING_DIRECTORY/\~/$HOME}"
rm -f "${base_dir}/LICENSE.chromedriver"
else
echo "Something went wrong; ChromeDriver could not be installed"
exit 1
fi
if chromedriver --version | grep "$CHROMEDRIVER_VERSION" >/dev/null 2>&1; then
echo "$(chromedriver --version) has been installed to $(command -v chromedriver)"
readonly base_dir="${CIRCLE_WORKING_DIRECTORY/\~/$HOME}"
rm -f "${base_dir}/LICENSE.chromedriver"
else
echo "Something went wrong; ChromeDriver could not be installed"
exit 1
fi
# fi

0 comments on commit de5fa4e

Please sign in to comment.