Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Behat optimisations, addresses #765 (405 backport) #768

Conversation

marxjohnson
Copy link
Contributor

Backport of #767 to the MOODLE_405_STABLE branch.

@marxjohnson marxjohnson force-pushed the 765-behat-optimisations-405 branch 3 times, most recently from a2d5741 to f845e83 Compare November 25, 2024 16:33
@marxjohnson
Copy link
Contributor Author

The failing run was due to a selenium crash, all the other runs passed so this looks good.

@marxjohnson marxjohnson marked this pull request as ready for review November 26, 2024 08:59
marxjohnson and others added 5 commits December 7, 2024 08:44
…oodle-an-hochschulen#765)

This creates generators and named selectors for smart menus and smart
menu items, plus some navigation URLs for the smart menu settings forms.
…dle-an-hochschulen#765).

This performs several optimisations to make these tests a lot faster.

Creation of smart menus and menu item has been changed to use
generators, rather than filling the forms each time.

Manual navigation has been replaced with `I am on the 'identifier'
'type'
page` as much as possible.

The assertions being made have been optimised. Previously, every
assertion of what was in a menu was opening each menu location and
checking for each item. Given that there's no option to display
different items when a menu is in different location, a lot of this is
redunant, and actually opening each menu takes time.

I have optimised this so that one scenario does a check that the menu
opens and the items are actually visible. Then each scenario tests than
an expected item exists in each menu (without opening the menu) and
checks for subsequent items just check existance in a single menu. This
balances coverage of the different functionality with speed and
conciseness of tests.
…hochschulen#765)

Navigation steps have been optimised a bit, creation of blocks
now uses generators, and @javascript has been removed from tests
that do not require it.

Only tests using the off-canvas block region need Javascript since it
opens the overlay. Otherwise, we are just checking whether block regions
exist or not under various circumstances, which can be done much quicker
without Javascript.
…le-an-hochschulen#765)

As with other smart menu features, this uses generators, navigation
steps and named selectors to speed up the tests. There is more that can
be done to the feature, as time allows.
@abias abias force-pushed the 765-behat-optimisations-405 branch from f845e83 to 1c1bd47 Compare December 7, 2024 07:44
@abias abias merged commit 2d36683 into moodle-an-hochschulen:MOODLE_405_STABLE Dec 7, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants