From 018d6f11df2148926e09cc24cd39a72ed2cede2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mikel=20Mart=C3=ADn?= Date: Tue, 3 Dec 2024 16:06:49 +0100 Subject: [PATCH] MDL-75669 theme_boost: Fix BS5 related behat --- lib/tests/behat/behat_action_menu.php | 2 +- theme/boost/scss/moodle/debug.scss | 5 +++++ theme/boost/style/moodle.css | 4 ++++ theme/classic/style/moodle.css | 4 ++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/tests/behat/behat_action_menu.php b/lib/tests/behat/behat_action_menu.php index 3e69218bdd275..2005d322c0b29 100644 --- a/lib/tests/behat/behat_action_menu.php +++ b/lib/tests/behat/behat_action_menu.php @@ -84,7 +84,7 @@ public function i_choose_in_the_open_action_menu($menuitemstring) { $menuitems = explode('>', $menuitemstring); foreach ($menuitems as $menuitem) { // Gets the node based on the requested selector type and locator. - $menuselector = ".moodle-actionmenu .dropdown.show .dropdown-menu"; + $menuselector = ".moodle-actionmenu .dropdown .dropdown-menu.show"; $node = $this->get_node_in_container("link", trim($menuitem), "css_element", $menuselector); $node->click(); } diff --git a/theme/boost/scss/moodle/debug.scss b/theme/boost/scss/moodle/debug.scss index d439ffc304c66..80cbfcb35fa74 100644 --- a/theme/boost/scss/moodle/debug.scss +++ b/theme/boost/scss/moodle/debug.scss @@ -76,6 +76,11 @@ body.behat-site { } } +// Remove the scroll-behavior: smooth from the root element for behat. +:root:has(body.behat-site) { + scroll-behavior: auto; +} + .phpinfo table, .phpinfo th, .phpinfo h2 { diff --git a/theme/boost/style/moodle.css b/theme/boost/style/moodle.css index ffde0baa48ca0..37cb38f84f480 100644 --- a/theme/boost/style/moodle.css +++ b/theme/boost/style/moodle.css @@ -38233,6 +38233,10 @@ body.behat-site.path-grade-report-grader .gradeparent tr.heading { top: auto; } +:root:has(body.behat-site) { + scroll-behavior: auto; +} + .phpinfo table, .phpinfo th, .phpinfo h2, diff --git a/theme/classic/style/moodle.css b/theme/classic/style/moodle.css index c4d4ce0122769..4e045b381c9ce 100644 --- a/theme/classic/style/moodle.css +++ b/theme/classic/style/moodle.css @@ -38167,6 +38167,10 @@ body.behat-site.path-grade-report-grader .gradeparent tr.heading { top: auto; } +:root:has(body.behat-site) { + scroll-behavior: auto; +} + .phpinfo table, .phpinfo th, .phpinfo h2,