Initial setup needed on host machine.
Step 1: Install docker
Create a docker group to avoid using sudo while executing scripts. NOTE: You need to logout and login to make group affective.
- Download official image
docker pull rajeshtaneja/php:5.4
docker pull rajeshtaneja/php:5.5
docker pull rajeshtaneja/php:5.6
docker pull rajeshtaneja/php:7.0
docker pull rajeshtaneja/selenium:2.53.0
Above will be done via run.sh script automatically, depending on what options you pass.
- Clone this project and execute following commands from within the cloned project.
Run Moodle official application
- Interactive
./run.sh --moodlepath=/var/www/html/m --execute=moodle --shareddir=/host/shared --user=moodle --phpversion=7.0
/host/shared folder is on host machine which will contain behat faildump and moodledata.
./run.sh --moodlepath=/var/www/html/m --execute=behat --shareddir=/host/shared --user=moodle --phpversion=7.0 --run=2 --totalruns=4
./run.sh --moodlepath=/var/www/html/m --execute=behat --shareddir=/host/shared --user=moodle --phpversion=7.0 --run=2 --totalruns=4 --profile=chrome
Following profiles are supported
- firefox / default
- chrome
- phantomjs
- phantomjs-selenium
./run.sh --moodlepath=/var/www/html/m --execute=behat --shareddir=/host/shared --user=moodle --phpversion=7.0 --run=0 --totalruns=4 --tags='@javascript'
./run.sh --moodlepath=/var/www/html/m --execute=behat --shareddir=/host/shared --user=moodle --phpversion=7.0 --run=1 --totalruns=1 --name="This is test"
./run.sh --moodlepath=/var/www/html/m --execute=phpunit --shareddir=/host/shared --user=moodle --phpversion=7.0
- --git=git://git.moodle.org/moodle.git
- --branch=MOODLE_30_STABLE
- --remote=stable
- --dbhost=mssql.test.com
- --dbtype=mssql
- --dbuser=moodle
- --dppass=moodle
You can use external selenium instances (To make them work have a copy of moodle at root level on host machine)
- --seleniumurl=test.local:4444
- --phantomjsurl=test.local:4443
- or use selenium docker image --selenium=selenium/standalone-chrome:2.53.0
Option string for short options with arguments:
- With required arguments like -a bahman or -Hreports
- With optional arguments like -abahman. Note that there can't be any spaces between the option (-a) and the argument (bahman).
Option string for long options with arguments:
- With required arguments like --file-to-process reports or --package-name-prefix='com.bahmanm'
- With optional arguments like --package-name-prefix='com.bahmanm'. Note that the argument can be passed only using =.