This commit is contained in:
Dan Poltawski 2015-11-23 11:33:55 +00:00
commit 14248189b7
4 changed files with 25 additions and 50 deletions

View file

@ -256,7 +256,7 @@ class behat_hooks extends behat_base {
// We need the Mink session to do it and we do it only before the first scenario.
if (self::is_first_scenario()) {
behat_selectors::register_moodle_selectors($session);
behat_context_helper::set_session($session);
behat_context_helper::set_main_context($event->getContext()->getMainContext());
}
// Reset mink session between the scenarios.
@ -384,6 +384,18 @@ class behat_hooks extends behat_base {
}
}
/**
* Executed after scenario having switch window to restart session.
* This is needed to close all extra browser windows and starting
* one browser window.
*
* @param ScenarioEvent $event event fired after scenario.
* @AfterScenario @_switch_window
*/
public function after_scenario_switchwindow(ScenarioEvent $event) {
$this->getSession()->restart();
}
/**
* Getter for self::$faildumpdirname
*