Search in sources :

Example 21 with LocatorJ._get

use of com.github.mvysny.kaributesting.v8.LocatorJ._get 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)

Example 22 with LocatorJ._get

use of com.github.mvysny.kaributesting.v8.LocatorJ._get 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);
}
Also used : BeforeEach(org.junit.jupiter.api.BeforeEach) Arrays(java.util.Arrays) TextField(com.vaadin.ui.TextField) TestHelper(org.corpus_tools.annis.gui.TestHelper) Date(java.util.Date) Autowired(org.springframework.beans.factory.annotation.Autowired) ActiveProfiles(org.springframework.test.context.ActiveProfiles) Algorithm(com.auth0.jwt.algorithms.Algorithm) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) CheckBox(com.vaadin.ui.CheckBox) MockWebServer(okhttp3.mockwebserver.MockWebServer) LocatorJ._get(com.github.mvysny.kaributesting.v8.LocatorJ._get) TextArea(com.vaadin.ui.TextArea) WebAppConfiguration(org.springframework.test.context.web.WebAppConfiguration) NotificationsKt(com.github.mvysny.kaributesting.v8.NotificationsKt) AnnisUI(org.corpus_tools.annis.gui.AnnisUI) LocatorJ._click(com.github.mvysny.kaributesting.v8.LocatorJ._click) Instant(java.time.Instant) Helper(org.corpus_tools.annis.gui.Helper) NotThreadSafe(net.jcip.annotations.NotThreadSafe) GrantedAuthority(org.springframework.security.core.GrantedAuthority) Test(org.junit.jupiter.api.Test) IOUtils(org.apache.commons.io.IOUtils) List(java.util.List) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) TabSheet(com.vaadin.ui.TabSheet) FinishedEvent(com.vaadin.ui.Upload.FinishedEvent) OAuth2User(org.springframework.security.oauth2.core.user.OAuth2User) Optional(java.util.Optional) UsernamePasswordAuthenticationToken(org.springframework.security.authentication.UsernamePasswordAuthenticationToken) MockResponse(okhttp3.mockwebserver.MockResponse) Authentication(org.springframework.security.core.Authentication) JWT(com.auth0.jwt.JWT) SimpleGrantedAuthority(org.springframework.security.core.authority.SimpleGrantedAuthority) StandardCharset(com.nimbusds.jose.util.StandardCharset) LinkedHashMap(java.util.LinkedHashMap) SingletonBeanStoreRetrievalStrategy(org.corpus_tools.annis.gui.SingletonBeanStoreRetrievalStrategy) MockVaadin(com.github.mvysny.kaributesting.v8.MockVaadin) UIScopeImpl(com.vaadin.spring.internal.UIScopeImpl) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) OutputStream(java.io.OutputStream) OidcIdToken(org.springframework.security.oauth2.core.oidc.OidcIdToken) SecurityConfiguration(org.corpus_tools.annis.gui.security.SecurityConfiguration) Upload(com.vaadin.ui.Upload) Assert.assertTrue(org.junit.Assert.assertTrue) IOException(java.io.IOException) DefaultOidcUser(org.springframework.security.oauth2.core.oidc.user.DefaultOidcUser) Button(com.vaadin.ui.Button) AfterEach(org.junit.jupiter.api.AfterEach) Assert.assertNull(org.junit.Assert.assertNull) ChronoUnit(java.time.temporal.ChronoUnit) BeanFactory(org.springframework.beans.factory.BeanFactory) Button(com.vaadin.ui.Button) TabSheet(com.vaadin.ui.TabSheet)

Aggregations

LocatorJ._get (com.github.mvysny.kaributesting.v8.LocatorJ._get)22 MockVaadin (com.github.mvysny.kaributesting.v8.MockVaadin)22 UIScopeImpl (com.vaadin.spring.internal.UIScopeImpl)22 AfterEach (org.junit.jupiter.api.AfterEach)22 BeforeEach (org.junit.jupiter.api.BeforeEach)22 Test (org.junit.jupiter.api.Test)22 BeanFactory (org.springframework.beans.factory.BeanFactory)22 Autowired (org.springframework.beans.factory.annotation.Autowired)22 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)22 ActiveProfiles (org.springframework.test.context.ActiveProfiles)22 WebAppConfiguration (org.springframework.test.context.web.WebAppConfiguration)22 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)21 LocatorJ._click (com.github.mvysny.kaributesting.v8.LocatorJ._click)18 LocatorJ._find (com.github.mvysny.kaributesting.v8.LocatorJ._find)18 Button (com.vaadin.ui.Button)18 ContentMode (com.vaadin.shared.ui.ContentMode)14 Label (com.vaadin.ui.Label)14 UI (com.vaadin.ui.UI)14 ArrayList (java.util.ArrayList)14 TestHelper.awaitCondition (org.corpus_tools.annis.gui.TestHelper.awaitCondition)14