-
Bug
-
Resolution: Fixed
-
Minor
-
2.8.6, 2.9, 3.0
-
MOODLE_28_STABLE, MOODLE_29_STABLE, MOODLE_30_STABLE
-
MOODLE_28_STABLE, MOODLE_29_STABLE
-
wip-mdl-50259
-
-
- Run behat with ~@javascript tag
- Modify step in "An automatic subscription forum can have discussions unsubscribed from" scenario to create "Fo" activity and make sure it fails.
Behat lets you use the following syntax to create an activity:
And I add a "Forum" to section "1" and I fill the form with: |
If the activity name in quotes is a subset of another activity name which comes before it alphabetically e.g. "Aardvark Forum" then the Behat code can create the wrong type of activity and break the tests.
This only happens in the non-javascript code flow. Adding @javascript to the test scenario will avoid this problem.
This can be tested with a default moodle set of modules by trying the following line in a behat test:
And I add a "Fo" to section "1" and I fill the form with: |
"Fo" here matches both "Forum" and "Folder", in the non-javascript case it will create a Folder as it partially matches, and it comes first alphabetically.
If you put @javascript before the test then the test fails (which is probably the expected behaviour) since it expects an exact text match and there is no activity type called "Fo".