Details
-
Type:
Improvement
-
Status: Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 3.5.15, 3.8.6, 3.9.3, 3.10.1, 3.11
-
Component/s: Automated functional tests (behat)
-
Labels:
-
Testing Instructions:
-
Affected Branches:MOODLE_310_STABLE, MOODLE_311_STABLE, MOODLE_35_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
-
Fixed Branches:MOODLE_310_STABLE, MOODLE_35_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
-
Pull from Repository:
-
Pull 3.5 Branch:
MDL-70148-35 -
Pull 3.5 Diff URL:
-
Pull 3.8 Branch:
MDL-70148-38 -
Pull 3.8 Diff URL:
-
Pull 3.9 Branch:
MDL-70148-39 -
Pull 3.9 Diff URL:
-
Pull 3.10 Branch:
MDL-70148-310 -
Pull 3.10 Diff URL:
-
Pull 3.11 Branch:
MDL-70148-311 -
Pull 3.11 Diff URL:
-
Pull Master Branch:
MDL-70148-master -
Pull Master Diff URL:
Description
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)