Merge branch 'MDL-77733-master' of https://github.com/lameze/moodle

This commit is contained in:
Andrew Nicols 2023-05-18 11:41:32 +08:00 committed by Ilya Tregubov
commit e177eff0f8
No known key found for this signature in database
GPG Key ID: 0F58186F748E55C1
4 changed files with 27 additions and 10 deletions

View File

@ -49,7 +49,8 @@ list($options, $unrecognized) = cli_get_params(
'torun' => 0,
'optimize-runs' => '',
'add-core-features-to-theme' => false,
'axe' => false,
'axe' => '',
'no-axe' => false,
'disable-composer' => false,
'composer-upgrade' => true,
'composer-self-update' => true,
@ -69,7 +70,7 @@ Behat utilities to initialise behat tests
Usage:
php init.php [--parallel=value [--maxruns=value] [--fromrun=value --torun=value]]
[--axe] [-o | --optimize-runs] [-a | --add-core-features-to-theme]
[--no-axe] [-o | --optimize-runs] [-a | --add-core-features-to-theme]
[--no-composer-self-update] [--no-composer-upgrade]
[--disable-composer]
[--help]
@ -79,7 +80,7 @@ Options:
-m, --maxruns Max parallel processes to be executed at one time
--fromrun Execute run starting from (Used for parallel runs on different vms)
--torun Execute run till (Used for parallel runs on different vms)
--axe Include axe accessibility tests
--no-axe Disable axe accessibility tests.
-o, --optimize-runs
Split features with specified tags in all parallel runs.
@ -110,6 +111,14 @@ if (!empty($options['help'])) {
exit(0);
}
if (!empty($options['axe'])) {
echo "Axe accessibility tests are enabled by default, to disable them, use the --no-axe option.\n";
}
if (!empty($options['no-axe'])) {
echo "Axe accessibility tests have been disabled.\n";
}
// Check which util file to call.
$utilfile = 'util_single_run.php';
$commandoptions = "";
@ -127,6 +136,7 @@ if ($options['parallel'] && $options['parallel'] > 1) {
$cmdoptionsforsinglerun = [
'add-core-features-to-theme',
'axe',
'no-axe',
];
foreach ($cmdoptionsforsinglerun as $option) {

View File

@ -57,7 +57,8 @@ list($options, $unrecognized) = cli_get_params(
'torun' => 0,
'optimize-runs' => '',
'add-core-features-to-theme' => false,
'axe' => false,
'axe' => '',
'no-axe' => false,
),
array(
'h' => 'help',
@ -73,7 +74,7 @@ $help = "
Behat utilities to manage the test environment
Usage:
php util.php [--install|--drop|--enable|--disable|--diag|--updatesteps|--axe|--help] [--parallel=value [--maxruns=value]]
php util.php [--install|--drop|--enable|--disable|--diag|--updatesteps|--no-axe|--help] [--parallel=value [--maxruns=value]]
Options:
--install Installs the test environment for acceptance tests
@ -82,7 +83,7 @@ Options:
--disable Disables test environment
--diag Get behat test environment status code
--updatesteps Update feature step file.
--axe Include axe accessibility tests
--no-axe Disable axe accessibility tests.
-j, --parallel Number of parallel behat run operation
-m, --maxruns Max parallel processes to be executed at one time.

View File

@ -52,7 +52,8 @@ list($options, $unrecognized) = cli_get_params(
'updatesteps' => false,
'optimize-runs' => '',
'add-core-features-to-theme' => false,
'axe' => false,
'axe' => '',
'no-axe' => false,
),
array(
'h' => 'help',
@ -79,7 +80,7 @@ Options:
--disable Disables test environment
--diag Get behat test environment status code
--updatesteps Update feature step file.
--axe Include axe accessibility tests
--no-axe Disable axe accessibility tests.
-o, --optimize-runs Split features with specified tags in all parallel runs.
-a, --add-core-features-to-theme Add all core features to specified theme's
@ -186,8 +187,11 @@ if ($options['install']) {
behat_config_manager::set_behat_run_config_value('behatsiteenabled', 1);
}
// Define whether to run Behat with axe tests.
behat_config_manager::set_behat_run_config_value('axe', $options['axe']);
// Always run Behat with axe tests.
if (!$options['no-axe']) {
behat_config_manager::set_behat_run_config_value('axe', true);
}
// Enable test mode.
$timestart = microtime(true);

View File

@ -1,5 +1,7 @@
This files describes API changes in the tool_behat code.
=== 4.2 ===
* Behat is initialised with Axe accessibility tests enabled by default, if you want to disable them please use the --no-axe option.
=== 3.7 ===
* Behat will now look for behat step definitions in the current
theme and any parents the theme may have.