MDL-45893 behat: quick fix for usermenu logout button
authorDan Poltawski <dan@moodle.com>
Tue, 30 Sep 2014 12:53:09 +0000 (13:53 +0100)
committerDan Poltawski <dan@moodle.com>
Tue, 30 Sep 2014 12:54:07 +0000 (13:54 +0100)
(This needs revisiting properly - I am not an xpath expert)

auth/tests/behat/behat_auth.php

index e5a21ec..b32cb11 100644 (file)
@@ -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;