From 027bcefbd484d0b7da0e3e4091e4ad0ce5405934 Mon Sep 17 00:00:00 2001 From: astebenkova Date: Thu, 20 Jul 2023 12:34:26 +0300 Subject: [PATCH] [chromedriver] Fix package installation This commit alllows us to switch to JSON endpoints for chromedriver since upstream changed the way of installation for version 115 or newer: https://chromedriver.chromium.org/downloads#h.p_ID_32 https://github.com/GoogleChromeLabs/chrome-for-testing#json-api-endpoints Change-Id: I4a432ec36fe9e3f794cc6b7788bbdc04db3c8cf6 --- roles/deploy-selenium/tasks/main.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/roles/deploy-selenium/tasks/main.yaml b/roles/deploy-selenium/tasks/main.yaml index 462bbee2b..313596256 100644 --- a/roles/deploy-selenium/tasks/main.yaml +++ b/roles/deploy-selenium/tasks/main.yaml @@ -25,6 +25,7 @@ - unzip - wget - xvfb + - jq - name: Install selenium pip: @@ -55,8 +56,8 @@ shell: |- set -ex CHROME_VERSION=$(dpkg -s google-chrome-stable | grep -Po '(?<=^Version: ).*' | awk -F'.' '{print $1"."$2"."$3}') - DRIVER_PATH=$(wget -qO- https://chromedriver.storage.googleapis.com | grep -Po "(?<=)${CHROME_VERSION}[^<]*?chromedriver_linux64\.zip(?=)" | tail -1) - wget -O /tmp/chromedriver.zip "https://chromedriver.storage.googleapis.com/${DRIVER_PATH}" + DRIVER_URL=$(wget -qO- https://googlechromelabs.github.io/chrome-for-testing/last-known-good-versions-with-downloads.json | jq -r --arg chrome_version "$CHROME_VERSION" '.channels.Stable.downloads.chrome[] | select(.platform=="linux64" and (.url | test($chrome_version))).url') + wget -O /tmp/chromedriver.zip ${DRIVER_URL} args: executable: /bin/bash