From 68a8ad4ec25b8f793ab6008d966dabf7ec282533 Mon Sep 17 00:00:00 2001 From: Prasanna LMSACE Date: Fri, 15 Dec 2023 17:14:35 +0530 Subject: [PATCH] Test: Align smart menu test with the smart menu item test for css classes, solves #367 --- ...artmenusettings_menus_presentation.feature | 31 ++++++++++++++----- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/tests/behat/theme_boost_union_smartmenusettings_menus_presentation.feature b/tests/behat/theme_boost_union_smartmenusettings_menus_presentation.feature index 57c381da6a3..dfef93de984 100644 --- a/tests/behat/theme_boost_union_smartmenusettings_menus_presentation.feature +++ b/tests/behat/theme_boost_union_smartmenusettings_menus_presentation.feature @@ -47,19 +47,34 @@ Feature: Configuring the theme_boost_union plugin on the "Smart menus" page, app And I click on "Create menu" "button" And I expand all fieldsets And I set the following fields to these values: - | Title | Quick links | - | Menu location(s) | Main navigation | - | CSS class | quick-links-menu | + | Title | Quick links | + | Menu location(s) | Main, Menu, User, Bottom | + | CSS class | quick-links-menu | And I click on "Save and return" "button" - Then ".nav-item.quick-links-menu" "css_element" should exist in the ".primary-navigation" "css_element" - And I should see "Quick links" in the ".nav-item.quick-links-menu" "css_element" + And I set "Quick links" smart menu items with the following fields to these values: + | Title | Resources | + | Menu item type | Static | + | Menu item URL | http://moodle.org | + And the "class" attribute of "//div[@class='primary-navigation']//a[contains(normalize-space(.), 'Quick links')]//.." "xpath_element" should contain "quick-links-menu" + And the "class" attribute of "//div[contains(@class, 'carousel-item')]//a[contains(normalize-space(.), 'Quick links')]" "xpath_element" should contain "quick-links-menu" + And the "class" attribute of "//nav[contains(@class, 'menubar')]//a[contains(normalize-space(.), 'Quick links')]//.." "xpath_element" should contain "quick-links-menu" + And I change the viewport size to "740x900" + And the "class" attribute of "//div[@class='bottom-navigation']//a[contains(normalize-space(.), 'Quick links')]//.." "xpath_element" should contain "quick-links-menu" + And I change the viewport size to "large" + And I navigate to smart menus And I click on ".action-edit" "css_element" in the "Quick links" "table_row" And I expand all fieldsets And I set the field "CSS class" to "quick-links" And I click on "Save and return" "button" - Then ".nav-item.quick-links-menu" "css_element" should not exist in the ".primary-navigation" "css_element" - And ".nav-item.quick-links" "css_element" should exist in the ".primary-navigation" "css_element" - And I should see "Quick links" in the ".nav-item.quick-links" "css_element" + And the "class" attribute of "//div[@class='primary-navigation']//a[contains(normalize-space(.), 'Quick links')]//.." "xpath_element" should not contain "quick-links-menu" + And the "class" attribute of "//div[@class='primary-navigation']//a[contains(normalize-space(.), 'Quick links')]//.." "xpath_element" should contain "quick-links" + And the "class" attribute of "//div[contains(@class, 'carousel-item')]//a[contains(normalize-space(.), 'Quick links')]" "xpath_element" should not contain "quick-links-menu" + And the "class" attribute of "//div[contains(@class, 'carousel-item')]//a[contains(normalize-space(.), 'Quick links')]" "xpath_element" should contain "quick-links" + And the "class" attribute of "//nav[contains(@class, 'menubar')]//a[contains(normalize-space(.), 'Quick links')]//.." "xpath_element" should not contain "quick-links-menu" + And the "class" attribute of "//nav[contains(@class, 'menubar')]//a[contains(normalize-space(.), 'Quick links')]//.." "xpath_element" should contain "quick-links" + And I change the viewport size to "740x900" + And the "class" attribute of "//div[@class='bottom-navigation']//a[contains(normalize-space(.), 'Quick links')]//.." "xpath_element" should not contain "quick-links-menu" + And the "class" attribute of "//div[@class='bottom-navigation']//a[contains(normalize-space(.), 'Quick links')]//.." "xpath_element" should contain "quick-links" @javascript Scenario: Smartmenu: Menus: Presentation - Use different styles for a smart menu