Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-67668

Create form field type for inplace editables




      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:

      1. 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
      2. 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.


        Issue Links



              dobedobedoh Andrew Lyons
              dobedobedoh Andrew Lyons
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Adrian Greeve Adrian Greeve
              CiBoT CiBoT
              0 Vote for this issue
              5 Start watching this issue



                Time Tracking

                  Original Estimate - 0 minutes
                  Remaining Estimate - 0 minutes
                  Time Spent - 1 day, 4 hours, 12 minutes
                  1d 4h 12m