use of org.corpus_tools.annis.gui.docbrowser.DocBrowserPanel in project ANNIS by korpling.
the class AnnisUITest method showDocumentRawText.
@Test
void showDocumentRawText() throws Exception {
UI.getCurrent().getNavigator().navigateTo("");
ui.getSearchView().getDocBrowserController().openDocBrowser("pcc2");
DocBrowserPanel panel = _get(DocBrowserPanel.class);
awaitCondition(120, () -> !_find(panel, DocBrowserTable.class).isEmpty());
DocBrowserTable docBrowserTable = _get(panel, DocBrowserTable.class);
List<Button> fullTextButtons = _find(docBrowserTable, Button.class, spec -> spec.withCaption("full text"));
assertEquals(2, fullTextButtons.size());
// Filter by the document name to reduce the number of buttons we can press
TextField textFilter = _get(panel, TextField.class);
_setValue(textFilter, "11299");
// Wait until filter is applied
awaitCondition(30, () -> _find(docBrowserTable, Button.class, spec -> spec.withCaption("full text")).size() == 1);
// Click on the button to open the full text visualization for the first document
_click(_get(docBrowserTable, Button.class, spec -> spec.withCaption("full text")));
Component rawTextPanel = ui.getSearchView().getTabSheet().getSelectedTab();
Tab selectedTab = ui.getSearchView().getTabSheet().getTab(rawTextPanel);
assertEquals("pcc2 > 11299 - ...", selectedTab.getCaption());
// Wait for label to appear
awaitCondition(20, () -> !_find(rawTextPanel, Label.class).isEmpty());
Label rawTextLabel = _get(rawTextPanel, Label.class);
assertTrue(rawTextLabel.getValue().startsWith("Feigenblatt Die Jugendlichen in Zossen wollen ein Musikcafé ."));
assertTrue(rawTextLabel.getValue().endsWith("Die glänzten diesmal noch mit Abwesenheit ."));
}
Aggregations