MDL-66378 behat: Backport expand autocomplete step

This commit is contained in:
Andrew Nicols
2019-08-17 16:37:40 +08:00
parent 9e812c35a7
commit f782dcffdc
+14
View File
@@ -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<field_string>(?:[^"]|\\")*)" 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();
}
}