From f5779bb101eee6335969ee8a153531e1997e432e Mon Sep 17 00:00:00 2001 From: David Monllao Date: Wed, 18 Apr 2018 13:52:58 +0200 Subject: [PATCH] MDL-56511 theme_boost: Fixing minor behat failures Related to MDL-56511 markup changes. --- auth/tests/behat/displayloginfailures.feature | 8 ++++---- theme/boost/templates/navbar.mustache | 2 +- .../tests/behat/behat_theme_boost_behat_navigation.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/auth/tests/behat/displayloginfailures.feature b/auth/tests/behat/displayloginfailures.feature index e617efac179..50b9ec63c26 100644 --- a/auth/tests/behat/displayloginfailures.feature +++ b/auth/tests/behat/displayloginfailures.feature @@ -25,11 +25,11 @@ Feature: Test the 'showlogfailures' feature works. And I set the field "Password" to "teacher1" And I press "Log in" # Confirm the notices are displayed. - Then I should see "1 failed logins since your last login" in the "header.navbar" "css_element" + Then I should see "1 failed logins since your last login" in the "nav.navbar" "css_element" And I should see "1 failed logins since your last login" in the "page-footer" "region" # Confirm the notices disappear when navigating to another page. And I am on homepage - And I should not see "1 failed logins since your last login" in the "header.navbar" "css_element" + And I should not see "1 failed logins since your last login" in the "nav.navbar" "css_element" And I should not see "1 failed logins since your last login" in the "page-footer" "region" # Given the user has at least one failed login attempt, when they login, then they should see both header and footer notices. @@ -46,10 +46,10 @@ Feature: Test the 'showlogfailures' feature works. And I set the field "Password" to "admin" And I press "Log in" # Confirm the notices are displayed. - Then I should see "1 failed logins since your last login" in the "header.navbar" "css_element" + Then I should see "1 failed logins since your last login" in the "nav.navbar" "css_element" And I should see "1 failed logins since your last login (Logs)" in the "page-footer" "region" # Confirm that the link works and that the notices disappear when navigating to another page. And I click on "Logs" "link" in the "page-footer" "region" And I should see "User login failed" in the "table.reportlog" "css_element" - And I should not see "1 failed logins since your last login" in the "header.navbar" "css_element" + And I should not see "1 failed logins since your last login" in the "nav.navbar" "css_element" And I should not see "1 failed logins since your last login (Logs)" in the "page-footer" "region" diff --git a/theme/boost/templates/navbar.mustache b/theme/boost/templates/navbar.mustache index 4f5dbf647f4..84d1d655736 100644 --- a/theme/boost/templates/navbar.mustache +++ b/theme/boost/templates/navbar.mustache @@ -51,7 +51,7 @@ {{{ output.navbar_plugin_output }}} - diff --git a/theme/boost/tests/behat/behat_theme_boost_behat_navigation.php b/theme/boost/tests/behat/behat_theme_boost_behat_navigation.php index ca92aaa16c1..ad08c8329c1 100644 --- a/theme/boost/tests/behat/behat_theme_boost_behat_navigation.php +++ b/theme/boost/tests/behat/behat_theme_boost_behat_navigation.php @@ -40,7 +40,7 @@ class behat_theme_boost_behat_navigation extends behat_navigation { if ($this->running_javascript()) { // The user menu must be expanded when JS is enabled. - $xpath = "//li[contains(concat(' ', @class, ' '), ' usermenu ')]//a[contains(concat(' ', @class, ' '), ' dropdown-toggle ')]"; + $xpath = "//div[contains(concat(' ', @class, ' '), ' usermenu ')]//a[contains(concat(' ', @class, ' '), ' dropdown-toggle ')]"; $this->execute("behat_general::i_click_on", array($this->escape($xpath), "xpath_element")); }