-
Improvement
-
Resolution: Fixed
-
Major
-
2.8, 3.8
-
MOODLE_28_STABLE, MOODLE_38_STABLE
-
MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
-
At the present time, it's not possible for the majority of Moodle's plugin types to provide their own data generators for use in Behat tests. This is a severe hindrance for plugin maintainers – we can't complete our test suites without a fix for this.
This is because the current behat_data_generators::the_following_exist() implementation uses a hardcoded array of core-supplied data generators (behat_data_generators::$elements).
Following a forum discussion, I believe that Moodle should provide a new plugin-specific the following "{:frankenstylecomponentname}" "{:elementname}s" exist syntax. The presence of this statement in a scenario would cause Moodle to instantiate the {$frankenstylecomponentname}_generator class and invoke the create_{$elementname} method to create the object.
Acutally, the final decision for the form the step should take, similar to MDL-66559 and MDL-66335, is
Given the following "mod_quiz > user overrides" exist:
|
| quiz | user | attempts |
|
| Test quiz name | student1 | 2 |
|
- caused a regression
-
MDL-67691 behat_data_generators::the_following_exist() is gone, long life?
- Closed
- has been marked as being related by
-
MDL-65600 Plugin should be able to define named selectors for Behat tests
- Closed
-
MDL-66335 Behat: new steps to navigate directly to a pages for any plugin, possibly while logging in
- Closed
-
MDL-66559 Components should be able to define their own named selectors
- Closed