use of org.corpus_tools.annis.gui.resultview.SingleCorpusResultPanel in project ANNIS by korpling.
the class AnnisUITest method searchPccCorpusMatches.
@Test
void searchPccCorpusMatches() throws Exception {
selectCorpus("pcc2");
// Set the query and submit query
_get(AqlCodeEditor.class).getPropertyDataSource().setValue("URL");
MockVaadin.INSTANCE.clientRoundtrip();
awaitCondition(5, () -> "URL".equals(ui.getQueryState().getAql().getValue()));
awaitCondition(5, () -> "Valid query, click on \"Search\" to start searching.".equals(ui.getSearchView().getControlPanel().getQueryPanel().getLastPublicStatus()));
Button searchButton = _get(Button.class, spec -> spec.withCaption("Search"));
_click(searchButton);
// Wait until the count is displayed
String expectedStatus = "1 match\nin 1 document";
awaitCondition(60, () -> expectedStatus.equals(ui.getSearchView().getControlPanel().getQueryPanel().getLastPublicStatus()), () -> "Waited for status \"" + expectedStatus + "\" but was \"" + ui.getSearchView().getControlPanel().getQueryPanel().getLastPublicStatus() + "\"");
// Test that the special corpus result panel visualizer is shown
awaitCondition(30, () -> _find(SingleCorpusResultPanel.class).size() == 1);
List<SingleCorpusResultPanel> results = _find(SingleCorpusResultPanel.class);
assertNotNull(_get(results.get(0), Label.class, spec -> spec.withValue("Path: pcc2")));
assertNotNull(_get(results.get(0), Button.class, spec -> spec.withPredicate(b -> b.getIcon() == VaadinIcons.INFO_CIRCLE)));
// / The standard SingleResult panel should not be visible
assertEquals(0, _find(SingleResultPanel.class).size());
}
use of org.corpus_tools.annis.gui.resultview.SingleCorpusResultPanel in project ANNIS by korpling.
the class AnnisUITest method searchPccDocumentMatches.
@Test
void searchPccDocumentMatches() throws Exception {
selectCorpus("pcc2");
// Set the query and submit query
_get(AqlCodeEditor.class).getPropertyDataSource().setValue("Genre");
MockVaadin.INSTANCE.clientRoundtrip();
awaitCondition(5, () -> "Genre".equals(ui.getQueryState().getAql().getValue()));
awaitCondition(5, () -> "Valid query, click on \"Search\" to start searching.".equals(ui.getSearchView().getControlPanel().getQueryPanel().getLastPublicStatus()));
Button searchButton = _get(Button.class, spec -> spec.withCaption("Search"));
_click(searchButton);
// Wait until the count is displayed
String expectedStatus = "2 matches\nin 2 documents";
awaitCondition(60, () -> expectedStatus.equals(ui.getSearchView().getControlPanel().getQueryPanel().getLastPublicStatus()), () -> "Waited for status \"" + expectedStatus + "\" but was \"" + ui.getSearchView().getControlPanel().getQueryPanel().getLastPublicStatus() + "\"");
// Test that the special corpus result panel visualizer is shown
awaitCondition(30, () -> _find(SingleCorpusResultPanel.class).size() == 2);
List<SingleCorpusResultPanel> results = _find(SingleCorpusResultPanel.class);
assertNotNull(_get(results.get(0), Label.class, spec -> spec.withValue("Path: pcc2 > 11299")));
assertNotNull(_get(results.get(0), Button.class, spec -> spec.withPredicate(b -> b.getIcon() == VaadinIcons.INFO_CIRCLE)));
// The standard SingleResult panel should not be visible
assertEquals(0, _find(SingleResultPanel.class).size());
}
Aggregations