diff --git a/testsuite/integration-arquillian/tests/other/base-ui/src/test/java/org/keycloak/testsuite/ui/account2/PersonalInfoTest.java b/testsuite/integration-arquillian/tests/other/base-ui/src/test/java/org/keycloak/testsuite/ui/account2/PersonalInfoTest.java index b59e281903..b6db6e40ce 100644 --- a/testsuite/integration-arquillian/tests/other/base-ui/src/test/java/org/keycloak/testsuite/ui/account2/PersonalInfoTest.java +++ b/testsuite/integration-arquillian/tests/other/base-ui/src/test/java/org/keycloak/testsuite/ui/account2/PersonalInfoTest.java @@ -153,6 +153,12 @@ public class PersonalInfoTest extends BaseAccountPageTest { personalInfoPage.navigateTo(); personalInfoPage.valuesEqual(testUser2); } + + @Test + public void clickLogoTest() { + personalInfoPage.clickBrandLink(); + accountWelcomeScreen.assertCurrent(); + } private void setEditUsernameAllowed(boolean value) { RealmRepresentation realm = testRealmResource().toRepresentation(); diff --git a/testsuite/integration-arquillian/tests/other/base-ui/src/test/java/org/keycloak/testsuite/ui/account2/WelcomeScreenTest.java b/testsuite/integration-arquillian/tests/other/base-ui/src/test/java/org/keycloak/testsuite/ui/account2/WelcomeScreenTest.java index 8d7f4d8065..9ddc1a51f9 100644 --- a/testsuite/integration-arquillian/tests/other/base-ui/src/test/java/org/keycloak/testsuite/ui/account2/WelcomeScreenTest.java +++ b/testsuite/integration-arquillian/tests/other/base-ui/src/test/java/org/keycloak/testsuite/ui/account2/WelcomeScreenTest.java @@ -73,6 +73,12 @@ public class WelcomeScreenTest extends AbstractAccountTest { personalInfoPage.assertCurrent(); } + @Test + public void clickLogoTest() { + accountWelcomeScreen.clickLogoImage(); + accountWelcomeScreen.assertCurrent(); + } + @Test public void accountSecurityTest() { // TODO rewrite this! (KEYCLOAK-12105) diff --git a/testsuite/integration-arquillian/tests/other/base-ui/src/test/java/org/keycloak/testsuite/ui/account2/page/AbstractLoggedInPage.java b/testsuite/integration-arquillian/tests/other/base-ui/src/test/java/org/keycloak/testsuite/ui/account2/page/AbstractLoggedInPage.java index 44a1387690..838cca2771 100644 --- a/testsuite/integration-arquillian/tests/other/base-ui/src/test/java/org/keycloak/testsuite/ui/account2/page/AbstractLoggedInPage.java +++ b/testsuite/integration-arquillian/tests/other/base-ui/src/test/java/org/keycloak/testsuite/ui/account2/page/AbstractLoggedInPage.java @@ -53,6 +53,9 @@ public abstract class AbstractLoggedInPage extends AbstractAccountPage { @FindBy(id = "refresh-page") private WebElement refreshPageBtn; + + @FindBy(id = "brandLink") + private WebElement brandLink; public AbstractLoggedInPage() { hashPath = new LinkedList<>(); @@ -113,6 +116,10 @@ public abstract class AbstractLoggedInPage extends AbstractAccountPage { clickLink(refreshPageBtn); } + public void clickBrandLink() { + clickLink(brandLink); + } + @Override public boolean isCurrent() { return super.isCurrent() && getPageId().equals(sidebar().getActiveNavId()); diff --git a/testsuite/integration-arquillian/tests/other/base-ui/src/test/java/org/keycloak/testsuite/ui/account2/page/WelcomeScreen.java b/testsuite/integration-arquillian/tests/other/base-ui/src/test/java/org/keycloak/testsuite/ui/account2/page/WelcomeScreen.java index 1ecac78a2a..90cf15b019 100644 --- a/testsuite/integration-arquillian/tests/other/base-ui/src/test/java/org/keycloak/testsuite/ui/account2/page/WelcomeScreen.java +++ b/testsuite/integration-arquillian/tests/other/base-ui/src/test/java/org/keycloak/testsuite/ui/account2/page/WelcomeScreen.java @@ -57,6 +57,8 @@ public class WelcomeScreen extends AbstractAccountPage { private WebElement myResourcesCard; @FindBy(xpath = "//*[@id='landingMyResourcesLink']/a") private WebElement myResourcesLink; + @FindBy(id = "landingLogo") + private WebElement logoLink; @FindBy(id = "landingWelcomeMessage") private WebElement welcomeMessage; // used only for i18n testing @@ -83,6 +85,10 @@ public class WelcomeScreen extends AbstractAccountPage { return header; } + public void clickLogoImage() { + clickLink(logoLink); + } + public void clickPersonalInfoLink() { clickLink(personalInfoLink); } diff --git a/themes/src/main/resources/theme/keycloak-preview/account/index.ftl b/themes/src/main/resources/theme/keycloak-preview/account/index.ftl index dba85177d7..11fa31aeee 100644 --- a/themes/src/main/resources/theme/keycloak-preview/account/index.ftl +++ b/themes/src/main/resources/theme/keycloak-preview/account/index.ftl @@ -26,6 +26,18 @@ var resourceUrl = '${resourceUrl}'; var isReactLoading = false; + <#if properties.logo?has_content> + var brandImg = resourceUrl + '${properties.logo}'; + <#else> + var brandImg = resourceUrl + '/public/logo.svg'; + #if> + + <#if properties.logoUrl?has_content> + var brandUrl = '${properties.logoUrl}'; + <#else> + var brandUrl = baseUrl; + #if> + var features = { isRegistrationEmailAsUsername : ${realm.registrationEmailAsUsername?c}, isEditUserNameAllowed : ${realm.editUsernameAllowed?c}, @@ -56,7 +68,11 @@ #if> + <#if properties.favIcon?has_content> + + <#else> + #if> @@ -127,7 +143,11 @@
${msg("loadingMessage")}