Moodle App
In order to test plugins with mobile support, the only command that needs a special configuration is behat
.
In practice, you only need to set the MOODLE_APP
env variable to true
, and all the dependencies will be configured during the install
command. You can also configure the behaviour of Acceptance testing for the Moodle App using the following env variables:
MOODLE_APP_DOCKER_IMAGE
: Tag of the Moodle App Docker image to use for running the app. The default value ismoodlehq/moodleapp:latest-test
.MOODLE_APP_BEHAT_PLUGIN_PROJECT
: Project in github to use for installing the plugin with Behat steps specific to the Moodle App. The default value ismoodlehq/moodle-local_moodleappbehat
. This variable will be ignored ifMOODLE_APP_BEHAT_PLUGIN_REPOSITORY
is set.MOODLE_APP_BEHAT_PLUGIN_REPOSITORY
: Repository url to use for installing the plugin with Behat steps specific to the Moodle App. By default, the github repository defined inMOODLE_APP_BEHAT_PLUGIN_PROJECT
will be used.MOODLE_APP_BEHAT_PLUGIN_BRANCH
: Branch of the repository to use for installing the plugin with Behat steps specific to the Moodle App. The default value islatest
.MOODLE_APP_PORT
: Port to listen in the Docker image. The default value is443
, but you may need to set it to80
for older versions of the app.MOODLE_APP_PROTOCOL
: Protocol to use when interaction with the app. The default value ishttps
, but you may need to set it tohttp
for older versions of the app.MOODLE_BEHAT_IONIC_WWWROOT
: Value to use in$CFG->behat_ionic_wwwroot
. The default value ishttps://localhost:8100
(orhttp://localhost:8100
ifMOODLE_APP_PROTOCOL
is set tohttp
). This value should only be used ifMOODLE_APP
is not set, and the Moodle App dependencies are configured manually.
Finally, keep in mind that mobile tests only run on Chrome, so make sure that you’re using the correct browser. If you’re setting the MOODLE_APP
variable, the default browser should already be Chrome; but you can set it explicitly using the --profile
flag otherwise.
For specific examples, look at the gha.dist.yml or .travis.dist.yml files, and uncomment the lines mentioning the app.
Important: Please notice that MOODLE_APP
only works starting with version 4.1 of the app. If you want to use this setup against older versions, you’ll have to use MOODLE_BEHAT_IONIC_WWWROOT
and configure the dependencies manually (installing the plugin, launching the docker image, etc.).