This commit is contained in:
Eloy Lafuente (stronk7) 2017-01-03 02:34:58 +01:00
commit 0e5205d36c
4 changed files with 4 additions and 26 deletions

View file

@ -386,28 +386,6 @@ class behat_hooks extends behat_base {
$this->resize_window('medium');
}
/**
* Executed after scenario to go to a page where no JS is executed.
* This will ensure there are no unwanted ajax calls from browser and
* site can be reset safely.
*
* @param AfterScenarioScope $scope scope passed by event fired after scenario.
* @AfterScenario
*/
public function after_scenario(AfterScenarioScope $scope) {
try {
$this->wait_for_pending_js();
$this->getSession()->reset();
} catch (DriverException $e) {
// Try restart session, if DriverException caught.
try {
$this->getSession()->restart();
} catch (DriverException $e) {
// Do nothing, as this will be caught while starting session in before_scenario.
}
}
}
/**
* Wait for JS to complete before beginning interacting with the DOM.
*