From 9f34222aa5da59a775b2f7474651f1f27eb7b4f6 Mon Sep 17 00:00:00 2001 From: Pieter Frenssen Date: Tue, 5 Feb 2019 15:46:08 +0100 Subject: [PATCH] Throw a helpful exception if the AJAX timeout is missing due to a common mistake in the configuration. --- src/Drupal/DrupalExtension/Context/MinkContext.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Drupal/DrupalExtension/Context/MinkContext.php b/src/Drupal/DrupalExtension/Context/MinkContext.php index b7bf9e1c..e7815496 100644 --- a/src/Drupal/DrupalExtension/Context/MinkContext.php +++ b/src/Drupal/DrupalExtension/Context/MinkContext.php @@ -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 */