#!/bin/bash -ex

source run_qfq_docker.output

# download chromedriver
if [ ! -f chromedriver ]; then
    wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`/chromedriver_linux64.zip
    unzip /tmp/chromedriver.zip chromedriver
    chmod +x chromedriver
fi
export CHROMEDRIVER_PATH="${PWD}/chromedriver"

# run tests
cd ../extension/Tests/selenium
export SELENIUM_URL="http://127.0.0.1:${T3_PORT}"
export SELENIUM_HEADLESS="no"
python -m unittest discover