use of org.xwiki.test.ui.po.LiveTableElement in project xwiki-platform by xwiki.
the class AllDocsPage method clickIndexTab.
public LiveTableElement clickIndexTab() {
this.indexTab.click();
LiveTableElement lt = new LiveTableElement("alldocs");
lt.waitUntilReady();
return lt;
}
use of org.xwiki.test.ui.po.LiveTableElement in project xwiki-platform by xwiki.
the class AllDocsPage method clickDeletedDocsTab.
public LiveTableElement clickDeletedDocsTab() {
this.deletedDocsTab.click();
LiveTableElement lt = new LiveTableElement("documentsTrash");
lt.waitUntilReady();
return lt;
}
use of org.xwiki.test.ui.po.LiveTableElement in project xwiki-platform by xwiki.
the class DocumentsMacroTest method testDocumentsMacro.
/**
* Verify that the {{documents}} macro works by going to the page defining this wiki macro since it contains
* an example usage and we can verify it displays the expected result.
*/
@Test
public void testDocumentsMacro() throws Exception {
// Create a dummy page in the Main space and having Main.WebHome as its parent so that it appears in the
// Documents Macro livetable (since the example lists pages in the Main space having Main.WebHome as their
// parent).
getUtil().createPage("Main", getTestMethodName(), "", "Test Title", "xwiki/2.1", "Main.WebHome");
DocumentsMacroPage dmp = DocumentsMacroPage.gotoPage();
LiveTableElement livetable = dmp.getDocumentsExampleLiveTable();
// Verify that we have a Page column
Assert.assertTrue("No Title column found", livetable.hasColumn("Title"));
// Verify there are several rows displayed
Assert.assertTrue(livetable.getRowCount() > 0);
// Verify that page titles are displayed by filtering on one page for which we know the title
livetable.filterColumn("xwiki-livetable-example-filter-2", getTestMethodName());
Assert.assertTrue(livetable.hasRow("Title", "Test Title"));
}
use of org.xwiki.test.ui.po.LiveTableElement in project xwiki-platform by xwiki.
the class UserDirectoryPage method getUserDirectoryLiveTable.
public LiveTableElement getUserDirectoryLiveTable() {
LiveTableElement lt = new LiveTableElement("userdirectory");
lt.waitUntilReady();
return lt;
}
use of org.xwiki.test.ui.po.LiveTableElement 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