MDL-58948 behat: capture DriverException

Other drivers may throw a DriverException when the popup
or iframe disappears.
This commit is contained in:
Mark Nielsen 2017-06-28 12:45:07 -07:00
parent f46a2dd913
commit b095b36c02

View File

@ -28,7 +28,8 @@
// NOTE: no MOODLE_INTERNAL test here, this file may be required by behat before including /config.php.
use Behat\Mink\Exception\ExpectationException as ExpectationException,
use Behat\Mink\Exception\DriverException,
Behat\Mink\Exception\ExpectationException as ExpectationException,
Behat\Mink\Exception\ElementNotFoundException as ElementNotFoundException,
Behat\Mink\Element\NodeElement as NodeElement;
@ -881,6 +882,8 @@ class behat_base extends Behat\MinkExtension\Context\RawMinkContext {
} catch (NoSuchWindow $e) {
// If we were interacting with a popup window it will not exists after closing it.
} catch (DriverException $e) {
// Same reason as above.
}
}