diff --git a/lib/tests/behat/behat_forms.php b/lib/tests/behat/behat_forms.php index cd532a346a6..0dd8b7dc72a 100644 --- a/lib/tests/behat/behat_forms.php +++ b/lib/tests/behat/behat_forms.php @@ -546,4 +546,18 @@ class behat_forms extends behat_base { $csstarget = ".form-autocomplete-downarrow"; $this->execute('behat_general::i_click_on', [$csstarget, 'css_element']); } + + /** + * Expand the given autocomplete list + * + * @Given /^I expand the "(?P(?:[^"]|\\")*)" autocomplete$/ + * + * @param string $field Field name + */ + public function i_expand_the_autocomplete($field) { + $csstarget = '.form-autocomplete-downarrow'; + $node = $this->get_node_in_container('css_element', $csstarget, 'form_row', $field); + $this->ensure_node_is_visible($node); + $node->click(); + } }