diff --git a/forms/common-themes/src/main/resources/theme/base/admin/index.ftl b/forms/common-themes/src/main/resources/theme/base/admin/index.ftl index 0cdadfb0cb..f6bbfa5c2f 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/index.ftl +++ b/forms/common-themes/src/main/resources/theme/base/admin/index.ftl @@ -53,10 +53,10 @@ -
+
- diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/services.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/services.js index 3ca21832bd..4365291c72 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/services.js +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/services.js @@ -142,31 +142,32 @@ module.factory('Notifications', function($rootScope, $timeout) { var delay = 5000; var notifications = {}; + notifications.current = { display: false }; + notifications.current.remove = function() { + if (notifications.scheduled) { + $timeout.cancel(notifications.scheduled); + delete notifications.scheduled; + } + delete notifications.current.type; + delete notifications.current.header; + delete notifications.current.message; + notifications.current.display = false; + console.debug("Remove message"); + } - var scheduled = null; - var schedulePop = function() { - if (scheduled) { - $timeout.cancel(scheduled); - } - - scheduled = $timeout(function() { - $rootScope.notification = null; - scheduled = null; - }, delay); - }; - - if (!$rootScope.notifications) { - $rootScope.notifications = []; - } + $rootScope.notification = notifications.current; notifications.message = function(type, header, message) { - $rootScope.notification = { - type : type, - header: header, - message : message - }; + notifications.current.type = type; + notifications.current.header = header; + notifications.current.message = message; + notifications.current.display = true; - schedulePop(); + notifications.scheduled = $timeout(function() { + notifications.current.remove(); + }, delay); + + console.debug("Added message"); } notifications.info = function(message) { diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/authentication/Authentication.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/authentication/Authentication.java index 858de4093c..f15d37e063 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/authentication/Authentication.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/authentication/Authentication.java @@ -20,7 +20,7 @@ public class Authentication extends AdminConsoleRealm { @FindBy(xpath = "//div[contains(@class, 'alert-success')]") private WebElement success; - @FindBy(xpath = "//button[@class='close']/span") + @FindBy(id = "notification-close") private WebElement close; public String getSuccessMessage() { diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/console/authentication/OTPPolicyTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/console/authentication/OTPPolicyTest.java index 5e431bb5e8..2bd3a6b716 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/console/authentication/OTPPolicyTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/console/authentication/OTPPolicyTest.java @@ -67,7 +67,6 @@ public class OTPPolicyTest extends AbstractConsoleTest { } @Test - @Ignore //KEYCLOAK-2051 when you close notification, it is not displayed again public void invalidValuesTest() { otpPolicyPage.form().setValues(OTPType.TIME_BASED, OTPHashAlg.SHA1, Digits.SIX, "", "30"); assertEquals("Error! Missing or invalid field(s). Please verify the fields in red.", otpPolicyPage.getErrorMessage()); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/URLAssert.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/URLAssert.java index 255e450187..f4b043dd35 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/URLAssert.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/util/URLAssert.java @@ -47,7 +47,7 @@ public class URLAssert { // } // }; // wait.until(urlStartsWith); - assertTrue(startsWithNormalized(driver.getCurrentUrl(), url)); + assertTrue("'" + driver.getCurrentUrl() + " does not start with '" + url + "'", startsWithNormalized(driver.getCurrentUrl(), url)); } public static void assertCurrentUrlDoesntStartWith(AbstractPage page) {