From 5bbb50fa6ef349518f502a3bd399f0708cb75674 Mon Sep 17 00:00:00 2001 From: Prasanna LMSACE Date: Tue, 19 Dec 2023 11:08:38 +0530 Subject: [PATCH] Test: Replace 'I should see "..." style "..." value "..."' Behat step in smart menus, solves #363 --- ...ehat_theme_boost_union_base_smartmenus.php | 25 ------------------- ...artmenusettings_menus_presentation.feature | 12 ++++----- 2 files changed, 6 insertions(+), 31 deletions(-) diff --git a/tests/behat/behat_theme_boost_union_base_smartmenus.php b/tests/behat/behat_theme_boost_union_base_smartmenus.php index ad583193432..69489151764 100644 --- a/tests/behat/behat_theme_boost_union_base_smartmenus.php +++ b/tests/behat/behat_theme_boost_union_base_smartmenus.php @@ -35,31 +35,6 @@ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class behat_theme_boost_union_base_smartmenus extends behat_base { - /** - * Verify the card size height. - * - * @Given /^I should see "(?P(?:[^"]|\\")*)" style "(?P(?:[^"]|\\")*)" value "(?P(?:[^"]|\\")*)"$/ - * @param string $selector - * @param string $rule - * @param string $value - */ - public function i_should_see_style_value($selector, $rule, $value) { - - // The DOM and the JS should be all ready and loaded. Running without spinning - // as this is a widely used step and we can not spend time here trying to see - // a DOM node that is not always there (at the moment clean is not even the - // default theme...). - $navbuttonjs = "return ( - Y.one('$selector') && - Y.one('$selector').getComputedStyle('$rule') !== $value - )"; - - // Adding an extra click we need to show the 'Log in' link. - if (!$this->evaluate_script($navbuttonjs)) { - return false; - } - return true; - } /** * Open the smart menu listing page. diff --git a/tests/behat/theme_boost_union_smartmenusettings_menus_presentation.feature b/tests/behat/theme_boost_union_smartmenusettings_menus_presentation.feature index dfef93de984..ad60ad49b7c 100644 --- a/tests/behat/theme_boost_union_smartmenusettings_menus_presentation.feature +++ b/tests/behat/theme_boost_union_smartmenusettings_menus_presentation.feature @@ -119,14 +119,14 @@ Feature: Configuring the theme_boost_union plugin on the "Smart menus" page, app And I click on "Smart menus" "link" in the "#page-navbar .breadcrumb" "css_element" And ".dropdown.nav-item.card-dropdown" "css_element" should exist in the ".primary-navigation" "css_element" And I click on "Quick links" "link" in the ".primary-navigation" "css_element" - Then I should see ".card-dropdown .dropdown-menu.show img" style "height" value "" + Then DOM element ".card-dropdown .dropdown-menu.show img" should have computed style "height" "" Examples: - | cardsize | height | - | Tiny (50px) | 50 | - | Small (100px) | 100 | - | Medium (150px) | 150 | - | Large (200px) | 200 | + | cardsize | height | + | Tiny (50px) | 50px | + | Small (100px) | 100px | + | Medium (150px) | 150px | + | Large (200px) | 200px | @javascript Scenario: Smartmenu: Menus: Presentation - Displays the card menu container in various overflow behaviors