@@ -14,6 +14,36 @@ update_dev_packages() {
1414 pip install --upgrade -r "$BASE_DIR/requirements-dev.txt"
1515}
1616
17+check_geckodriver() {
18+ echo '[!] Checking geckodriver'
19+ set -e
20+ geckodriver -V 2>1 > /dev/null || NOTFOUND=1
21+ set +e
22+ if [ -z $NOTFOUND ]; then
23+ return
24+ fi
25+ GECKODRIVER_VERSION="v0.11.1"
26+ PLATFORM=`python -c "import platform; print platform.system().lower(), platform.architecture()[0]"`
27+ case $PLATFORM in
28+ "linux 32bit" | "linux2 32bit") ARCH="linux32";;
29+ "linux 64bit" | "linux2 64bit") ARCH="linux64";;
30+ "windows 32 bit") ARCH="win32";;
31+ "windows 64 bit") ARCH="win64";;
32+ "mac 64bit") ARCH="macos";;
33+ esac
34+ GECKODRIVER_URL="https://github.com/mozilla/geckodriver/releases/download/$GECKODRIVER_VERSION/geckodriver-$GECKODRIVER_VERSION-$ARCH.tar.gz";
35+ if [ -z "$VIRTUAL_ENV" ]; then
36+ echo "geckodriver can't be installed because VIRTUAL_ENV is not set, you should download it from\n $GECKODRIVER_URL"
37+ exit
38+ else
39+ echo "Installing $VIRTUAL_ENV from\n $GECKODRIVER_URL"
40+ FILE=`mktemp`
41+ wget "$GECKODRIVER_URL" -qO $FILE && tar xz -C $VIRTUAL_ENV/bin/ -f $FILE geckodriver
42+ rm $FILE
43+ chmod 777 $VIRTUAL_ENV/bin/geckodriver
44+ fi
45+}
46+
1747pep8_check() {
1848 echo '[!] Running pep8 check'
1949 # ignored rules:
@@ -43,6 +73,7 @@ tests() {
4373 set -e
4474 pep8_check
4575 unit_tests
76+ check_geckodriver
4677 robot_tests
4778 set +e
4879}
@@ -88,6 +119,7 @@ Commands
88119 unit_tests - Run unit tests
89120 update_dev_packages - Check & update development and production dependency changes
90121 update_packages - Check & update dependency changes
122+ check_geckodriver - Check & download geckodriver (required for robot_tests)
91123"
92124}
93125