-
Improvement
-
Resolution: Fixed
-
Minor
-
3.5.10, 3.6.8, 3.7.4, 3.8.1, 3.9
-
MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
-
MOODLE_310_STABLE, MOODLE_35_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
-
MDL-67668-master-2 -
At the moment we do not have any special handling for our "inplace editable" field type in Behat.
As a result this means that we have lots of places where we do things like:
And I click on "Edit cohort name" "link" in the "Test cohort name" "table_row"
|
And I set the field "New name for cohort Test cohort name" to "Students cohort"
|
And I press key "13" in the field "New name for cohort Test cohort name"
|
Whilst this will become much more readable with MDL-70148, we should be able to treat it like a normal field setting a value. This is important because different Mink drivers have different behaviours when setting the values. The Abstract Mink Driver expects that when you call "setValue()" on an object that it will finish by blurring it. With the current instaclick driver that we use this is achieved by simulating a blur event, but with the new W3C driver this is different.
We have two ways to normalise this behaviour:
- we can replace all uses of "I set the field :fieldname to :value" with "I type :value" and "I press the enter|escape key"; or
- we can update the field definitions to know what an inplace editable field is (and have it call the I type, and I press enter steps.
The latter option will mean that we can only explicitly set the field, and not just cancel it, but we only need to cancel it in the tests where we are testing the inplace editable code itself, and not the functional behaviour of inplace editable in the other 99% of cases.
If we go with the latter option we simplify the steps in most cases, but it does mean that developers will have to remove the superflous step in the long run.
I feel that the second option of teaching Behat how to recognise the inplace editable field is the better option as it is more consistent with how we set field values across the rest of Moodle, and the behaviour is the desired behaviour is 99% of cases.
This change will be backported to all supported stables, including security, as per our standard backport policy for testing issues.
- blocks
-
MDL-67658 Improve behat resilience with pendingJS
- Reopened
-
MDL-66979 Switch all the behat testing to the new W3C drivers
- Closed
- has a non-specific relationship to
-
MDL-72696 Behat steps to interact with the inplace editable(select) element doesn't work consistently on Chrome
- Closed
- is blocked by
-
MDL-70148 Write new keyboard steps for Behat
- Closed
- Testing discovered
-
MDL-70175 Update blocks site_main_menu and social_activities to use custom selectors instead of custom steps
- Open