From fbf00ba1cd7e20661956cd3040c258e981d8f2e7 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Fri, 15 Jul 2016 06:44:24 +0200 Subject: [PATCH] Added umlats test to registration test --- .../testsuite/forms/RegisterTest.java | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/RegisterTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/RegisterTest.java index 119e434f1e..ff1f66a32d 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/RegisterTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/forms/RegisterTest.java @@ -23,6 +23,7 @@ import org.keycloak.representations.idm.RealmRepresentation; import org.keycloak.representations.idm.UserRepresentation; import org.keycloak.testsuite.AssertEvents; import org.keycloak.testsuite.TestRealmKeycloakTest; +import org.keycloak.testsuite.pages.AccountUpdateProfilePage; import org.keycloak.testsuite.pages.AppPage; import org.keycloak.testsuite.pages.AppPage.RequestType; import org.keycloak.testsuite.pages.LoginPage; @@ -51,6 +52,9 @@ public class RegisterTest extends TestRealmKeycloakTest { @Page protected RegisterPage registerPage; + @Page + protected AccountUpdateProfilePage accountPage; + @Override public void configureTestRealm(RealmRepresentation testRealm) { } @@ -256,6 +260,32 @@ public class RegisterTest extends TestRealmKeycloakTest { assertEquals("lastName", user.getLastName()); } + @Test + public void registerUserUmlats() { + loginPage.open(); + + assertTrue(loginPage.isCurrent()); + + loginPage.clickRegister(); + registerPage.assertCurrent(); + + registerPage.register("Äǜṳǚǘǖ", "Öṏṏ", "registeruserumlats@email", "registeruserumlats", "password", "password"); + + String userId = events.expectRegister("registeruserumlats", "registeruserumlats@email").assertEvent().getUserId(); + events.expectLogin().detail("username", "registeruserumlats").user(userId).assertEvent(); + + accountPage.open(); + assertTrue(accountPage.isCurrent()); + + UserRepresentation user = getUser(userId); + Assert.assertNotNull(user); + assertEquals("Äǜṳǚǘǖ", user.getFirstName()); + assertEquals("Öṏṏ", user.getLastName()); + + assertEquals("Äǜṳǚǘǖ", accountPage.getFirstName()); + assertEquals("Öṏṏ", accountPage.getLastName()); + } + // KEYCLOAK-3266 @Test public void registerUserNotUsernamePasswordPolicy() {