From b41dd22ed3517faa20b63f0cc3687386c4b35264 Mon Sep 17 00:00:00 2001 From: Vaclav Muzikar Date: Tue, 16 Feb 2016 13:46:11 +0100 Subject: [PATCH] Fix DefaultRolesTest (cherry picked from commit 6e7470d) --- .../org/keycloak/testsuite/console/page/users/User.java | 7 +++++++ .../org/keycloak/testsuite/console/page/users/Users.java | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/User.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/User.java index 7cea05cd9f..3b73ea1de1 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/User.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/User.java @@ -5,6 +5,8 @@ import static org.keycloak.testsuite.console.page.fragment.Breadcrumb.BREADCRUMB import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import static org.keycloak.testsuite.util.WaitUtils.*; + /** * * @author tkyjovsk @@ -54,22 +56,27 @@ public class User extends Users { private WebElement sessionsLink; public void attributes() { + waitUntilElement(attributesLink).is().present(); attributesLink.click(); } public void credentials() { + waitUntilElement(consentsLink).is().present(); credentialsLink.click(); } public void roleMappings() { + waitUntilElement(roleMappingsLink).is().present(); roleMappingsLink.click(); } public void consents() { + waitUntilElement(consentsLink).is().present(); consentsLink.click(); } public void sessions() { + waitUntilElement(sessionsLink).is().present(); sessionsLink.click(); } diff --git a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/Users.java b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/Users.java index 7fec6221a3..ef6b1957d0 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/Users.java +++ b/testsuite/integration-arquillian/tests/other/console/src/main/java/org/keycloak/testsuite/console/page/users/Users.java @@ -74,7 +74,10 @@ public class Users extends AdminConsoleRealm { public void clickUser(String username) { waitUntilElement(body()).is().present(); - body().findElement(linkText(username)).click(); + WebElement link = body().findElement( + By.xpath(".//tr/td[./following::td[text()='" + username + "']]/a") + ); + link.click(); } public void editUser(String username) {