From e99a3cca937d1002d90a56ab4b27fda4753d2f36 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Mon, 14 Oct 2019 14:24:05 +0800 Subject: [PATCH] MDL-66559 behat: Register component selectors earlier --- lib/tests/behat/behat_hooks.php | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/lib/tests/behat/behat_hooks.php b/lib/tests/behat/behat_hooks.php index 3c350178144..41f6f3d7cf1 100644 --- a/lib/tests/behat/behat_hooks.php +++ b/lib/tests/behat/behat_hooks.php @@ -343,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. @@ -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. *