diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/DataTable.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/DataTable.java index d049d2eb06..f6bbb1c0ea 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/DataTable.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/console/page/fragment/DataTable.java @@ -1,13 +1,15 @@ package org.keycloak.testsuite.console.page.fragment; -import java.util.List; -import static org.keycloak.testsuite.util.WaitUtils.pause; -import static org.keycloak.testsuite.util.WaitUtils.waitAjaxForElement; import org.openqa.selenium.By; -import static org.openqa.selenium.By.xpath; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; +import java.util.List; + +import static org.keycloak.testsuite.util.WaitUtils.pause; +import static org.keycloak.testsuite.util.WaitUtils.waitAjaxForElement; +import static org.openqa.selenium.By.xpath; + /** * * @author tkyjovsk @@ -23,7 +25,7 @@ public class DataTable { private WebElement header; @FindBy(css = "tbody") private WebElement body; - @FindBy(css = "tbody tr.ng-scope") + @FindBy(xpath = "(//table)[1]/tbody/tr[@class='ng-scope']") private List rows; @FindBy diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/console/events/LoginEventsTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/console/events/LoginEventsTest.java index 5174acf733..b5cecd5af4 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/console/events/LoginEventsTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/console/events/LoginEventsTest.java @@ -50,12 +50,15 @@ public class LoginEventsTest extends AbstractConsoleTest { loginEventsPage.navigateTo(); loginEventsPage.table().filter(); + List resultList = loginEventsPage.table().rows(); + assertEquals(3, resultList.size()); + loginEventsPage.table().filterForm().addEventType("LOGIN"); loginEventsPage.table().update(); - List resultList = loginEventsPage.table().rows(); + resultList = loginEventsPage.table().rows(); - assertEquals(8, resultList.size()); + assertEquals(1, resultList.size()); resultList.get(0).findElement(By.xpath("//td[text()='LOGIN']")); resultList.get(0).findElement(By.xpath("//td[text()='User']/../td[text()='" + testUser.getId() + "']")); resultList.get(0).findElement(By.xpath("//td[text()='Client']/../td[text()='security-admin-console']")); @@ -67,7 +70,7 @@ public class LoginEventsTest extends AbstractConsoleTest { resultList = loginEventsPage.table().rows(); - assertEquals(2, resultList.size()); + assertEquals(1, resultList.size()); resultList.get(0).findElement(By.xpath("//td[text()='LOGOUT']")); resultList.get(0).findElement(By.xpath("//td[text()='User']/../td[text()='" + testUser.getId() + "']")); resultList.get(0).findElement(By.xpath("//td[text()='IP Address']/../td[text()='127.0.0.1']")); @@ -78,7 +81,7 @@ public class LoginEventsTest extends AbstractConsoleTest { resultList = loginEventsPage.table().rows(); - assertEquals(6, resultList.size()); + assertEquals(1, resultList.size()); resultList.get(0).findElement(By.xpath("//td[text()='LOGIN_ERROR']")); resultList.get(0).findElement(By.xpath("//td[text()='User']/../td[text()='" + testUser.getId() + "']")); resultList.get(0).findElement(By.xpath("//td[text()='Client']/../td[text()='security-admin-console']"));