MDL-43404 behat: Removing auto accept_alert

This commit is contained in:
David Monllao
2013-12-18 14:20:48 +08:00
parent 66de9b8f9c
commit 01b9236a50
-16
View File
@@ -205,15 +205,6 @@ class behat_hooks extends behat_base {
self::$initprocessesfinished = true;
}
// Closing JS dialogs if present. Otherwise they would block this scenario execution.
if ($this->running_javascript()) {
try {
$session->getDriver()->getWebDriverSession()->accept_alert();
} catch (NoAlertOpenError $e) {
// All ok, there should not be JS dialogs in theory.
}
}
}
/**
@@ -338,13 +329,6 @@ class behat_hooks extends behat_base {
} catch (NoSuchWindow $e) {
// If we were interacting with a popup window it will not exists after closing it.
} catch (UnexpectedAlertOpen $e) {
// We fail the scenario if we find an opened JS alert/confirm, in most of the cases it
// will be there because we are leaving an edited form without submitting/cancelling
// it, but moodle is using JS confirms and we can not just cancel the JS dialog
// as in some cases (delete activity with JS enabled for example) the test writer should
// use extra steps to deal with moodle's behaviour.
throw new Exception('Modal window present. Ensure there are no edited forms pending to submit/cancel.');
}
}