From b095b36c02bbbf2806e5dfa493cc272b1ec740e7 Mon Sep 17 00:00:00 2001 From: Mark Nielsen Date: Wed, 28 Jun 2017 12:45:07 -0700 Subject: [PATCH] MDL-58948 behat: capture DriverException Other drivers may throw a DriverException when the popup or iframe disappears. --- lib/behat/behat_base.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/behat/behat_base.php b/lib/behat/behat_base.php index bb8a52b0e6c..e7c631fada5 100644 --- a/lib/behat/behat_base.php +++ b/lib/behat/behat_base.php @@ -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. } }