Details
-
Type:
Bug
-
Status: Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 3.2, 3.3, 3.4
-
Component/s: Automated functional tests (behat), Themes
-
Testing Instructions:
-
Affected Branches:MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE
-
Fixed Branches:MOODLE_32_STABLE, MOODLE_33_STABLE
-
Pull from Repository:
-
Pull Master Branch:
MDL-58826_master -
Pull Master Diff URL:
Description
Steps to reproduce:
- Put the attached file broken.feature in /lib/tests/behat
- Run behat init
- Run broken.feature
Expected: The first test fails as it's trying to use an action menu that isn't present on the page. The second test then runs.
Actual: The first test crashes with a fatal error. The second test is not run.
The problem is that the step gets the menu node using Element->find() not behat_base->find(), so the step isn't throwing an exception when the menu node isn't found. The fix checks $menunode before trying to call method on it and throws an exception.