Commit 140de372 authored by Michael Hawkins's avatar Michael Hawkins
Browse files

MDL-64505 behat: Updated searching admin to work consistently

The way behat_admin::i_set_the_following_administration_settings_values
was searching would fail inconsistently, due to the timing of the steps
not always working correctly.
parent ba2b508c
......@@ -58,12 +58,8 @@ class behat_admin extends behat_base {
$this->execute('behat_navigation::i_select_from_flat_navigation_drawer', [get_string('administrationsite')]);
// Search by label.
$searchbox = $this->find_field(get_string('query', 'admin'));
$searchbox->setValue($label);
$submitsearch = $this->find('css', 'form input[type=submit][name=search]');
$submitsearch->press();
$this->wait(self::TIMEOUT * 1000, self::PAGE_READY_JS);
$this->execute('behat_forms::i_set_the_field_to', [get_string('query', 'admin'), $label]);
$this->execute("behat_forms::press_button", get_string('search', 'admin'));
// Admin settings does not use the same DOM structure than other moodle forms
// but we also need to use lib/behat/form_field/* to deal with the different moodle form elements.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment