mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 14:03:52 +01:00
MDL-50055 tests: Add new step to deal with Single Selects
This commit is contained in:
parent
24a2babdd3
commit
2b964e1d24
@ -383,4 +383,21 @@ class behat_forms extends behat_base {
|
||||
$field->set_value($value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Select a value from single select and redirect.
|
||||
*
|
||||
* @Given /^I select "(?P<singleselect_option_string>(?:[^"]|\\")*)" from the "(?P<singleselect_name_string>(?:[^"]|\\")*)" singleselect$/
|
||||
*/
|
||||
public function i_select_from_the_singleselect($option, $singleselect) {
|
||||
$actions = array(
|
||||
new Given('I set the field "' . $this->escape($singleselect) . '" to "' . $this->escape($option) . '"'),
|
||||
);
|
||||
|
||||
if (!$this->running_javascript()) {
|
||||
$actions[] = new Given('I press "' . get_string('go') . '"');
|
||||
}
|
||||
|
||||
return $actions;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user