From a535004e5c54689dc664d780b15900e1e6e19f83 Mon Sep 17 00:00:00 2001 From: Dan Poltawski Date: Tue, 30 Sep 2014 13:53:09 +0100 Subject: [PATCH] MDL-45893 behat: quick fix for usermenu logout button (This needs revisiting properly - I am not an xpath expert) --- auth/tests/behat/behat_auth.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/auth/tests/behat/behat_auth.php b/auth/tests/behat/behat_auth.php index e5a21ecbb6e..b32cb11f990 100644 --- a/auth/tests/behat/behat_auth.php +++ b/auth/tests/behat/behat_auth.php @@ -94,6 +94,10 @@ class behat_auth extends behat_base { // If it is needed, it expands the navigation bar with the 'Log out' link. if ($clicknavbar = $this->get_expand_navbar_step()) { array_unshift($steps, $clicknavbar); + } else { + // Otherwise we need to expand the the user menu. + $xpath ="//div[@class='usermenu']//a[contains(concat(' ', @class, ' '), ' toggle-display ')]"; + array_unshift($steps, new When('I click on "'.$xpath.'" "xpath_element"')); } return $steps; -- 2.43.0