use of com.github.mvysny.kaributesting.v8.LocatorJ._click in project ANNIS by korpling.
the class AnnisUITest method tokenSearchDialog.
@Test
void tokenSearchDialog() throws Exception {
executeTokenSearch("dialog.demo", 102, 1);
// Test that there is a grid visualizer
SingleResultPanel resultPanel = _find(SingleResultPanel.class).get(0);
GridComponent gridVis = _get(resultPanel, GridComponent.class, spec -> spec.withPredicate(g -> !(g instanceof KWICComponent)));
AnnotationGrid annoGrid = _get(gridVis, AnnotationGrid.class);
ArrayList<Row> tokens = annoGrid.getRowsByAnnotation().get("default_ns::norm0");
assertEquals(1, tokens.size());
assertEquals(Arrays.asList("äh", "fang", "einfach", "mal", "an"), tokens.get(0).getEvents().stream().map(GridEvent::getValue).collect(Collectors.toList()));
// Open the video visualizer and check that media component is loaded
Button btOpenVisualizer = _get(resultPanel, Button.class, spec -> spec.withCaption("video"));
_click(btOpenVisualizer);
awaitCondition(120, () -> !_find(resultPanel, MediaElementPlayer.class).isEmpty());
MediaElementPlayer player = _get(resultPanel, MediaElementPlayer.class, spec -> spec.withCount(1));
assertEquals("video/webm", player.getState().getMimeType());
assertEquals("/Binary?file=dialog.demo%2Fdialog.demo%2Fdialog.demo.webm&toplevelCorpusName=dialog.demo", player.getState().getResourceURL());
// Close the visualizer again
_click(btOpenVisualizer);
awaitCondition(120, () -> _find(resultPanel, MediaElementPlayer.class).isEmpty());
}
use of com.github.mvysny.kaributesting.v8.LocatorJ._click in project ANNIS by korpling.
the class ExportPanelTest method testCSVExport.
@Test
void testCSVExport() throws Exception {
// Prepare query
ui.getQueryState().setSelectedCorpora(Sets.newHashSet("pcc2"));
ui.getQueryState().getAql().setValue("tok=\"Feigenblatt\"");
// Click on the "More" button and then "Export"
PopupButton moreButton = _get(PopupButton.class, spec -> spec.withCaption("More"));
moreButton.setPopupVisible(true);
_click(_get(Button.class, spec -> spec.withCaption("Export")));
// Make sure the Export tab is there
ExportPanel panel = _get(ExportPanel.class);
// The download button should be disabled
Button downloadButton = _get(panel, Button.class, spec -> spec.withCaption("Download"));
assertFalse(downloadButton.isEnabled());
// Click on "Perform Export" button, wait until export is finished and download button is
// enabled
_click(_get(panel, Button.class, spec -> spec.withCaption("Perform Export")));
TestHelper.awaitCondition(30, downloadButton::isEnabled);
}
use of com.github.mvysny.kaributesting.v8.LocatorJ._click in project ANNIS by korpling.
the class MigrationPanelTest method showMigrationPanel.
private void showMigrationPanel() {
_click(_get(Button.class, spec -> spec.withCaption("Administration")));
TabSheet tab = _get(TabSheet.class);
panel = _get(MigrationPanel.class);
tab.setSelectedTab(panel);
}
Aggregations