Skip to content

Commit

Permalink
Test: Replace 'I should see "..." style "..." value "..."' Behat step…
Browse files Browse the repository at this point in the history
… in smart menus, solves #363
  • Loading branch information
prasanna-lmsace authored and abias committed Jan 13, 2024
1 parent 96ca7a5 commit 6ff3027
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 31 deletions.
25 changes: 0 additions & 25 deletions tests/behat/behat_theme_boost_union_base_smartmenus.php
Original file line number Diff line number Diff line change
Expand Up @@ -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<element>(?:[^"]|\\")*)" style "(?P<rule>(?:[^"]|\\")*)" value "(?P<value>(?:[^"]|\\")*)"$/
* @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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<height>"
Then DOM element ".card-dropdown .dropdown-menu.show img" should have computed style "height" "<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
Expand Down

0 comments on commit 6ff3027

Please sign in to comment.