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

Further behat optimisations #839

Open
marxjohnson opened this issue Feb 20, 2025 · 0 comments
Open

Further behat optimisations #839

marxjohnson opened this issue Feb 20, 2025 · 0 comments

Comments

@marxjohnson
Copy link
Contributor

Describe the bug
Following on from #765, there are still further optimisations possible to bring down the run time of the theme's behat suite.

Given the timing file and the work done on the previous bug, I have the following suggestions for further improvements, targeting the files currently taking >1000 seconds to run, as these will have the most impact:

theme_boost_union_smartmenusettings_menuitems_presentation.feature

  • The first 3 scenarios have been modified to use generators and the new named selectors for assertions. The rest of the scenarios can be converted too.
  • Some tests may not require Javascript. For example "Presentation - Display the menu item title in different types" can probably just check for the existstence of the title inside each menu.
  • "Presentation - Display the menu items title with icon" It might be possible to use named selectors rather than complex CSS selectors.
  • "Presentation - Add a smart menu item with multilang tags", "Presentation - Hide empty menus" As in Behat test optimisations #765, these assertions can be sped up with named selectors.
  • "Presentation - Image alt text for the dynamic menu items", "Presentation - Image alt text for the static menu items" Named selectors to replace long xpaths would make this more readable.

theme_boost_union_smartmenusettings_menus_rules.feature

  • This file basically has the same tests as theme_boost_union_smartmenusettings_menuitems_rules.feature.
    • A simple change would be to make the same changes in this file
    • With some more thought, there might be some redundency here which can be removed by combining the two feature files to cover all the functionality.

theme_boost_union_contentsettings_staticpages.feature

  • Is it actually necessary for every scenario to check the popover opens correctly? If one can do that and the others just check the links exist in the correct container, they could run without Javascript.

theme_boost_union_smartmenusettings_menus_presentation.feature

  • As above, the same optimisations as the menuitems feature a probably possible, and it may be further possbile to combine these features to reduce redundancy.

theme_boost_union_contentsettings_slider.feature

  • The background uploads a file to a filepicker for each scenario, although not all scenarios assert it exists. If this is not necessary, it could be included in just the scenarios where it is.
  • If it is necessary, this and other uploaded files could benefit from a generator which simulates saving the files in backend code, rather than uploading them throught he UI.
@marxjohnson marxjohnson added the new Something which has been reported but has not yet beeen triaged by the team label Feb 20, 2025
@abias abias moved this to Ready for DEV in Boost Union Planning Board Mar 4, 2025
@abias abias removed the new Something which has been reported but has not yet beeen triaged by the team label Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready for DEV
Development

No branches or pull requests

2 participants