Problem/Motivation
As part of #2869825: Leverage JS for JS testing (using nightwatch) we need to allow nightwatch to install Drupal, so we can test a site in isolation.
Proposed resolution
- Add a command to install Drupal
- This command allows to specify the installation profile and a file to setup additional configuration
- Nightwatch then can run this command from node.
Test instructions
After applying the patch there will be new commands to install a test site and tear it down. To install a test site run:
php core/scripts/test-site.php install --json
This will output information about the test site in a JSON format if successful. For example:
{"db_prefix":"test22029735","user_agent":"simpletest22029735:1518188974:5a7db9aee752c4.29037117:Vvw9BjAc-58eRlb95RphcXV4Xeb72-eWTba4XYtc4pY"}
To tear down the site:
php core/scripts/test-site.php tear-down test22029735
Other features:
// Get general help.
php core/scripts/test-site.php
// Get specific help.
php core/scripts/test-site.php install --help
php core/scripts/test-site.php tear-down --help