-
Improvement
-
Resolution: Fixed
-
Minor
-
4.1.18, 4.4.8, 4.5.4, 5.0
While developing complex features that have a lot of setup to get to them, it is sometimes useful to be able to set up the server with a Behat test (either an existing test, or a half-written one that will eventually become a test for your feature). Then you can develop using your web browser pointing at the Behat instance.
I do this fairly often. In this case I'm slightly abusing the Behat installation (wwwroot/prefix/dataroot) as just a second Moodle installation, with Behat used just for the original setup.
One drawback is that you cannot use CLI commands. For example, while making theme changes it's useful to be able to run:
php admin/cli/purge_caches.php --theme
|
Similar for JS, for example:
grunt amd --root=local/mymodule/amd && php admin/cli/purge_caches.php --js
|
These commands will work on the 'real' Moodle instance, not the Behat one, so I have to use the GUI instead.
This enhancement allows an environment variable to be used to indicate that the CLI command should run on the Behat instance (equivalent to how the web requests do this if the wwwroot matches the Behat wwwroot).
BEHAT_CLI=1 php admin/cli/purge_caches.php --theme
|
grunt amd --root=local/mymodule/amd && BEHAT_CLI=1 php admin/cli/purge_caches.php --js
|
- duplicates
-
MDL-67994 Behat: running scheduled tasks in the admin task UI runs them on the real site, not the behat site
-
- Open
-