Merge branch 'MDL-66559-master' of git://github.com/andrewnicols/moodle

This commit is contained in:
Eloy Lafuente (stronk7) 2019-10-14 16:33:46 +02:00
commit 1b8a7f86d5

View File

@ -322,6 +322,7 @@ class behat_hooks extends behat_base {
// Register behat selectors for theme, if suite is changed. We do it for every suite change.
if ($suitename !== self::$runningsuite) {
self::$runningsuite = $suitename;
behat_context_helper::set_environment($scope->getEnvironment());
// We need the Mink session to do it and we do it only before the first scenario.
@ -342,6 +343,12 @@ class behat_hooks extends behat_base {
$this->getSession()->getSelectorsHandler()->registerSelector('named_partial', new $namedpartialclass());
$this->getSession()->getSelectorsHandler()->registerSelector('named_exact', new $namedexactclass());
// Register component named selectors.
foreach (\core_component::get_component_names() as $component) {
$this->register_component_selectors_for_component($component);
}
}
// Reset mink session between the scenarios.
@ -373,7 +380,6 @@ class behat_hooks extends behat_base {
// Set the theme if not default.
if ($suitename !== "default") {
set_config('theme', $suitename);
self::$runningsuite = $suitename;
}
// Reset the scenariorunning variable to ensure that Step 0 occurs.
@ -709,18 +715,6 @@ class behat_hooks extends behat_base {
return !(self::$initprocessesfinished);
}
/**
* Register component selectors.
*
* @param BeforeScenarioScope $scope scope passed by event fired before scenario.
* @BeforeScenario
*/
public function register_component_selectors(BeforeScenarioScope $scope) {
foreach (\core_component::get_component_names() as $component) {
$this->register_component_selectors_for_component($component);
}
}
/**
* Register a set of component selectors.
*