Search in sources :

Example 1 with ExportPanel

use of org.corpus_tools.annis.gui.ExportPanel 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);
}
Also used : WebAppConfiguration(org.springframework.test.context.web.WebAppConfiguration) BeforeEach(org.junit.jupiter.api.BeforeEach) AnnisUI(org.corpus_tools.annis.gui.AnnisUI) Autowired(org.springframework.beans.factory.annotation.Autowired) ActiveProfiles(org.springframework.test.context.ActiveProfiles) PopupButton(org.vaadin.hene.popupbutton.PopupButton) LocatorJ._click(com.github.mvysny.kaributesting.v8.LocatorJ._click) Sets(com.google.common.collect.Sets) Test(org.junit.jupiter.api.Test) MockVaadin(com.github.mvysny.kaributesting.v8.MockVaadin) Button(com.vaadin.ui.Button) AfterEach(org.junit.jupiter.api.AfterEach) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) BeanFactory(org.springframework.beans.factory.BeanFactory) UIScopeImpl(com.vaadin.spring.internal.UIScopeImpl) LocatorJ._get(com.github.mvysny.kaributesting.v8.LocatorJ._get) ExportPanel(org.corpus_tools.annis.gui.ExportPanel) ExportPanel(org.corpus_tools.annis.gui.ExportPanel) PopupButton(org.vaadin.hene.popupbutton.PopupButton) PopupButton(org.vaadin.hene.popupbutton.PopupButton) Button(com.vaadin.ui.Button) Test(org.junit.jupiter.api.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Aggregations

LocatorJ._click (com.github.mvysny.kaributesting.v8.LocatorJ._click)1 LocatorJ._get (com.github.mvysny.kaributesting.v8.LocatorJ._get)1 MockVaadin (com.github.mvysny.kaributesting.v8.MockVaadin)1 Sets (com.google.common.collect.Sets)1 UIScopeImpl (com.vaadin.spring.internal.UIScopeImpl)1 Button (com.vaadin.ui.Button)1 AnnisUI (org.corpus_tools.annis.gui.AnnisUI)1 ExportPanel (org.corpus_tools.annis.gui.ExportPanel)1 AfterEach (org.junit.jupiter.api.AfterEach)1 Assertions.assertFalse (org.junit.jupiter.api.Assertions.assertFalse)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 Test (org.junit.jupiter.api.Test)1 BeanFactory (org.springframework.beans.factory.BeanFactory)1 Autowired (org.springframework.beans.factory.annotation.Autowired)1 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)1 ActiveProfiles (org.springframework.test.context.ActiveProfiles)1 WebAppConfiguration (org.springframework.test.context.web.WebAppConfiguration)1 PopupButton (org.vaadin.hene.popupbutton.PopupButton)1