From b9c6d8932525bb66fdf13feb0210778df7474af3 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Thu, 22 Aug 2013 12:09:10 +0100 Subject: [PATCH] Added test for updating user profile --- .../org/keycloak/testsuite/AccountTest.java | 23 +++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/testsuite/src/test/java/org/keycloak/testsuite/AccountTest.java b/testsuite/src/test/java/org/keycloak/testsuite/AccountTest.java index 17ba285fe1..59c0776ed5 100644 --- a/testsuite/src/test/java/org/keycloak/testsuite/AccountTest.java +++ b/testsuite/src/test/java/org/keycloak/testsuite/AccountTest.java @@ -37,7 +37,7 @@ public class AccountTest extends AbstractDroneTest { registerUser("changePassword", "password"); selenium.open(authServerUrl + "/rest/realms/demo/account/password"); - selenium.waitForPageToLoad("10000"); + selenium.waitForPageToLoad(DEFAULT_WAIT); Assert.assertTrue(selenium.isTextPresent("Change Password")); @@ -45,7 +45,7 @@ public class AccountTest extends AbstractDroneTest { selenium.type("id=password-new", "newpassword"); selenium.type("id=password-confirm", "newpassword"); selenium.click("css=input[type=\"submit\"]"); - selenium.waitForPageToLoad("30000"); + selenium.waitForPageToLoad(DEFAULT_WAIT); logout(); @@ -53,4 +53,23 @@ public class AccountTest extends AbstractDroneTest { login("changePassword", "newpassword"); } + @Test + public void changeProfile() { + registerUser("changeProfile", "password"); + + selenium.open(authServerUrl + "/rest/realms/demo/account"); + selenium.waitForPageToLoad(DEFAULT_WAIT); + + selenium.type("id=firstName", "Newfirst"); + selenium.type("id=lastName", "Newlast"); + selenium.type("id=email", "new@email.com"); + + selenium.click("css=input[type=\"submit\"]"); + selenium.waitForPageToLoad(DEFAULT_WAIT); + + Assert.assertEquals("Newfirst", selenium.getValue("id=firstName")); + Assert.assertEquals("Newlast", selenium.getValue("id=lastName")); + Assert.assertEquals("new@email.com", selenium.getValue("id=email")); + } + }