Merge pull request #1932 from mhajas/fixDataTable
Fix xpath for rows in DataTable fragment
This commit is contained in:
commit
9f9067663f
2 changed files with 13 additions and 7 deletions
|
@ -1,12 +1,15 @@
|
|||
package org.keycloak.testsuite.console.page.fragment;
|
||||
|
||||
import org.openqa.selenium.By;
|
||||
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.waitUntilElement;
|
||||
import org.openqa.selenium.By;
|
||||
import static org.openqa.selenium.By.xpath;
|
||||
import org.openqa.selenium.WebElement;
|
||||
import org.openqa.selenium.support.FindBy;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -23,7 +26,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<WebElement> rows;
|
||||
|
||||
@FindBy
|
||||
|
|
|
@ -50,12 +50,15 @@ public class LoginEventsTest extends AbstractConsoleTest {
|
|||
loginEventsPage.navigateTo();
|
||||
loginEventsPage.table().filter();
|
||||
|
||||
List<WebElement> resultList = loginEventsPage.table().rows();
|
||||
assertEquals(3, resultList.size());
|
||||
|
||||
loginEventsPage.table().filterForm().addEventType("LOGIN");
|
||||
loginEventsPage.table().update();
|
||||
|
||||
List<WebElement> 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']"));
|
||||
|
|
Loading…
Reference in a new issue