Skip to content

Commit

Permalink
Throw a helpful exception if the AJAX timeout is missing due to a com…
Browse files Browse the repository at this point in the history
…mon mistake in the configuration.
  • Loading branch information
pfrenssen committed Feb 5, 2019
1 parent 3836ccb commit 9f34222
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Drupal/DrupalExtension/Context/MinkContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ function isAjaxing(instance) {
);
}());
JS;
$result = $this->getSession()->wait(1000 * $this->getMinkParameter('ajax_timeout'), $condition);
$ajax_timeout = $this->getMinkParameter('ajax_timeout');
if ($ajax_timeout === NULL) {
throw new \Exception('No AJAX timeout has been defined. Please verify that "Drupal\MinkExtension" is configured in behat.yml (and not "Behat\MinkExtension").');
}
$result = $this->getSession()->wait(1000 * $ajax_timeout, $condition);
if (!$result) {
if ($event) {
/** @var \Behat\Behat\Hook\Scope\BeforeStepScope $event */
Expand Down

0 comments on commit 9f34222

Please sign in to comment.