-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
3.5.2, 3.6
-
MOODLE_35_STABLE, MOODLE_36_STABLE
-
MDL-63384_master
-
-
While adding a Behat test for MDL-63119 I noticed that with the function "I set the following fields to these values" I couldn't set certain fields in a form, e.g. the "Duration in minutes" field when creating a new calendar event. I found the problem: That function only ever sets the first field with a given label to the given value. And in the test I was writing you had two fields with the label "Duration in minutes", one of them was just hidden: the first field was the radio button that enabled the actual text input field for the duration. So I needed to both click a radio button and enter text into a text field which is not possible with the function mentioned above.
As there are cases in the Moodle core where you have multiple fields with labels containing the same text it should be possible to set all these fields in Behat tests. My suggestion is this:
And I set the following fields to these values:
|
| Event title | Mediocre event :( |
|
| Description | Wait, this event isn't that great. |
|
| Location | |
|
| Duration in minutes | |
|
| Duration in minutes | 30 |
|
The first occurrence of a label in the parameter list refers to the first field with such a label (same behavior as before, so backwards compatible), the second to the second and the nth to the nth.