Skip to content

Commit

Permalink
MDL-43404 behat: Removing auto accept_alert
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllao committed Dec 18, 2013
1 parent 66de9b8 commit 01b9236
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions lib/tests/behat/behat_hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,15 +205,6 @@ public function before_scenario($event) {
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.
}
}

}

/**
Expand Down Expand Up @@ -338,13 +329,6 @@ public function i_look_for_exceptions() {

} 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.');
}
}

Expand Down

0 comments on commit 01b9236

Please sign in to comment.