tests: Use the latest version of geckodriver

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Joseph Nuthalapati 2020-01-29 05:39:42 +05:30 committed by Sunil Mohan Adapa
parent 932d2e17f9
commit 9769f48b89
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2

View File

@ -13,11 +13,14 @@ pip3 install splinter pytest-splinter pytest-bdd pytest-xvfb
echo "Installing geckodriver"
(
DL_DIR=/tmp/gecko
GECKO_VERSION="v0.26.0"
GECKO_VERSION=$(curl --silent "https://api.github.com/repos/mozilla/geckodriver/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")')
FILENAME="geckodriver-${GECKO_VERSION}-linux64.tar.gz"
GECKO_URL="https://github.com/mozilla/geckodriver/releases/download/$GECKO_VERSION/$FILENAME"
test -e /usr/local/bin/geckodriver && echo "geckodriver already installed" && exit 0
test -e /usr/local/bin/geckodriver && \
test "$GECKO_VERSION" = "v$(geckodriver --version | head -1 | awk '{ print $2 }')" && \
echo "geckodriver already installed" && \
exit 0
mkdir -p $DL_DIR
cd $DL_DIR