From aba763fdc00176e48735165bb6d5935396a02b5c Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Fri, 13 Nov 2020 14:21:22 +0800 Subject: [PATCH] MDL-70397 behat: Prevent browser restarting after initial start --- lib/tests/behat/behat_hooks.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/tests/behat/behat_hooks.php b/lib/tests/behat/behat_hooks.php index 1e8e1e88ab5..17b8a0ed1a4 100644 --- a/lib/tests/behat/behat_hooks.php +++ b/lib/tests/behat/behat_hooks.php @@ -328,7 +328,6 @@ EOF; // The `before_subsequent_scenario_start_session` function will restart the session instead. return; } - self::$firstjavascriptscenarioseen = true; $docsurl = behat_command::DOCS_URL; $driverexceptionmsg = <<resize_window('medium'); } + /** + * Mark the first Javascript Scenario as have been seen. + * + * @BeforeScenario + * @param BeforeScenarioScope $scope scope passed by event fired before scenario. + */ + public function mark_first_js_scenario_as_seen(BeforeScenarioScope $scope) { + self::$firstjavascriptscenarioseen = true; + } + /** * Hook to open the site root before the first step in the suite. * Yes, this is in a strange location and should be in the BeforeScenario hook, but failures in the test setUp lead