From 17a6f94749ddedefd22383d8b9cf37db3d1df90b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Massart?= Date: Wed, 28 Sep 2016 11:50:09 +0200 Subject: [PATCH] MDL-55071 behat: Action menus can be opened without Javascript Standard action menus expand automatically when Javascript is disabled thus there is no need to open them. In Boost, they expand when they're hovered or when the focus is set on their trigger. --- lib/tests/behat/behat_action_menu.php | 3 ++- .../boost/tests/behat/behat_theme_boost_behat_action_menu.php | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/tests/behat/behat_action_menu.php b/lib/tests/behat/behat_action_menu.php index a602cc961d4..d90900d8465 100644 --- a/lib/tests/behat/behat_action_menu.php +++ b/lib/tests/behat/behat_action_menu.php @@ -50,7 +50,8 @@ class behat_action_menu extends behat_base { */ public function i_open_the_action_menu_in($element, $selectortype) { if (!$this->running_javascript()) { - throw new DriverException('Open the action menu step is not available with Javascript disabled'); + // Action menus automatically expand in a visible list of actions when Javascript is disabled. + return; } // Gets the node based on the requested selector type and locator. $node = $this->get_node_in_container("css_element", "[role=menuitem][aria-haspopup=true]", $selectortype, $element); diff --git a/theme/boost/tests/behat/behat_theme_boost_behat_action_menu.php b/theme/boost/tests/behat/behat_theme_boost_behat_action_menu.php index 4fc07343a88..38746180083 100644 --- a/theme/boost/tests/behat/behat_theme_boost_behat_action_menu.php +++ b/theme/boost/tests/behat/behat_theme_boost_behat_action_menu.php @@ -38,9 +38,6 @@ require_once(__DIR__ . '/../../../../lib/tests/behat/behat_action_menu.php'); class behat_theme_boost_behat_action_menu extends behat_action_menu { public function i_open_the_action_menu_in($element, $selectortype) { - if (!$this->running_javascript()) { - throw new DriverException('Open the action menu step is not available with Javascript disabled'); - } // Gets the node based on the requested selector type and locator. $node = $this->get_node_in_container("css_element", "[role=button][aria-haspopup=true]", $selectortype, $element); $this->ensure_node_is_visible($node);