Skip to content

Commit 091d430

Browse files
marinaglancypolothy
authored andcommitted
Add option --suite to behat job
Initialise all themes in behat by using --add-core-features-to-theme Allow to specify --suite option for behat job, if not specified, use default suite (default theme)
1 parent 183f689 commit 091d430

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Command/BehatCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ protected function configure()
4646

4747
$this->setName('behat')
4848
->addOption('profile', 'p', InputOption::VALUE_REQUIRED, 'Behat profile to use', 'default')
49+
->addOption('suite', null, InputOption::VALUE_REQUIRED, 'Behat suite to use (Moodle theme)', 'default')
4950
->addOption('start-servers', null, InputOption::VALUE_NONE, 'Start Selenium and PHP servers')
5051
->addOption('jar', null, InputOption::VALUE_REQUIRED, 'Path to Selenium Jar file', $jar)
5152
->addOption('auto-rerun', null, InputOption::VALUE_REQUIRED, 'Number of times to rerun failures', 2)
@@ -79,6 +80,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7980
->add('admin/tool/behat/cli/run.php')
8081
->add('--tags=@'.$this->plugin->getComponent())
8182
->add('--profile='.$input->getOption('profile'))
83+
->add('--suite='.$input->getOption('suite'))
8284
->add('--auto-rerun='.$input->getOption('auto-rerun'))
8385
->add('--verbose')
8486
->add('-vvv')

src/Installer/TestSuiteInstaller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public function getPostInstallProcesses()
143143

144144
if ($this->plugin->hasBehatFeatures()) {
145145
$this->getOutput()->debug('Enabling Behat');
146-
$processes[] = new MoodleProcess(sprintf('%s --enable', $this->getBehatUtility()));
146+
$processes[] = new MoodleProcess(sprintf('%s --enable --add-core-features-to-theme', $this->getBehatUtility()));
147147
}
148148
if ($this->plugin->hasUnitTests()) {
149149
$this->getOutput()->debug('Build PHPUnit config');

0 commit comments

Comments
 (0)