Tested on Ubuntu 16.04 with Docker version 18.09.2
Other Documentation
More documentation and docker tips are located in:
Build Images
-
Clone the docker image repository:
git clone https://systemvcs.math.uzh.ch/megger/qfq_docker.git
-
Build images as explained in the README.md of the image repository. For the below scripts to work please name the images
python-selenium
andtypo3-qfq
respectively.
Run and Interact with Containers
Run qfq in docker container from scratch
-
clone qfq git project
git clone https://git.math.uzh.ch/typo3/qfq
-
change to project directory (qfq)
-
make bootstrap
-
cd docker
-
./run_qfq_docker.sh
-
open the newly generated file run_qfq_docker.output and copy the value of T3_PORT. In a browser go to 127.0.0.1:<T3_PORT>.
Deploy qfq extension changes to running container
Assumes you have run qfq in docker as explained above.
- change to docker directory
./deploy_to_container.sh
Dump QFQ and (truncated) Typo3 databases to docker directory
Assumes you have run qfq in docker as explained above.
- again from the docker directory run
./dump_databases.sh
(this will overwrite the db_fixtrue_*.sql files)
Run Phpmyadmin
ATTENTION: Use Firefox if Phpmyadmin login does not work in Chrome!
Assumes you have run qfq in docker as explained above.
- change to docker directory and run
./run_phpmyadmin.sh
- open the file run_qfq_docker.output and copy the value of PMA_PORT. In a browser (Firefox) go to 127.0.0.1:<PMA_PORT>.
Run selenium tests on local machine (with visible browser)
Assumes you have run qfq in docker as explained above.
- Install selenium for python:
python3 -m pip install --user selenium
- again from the docker directory run
./run_selenium_tests_local.sh
Run a single selenium test file on local machine
Assumes you have run qfq in docker as explained above.
- copy T3_PORT from docker/run_qfq_docker.output
- Export variables (replace <T3_PORT>):
export SELENIUM_URL="http://127.0.0.1:<T3_PORT>" SELENIUM_HEADLESS="no"
- in extension/Tests/selenium run
python <selenium test file>.py
Run selenium tests in docker container (test execution not visible)
Assumes you have run qfq in docker as explained above.
- from the docker directory run
./run_selenium_tests_docker.sh
Permanently remove all above created containers and their data
(only removes the containers listed in run_qfq_docker.output)
- from the docker directory run
./remove-containers.sh
TROUBLE SHOOT
WebDriverException: Message: 'chromedriver' executable needs to be in PATH
-
Download Chromedriver:
wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`/chromedriver_linux64.zip
-
Unzip chromedriver to current working directory
unzip /tmp/chromedriver.zip chromedriver
-
export chromedriver path environment variable before running selenium tests locally
export CHROMEDRIVER_PATH=<absolute path to chromedriver>/chromedriver