public function afterJavascriptStep($event)
    {
        /** @var \Behat\Behat\Hook\Scope\BeforeStepScope $event */
        if (!$this->hasTag('javascript')) {
            return;
        }
        $text = $event->getStep()->getText();
        if (preg_match('/(follow|press|click|submit)/i', $text)) {
            $this->iWaitForAjaxToFinish($event);
        }
    }
public function afterJavascriptStep($event)
    {
        /** @var \Behat\Behat\Hook\Scope\BeforeStepScope $event */
        if (!$this->hasTag('javascript')) {
            return;
        }
        $text = $event->getStep()->getText();
        if (preg_match('/(follow|press|click|submit)/i', $text)) {
            $this->iWaitForAjaxToFinish($event);
        }
    }
public function afterJavascriptStep ( $ event ) { /** @var \Behat\Behat\Hook\Scope\BeforeStepScope $event */ if ( ! $ this -> hasTag ( 'javascript' ) ) { return ; } $ text = $ event -> getStep ( ) -> getText ( ) ; if ( preg_match ( '/(follow|press|click|submit)/i' , $ text ) ) { $ this -> iWaitForAjaxToFinish ( $ event ) ; } }
For javascript enabled scenarios, always wait for AJAX after clicking.

@AfterStep
For javascript enabled scenarios always wait for AJAX after clicking .