MDL-66979 behat: Handle driver stop failure properly
An case was found where the webdriver stop() call could fail in an AfterScenario hook, leading to a complete rerun if no other errors were experienced.
This commit is contained in:
@@ -660,7 +660,24 @@ EOF;
|
||||
* @AfterScenario
|
||||
*/
|
||||
public function reset_webdriver_between_scenarios(AfterScenarioScope $scope) {
|
||||
$this->getSession()->stop();
|
||||
try {
|
||||
$this->getSession()->stop();
|
||||
} catch (Exception $e) {
|
||||
$error = <<<EOF
|
||||
|
||||
Error while stopping WebDriver: %s (%d) '%s'
|
||||
Attempting to continue with test run. Stacktrace follows:
|
||||
|
||||
%s
|
||||
EOF;
|
||||
error_log(sprintf(
|
||||
$error,
|
||||
get_class($e),
|
||||
$e->getCode(),
|
||||
$e->getMessage(),
|
||||
format_backtrace($e->getTrace(), true)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user