-
Improvement
-
Resolution: Fixed
-
Major
-
3.5.15, 3.8.6, 3.9.3, 3.10.1, 3.11
-
MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_35_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
-
MOODLE_310_STABLE, MOODLE_35_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
-
MDL-70148-master -
Our current behat steps relating to keyboard are both unclear, and incorrect. We should try to improve them. Example issues include:
- 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)
- our current steps require you to know the ascii key char, which leads to confusing steps
- we use $node->key* methods in several places when we should perhaps be using a standardised API
This issue proposes to introduce new steps:
- I press the [key] key where key includes:
- up
- down
- left
- right
- pageup
- pagedown
- home
- end
- insert
- escape
- enter
- tab
- space
- I press the [modifier][key] key where modifier includes:
- shift
- alt
- control
- meta
- 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)