MDL-66559 behat: Register component selectors earlier

This commit is contained in:
Andrew Nicols
2019-10-14 14:24:05 +08:00
parent 17342a4ff3
commit 86a58a82d8
+6 -12
View File
@@ -338,6 +338,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.
@@ -675,18 +681,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.
*