MDL-66559 behat: Register component selectors earlier

This commit is contained in:
Andrew Nicols
2019-10-14 14:24:05 +08:00
parent c7b384ce66
commit 29933a945f
+7 -14
View File
@@ -338,6 +338,13 @@ 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_list() as $subsystem => $components) {
foreach (array_keys($components) as $component) {
$this->register_component_selectors_for_component($component);
}
}
}
// Reset mink session between the scenarios.
@@ -675,20 +682,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_list() as $subsystem => $components) {
foreach (array_keys($components) as $component) {
$this->register_component_selectors_for_component($component);
}
}
}
/**
* Register a set of component selectors.
*