Moodle 4.0 developer update: Difference between revisions
m (Correct behat improvements) |
|||
Line 5: | Line 5: | ||
== API changes == | == API changes == | ||
== Behat changes == | == Behat changes == | ||
To make behat tests more readable and easy to maintain is recommended to use the most direct | To make behat tests more readable and easy to maintain, it is recommended to use the most direct steps to get what the test needs. So since [https://tracker.moodle.org/browse/MDL-66335 MDL-66335] was integrated, and the step was improved in [https://tracker.moodle.org/browse/MDL-72179 MDL-72179] is highly recommended to use | ||
I am on the " | I am on the "Activity name" "[modname] activity" page | ||
or | or | ||
I am on the " | I am on the "Activity name" "[modname] activity" page logged in as "user" | ||
instead of navigating to the activity via | instead of navigating to the activity via | ||
I am on "Course" course homepage | I am on "Course" course homepage | ||
I follow "Activity name" | I follow "Activity name" | ||
Now that [https://docs.moodle.org/dev/Prototypes#Course_creation_improvements Course index] ([https://tracker.moodle.org/browse/MDL-71209 MDL-71209]) is integrated but the project is not stable, | Now that [https://docs.moodle.org/dev/Prototypes#Course_creation_improvements Course index] ([https://tracker.moodle.org/browse/MDL-71209 MDL-71209]) is integrated but the project is not stable, these behat steps | ||
I am on "Course" course homepage | I am on "Course" course homepage | ||
I follow "Activity name" | I follow "Activity name" | ||
will fail using Boost theme. | |||
The reason for it is that the drawer used in Boost is hiding the course index. So when the test is trying to follow an "Activity name" link, it finds two different links: | |||
* one in the course index | * one in the course index | ||
* another one in the course main content. | * another one in the course main content. | ||
But the first one, the one in the course index, is hidden by the drawer, and the test fails. | |||
However the recommended behat steps | |||
I am on the "Activity name" "[modname] activity" page | |||
I am on the " | |||
or | or | ||
I am on the " | I am on the "Activity name" "[modname] activity" page logged in as "user" | ||
work '''fine'''. | work '''fine'''. | ||
Some of failing behats are fixed in [https://github.com/ferranrecio/moodle/commit/c79d58a50b48aa6891ff1d3ba92a7b0ab2393c88#diff-fdf8b0b1eade3b69eaad038de0ddd7c8dec2be7afa32dc693fb929739a49fa9dR32 MDL-71209] | Some of the failing behats are fixed in [https://github.com/ferranrecio/moodle/commit/c79d58a50b48aa6891ff1d3ba92a7b0ab2393c88#diff-fdf8b0b1eade3b69eaad038de0ddd7c8dec2be7afa32dc693fb929739a49fa9dR32 MDL-71209] | ||
For example: | For example: |
Revision as of 07:13, 27 August 2021
Moodle 4.0 This page will highlight the important changes that are coming in Moodle 4.0 for developers. Including how the UX improvements impact custom themes, relevant API changes, and what you can do as developer to prepare for the 4.0 release.
UX and theme changes
Course creation
API changes
Behat changes
To make behat tests more readable and easy to maintain, it is recommended to use the most direct steps to get what the test needs. So since [https://tracker.moodle.org/browse/MDL-66335 MDL-66335] was integrated, and the step was improved in [https://tracker.moodle.org/browse/MDL-72179 MDL-72179] is highly recommended to use
I am on the "Activity name" "[modname] activity" page
or
I am on the "Activity name" "[modname] activity" page logged in as "user"
instead of navigating to the activity via
I am on "Course" course homepage I follow "Activity name"
Now that Course index ([https://tracker.moodle.org/browse/MDL-71209 MDL-71209]) is integrated but the project is not stable, these behat steps
I am on "Course" course homepage I follow "Activity name"
will fail using Boost theme.
The reason for it is that the drawer used in Boost is hiding the course index. So when the test is trying to follow an "Activity name" link, it finds two different links:
- one in the course index
- another one in the course main content.
But the first one, the one in the course index, is hidden by the drawer, and the test fails.
However the recommended behat steps
I am on the "Activity name" "[modname] activity" page
or
I am on the "Activity name" "[modname] activity" page logged in as "user"
work fine.
Some of the failing behats are fixed in [https://tracker.moodle.org/browse/MDL-71209 MDL-71209]
For example:
And I am on the "Test assignment name" "assign activity" page logged in as teacher1
instead of:
When I log in as "teacher1" And I am on "Course" course homepage And I follow "Test assignment name"