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

Write new keyboard steps for Behat

    XMLWordPrintable

    Details

      Description

      Our current behat steps relating to keyboard are both unclear, and incorrect. We should try to improve them. Example issues include:

      1. many of the steps require you press a key in a field, but we should be making these separate steps. It's perfectly legitimate to press keys without being in a field (i.e. keyboard navigation)
      2. our current steps require you to know the ascii key char, which leads to confusing steps
      3. we use $node->key* methods in several places when we should perhaps be using a standardised API

      This issue proposes to introduce new steps:

      1. I press the [key] key where key includes:
        1. up
        2. down
        3. left
        4. right
        5. pageup
        6. pagedown
        7. home
        8. end
        9. insert
        10. escape
        11. enter
        12. tab
        13. space
      2. I press the [modifier][key] key where modifier includes:
        1. shift
        2. alt
        3. control
        4. meta
        5. a combation of these keys joined with +

      Example conversions of these steps:

      -    And I press key "27" in the field "Select users to create learning plans for"
      +    And I press the escape key
      

      This patch also introduces a new behat_base::type_keys() function which is used by the new step, but can also be used by areas which do not implement a context (i.e. form field handlers)

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dobedobedoh Andrew Lyons
              Reporter:
              dobedobedoh Andrew Lyons
              Peer reviewer:
              Sam Marshall Sam Marshall
              Integrator:
              Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
              Tester:
              CiBoT CiBoT
              Participants:
              Component watchers:
              Andrew Lyons, Dongsheng Cai, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                18/Jan/21

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 6 hours, 51 minutes
                  6h 51m