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. #767

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

marxjohnson
Copy link
Contributor

This does a bunch of optimisations for the longest-running behat features. See the commit messages for details of what I've done. Further optimisations are possible, but I don't have time to work on this any further at the moment. Hopefully the groundwork of adding the behat_theme_boost_union and behat_theme_boost_union_generator classes will make it easy for others to make further improvements.

In my first run of these changes the tests completed in 2.5 hours, vs the 3.5-4 hours I was getting previously.,

[x] link your issue in the PR title, using the keyword 'resolves #ISSUE-NUMBER', e.g. 'Feature: Provide the ultimate user experience, resolves #42'
[x provide any further information that is relevant for peer review and not yet mentioned in the linked issue as a comment in the PR
[x] make sure that the 'Allow edits by maintainers' checkbox is checked when creating the PR. Otherwise, the peer reviewer would not be able to push any review changes to the PR and the communication overhead increases
[x] submit your PR in draft status to run the automated checks and review the results
[ ] in case any checks fail solve the mentioned errors by pushing the corrected code to your PR-branch
[ ] if all checks pass (or if you are unable to resolve the failing steps without any help of the review team), mark the PR as 'ready for review'

…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.
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.

1 participant