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 9e083a7117..7fec6221a3 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 @@ -17,6 +17,7 @@ */ package org.keycloak.testsuite.console.page.users; +import org.openqa.selenium.By; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; @@ -77,15 +78,15 @@ public class Users extends AdminConsoleRealm { } public void editUser(String username) { - clickRowActionButton(getRowByLinkText(username), EDIT); + clickRowActionButton(getRowByUsername(username), EDIT); } public void impersonateUser(String username) { - clickRowActionButton(getRowByLinkText(username), IMPERSONATE); + clickRowActionButton(getRowByUsername(username), IMPERSONATE); } public void deleteUser(String username) { - clickRowActionButton(getRowByLinkText(username), DELETE); + clickRowActionButton(getRowByUsername(username), DELETE); modalDialog.confirmDeletion(); } @@ -132,6 +133,14 @@ public class Users extends AdminConsoleRealm { return users; } + protected WebElement getRowByUsername(String userName) { + WebElement row = body().findElement( + By.xpath(".//tr[./td/following::td[text()='" + userName + "']]") + ); + waitUntilElement(row).is().present(); + return row; + } + } } diff --git a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/realm/SecurityDefensesTest.java b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/realm/SecurityDefensesTest.java index 72bcd7f6d4..5792a739b0 100644 --- a/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/realm/SecurityDefensesTest.java +++ b/testsuite/integration-arquillian/tests/other/console/src/test/java/org/keycloak/testsuite/console/realm/SecurityDefensesTest.java @@ -173,7 +173,7 @@ public class SecurityDefensesTest extends AbstractRealmTest { } private void assertFeedbackText(String text) { - waitUntilElement(feedbackTextElement); + waitUntilElement(feedbackTextElement).is().present(); assertEquals(text, feedbackTextElement.getText()); }