diff --git a/src/Drupal/DrupalExtension/Context/MinkContext.php b/src/Drupal/DrupalExtension/Context/MinkContext.php index 9f74671f..bd674304 100644 --- a/src/Drupal/DrupalExtension/Context/MinkContext.php +++ b/src/Drupal/DrupalExtension/Context/MinkContext.php @@ -82,9 +82,14 @@ public function assertEnterField($field, $value) { /** * For javascript enabled scenarios, always wait for AJAX before clicking. * - * @BeforeStep @javascript + * @BeforeStep */ public function beforeJavascriptStep($event) { + /** @var \Behat\Behat\Hook\Scope\BeforeStepScope $event */ + $tags = $event->getFeature()->getTags(); + if (!in_array('javascript', $tags)) { + return; + } $text = $event->getStep()->getText(); if (preg_match('/(follow|press|click|submit)/i', $text)) { $this->iWaitForAjaxToFinish(); @@ -94,9 +99,14 @@ public function beforeJavascriptStep($event) { /** * For javascript enabled scenarios, always wait for AJAX after clicking. * - * @AfterStep @javascript + * @AfterStep */ public function afterJavascriptStep($event) { + /** @var \Behat\Behat\Hook\Scope\BeforeStepScope $event */ + $tags = $event->getFeature()->getTags(); + if (!in_array('javascript', $tags)) { + return; + } $text = $event->getStep()->getText(); if (preg_match('/(follow|press|click|submit)/i', $text)) { $this->iWaitForAjaxToFinish();