use of org.xwiki.user.directory.test.po.UserDirectoryPage in project xwiki-platform by xwiki.
the class UserDirectoryTest method verifyUserIsListed.
@Test
public void verifyUserIsListed() {
// Delete possible existing user
getUtil().deletePage("XWiki", "test");
UserDirectoryPage page = UserDirectoryPage.gotoPage();
// Verify that the user directory is empty when there's no user in the wiki
LiveTableElement liveTableElement = page.getUserDirectoryLiveTable();
assertEquals(0, liveTableElement.getRowCount());
// Add a user and verify it's visible in the livetable
getUtil().createUserAndLogin("test", "testtest", "first_name", "John", "last_name", "Doe");
// Go back to the user directory page since the user creation navigated to another page
page = UserDirectoryPage.gotoPage();
assertEquals(1, liveTableElement.getRowCount());
assertTrue(liveTableElement.hasRow("User ID", "test"));
assertTrue(liveTableElement.hasRow("First Name", "John"));
assertTrue(liveTableElement.hasRow("Last Name", "Doe"));
// Log out to verify the livetable works in guest view too
getUtil().forceGuestUser();
assertEquals(1, liveTableElement.getRowCount());
assertTrue(liveTableElement.hasRow("User ID", "test"));
assertTrue(liveTableElement.hasRow("First Name", "John"));
assertTrue(liveTableElement.hasRow("Last Name", "Doe"));
}
Aggregations