After user type there is a 400ms delay, then search
Adding 2 sec delay to ensure search is finished before
click event is triggred
throw new coding_exception('Setting the valid of an autocomplete field requires javascript.');
}
$this->field->setValue($value);
+ // After the value is set, there is a 400ms throttle and then search. So adding 2 sec. delay to ensure both
+ // throttle + search finishes.
+ sleep(2);
$id = $this->field->getAttribute('id');
$js = ' require(["jquery"], function($) { $(document.getElementById("'.$id.'")).trigger("behat:set-value"); }); ';
$this->session->executeScript($js);