Search in sources :

Example 1 with MainView

use of com.aire.ux.spring.test.scenario1.MainView in project aire-components by aire-ux.

the class ExploratorySpringTest method ensureInteractingWithElementWorks.

@ViewTest
@Navigate("main")
void ensureInteractingWithElementWorks(@Autowired ApplicationContext applicationContext, @Select(".main") Element initialView, @Select(".main > vaadin-button") Button button, @Context TestContext context) {
    assertNotNull(applicationContext);
    assertEquals(0, initialView.getComponent().map(component -> (MainView) component).orElseThrow().getCount());
    button.click();
    val view = context.selectFirst(".main", MainView.class).get();
    assertEquals(view.getCount(), 1);
}
Also used : ViewTest(com.aire.ux.test.ViewTest) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) Scenario1Configuration(com.aire.ux.spring.test.scenario1.Scenario1Configuration) AireTest(com.aire.ux.test.AireTest) lombok.val(lombok.val) Select(com.aire.ux.test.Select) Autowired(org.springframework.beans.factory.annotation.Autowired) EnableSpring(com.aire.ux.test.spring.EnableSpring) ApplicationContext(org.springframework.context.ApplicationContext) Context(com.aire.ux.test.Context) Inject(javax.inject.Inject) Test(org.junit.jupiter.api.Test) Navigate(com.aire.ux.test.Navigate) TestService(com.aire.ux.spring.test.scenario1.TestService) Button(com.vaadin.flow.component.button.Button) TestContext(com.aire.ux.test.TestContext) Routes(com.aire.ux.test.Routes) Element(com.vaadin.flow.dom.Element) ContextConfiguration(org.springframework.test.context.ContextConfiguration) MainView(com.aire.ux.spring.test.scenario1.MainView) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) lombok.val(lombok.val) MainView(com.aire.ux.spring.test.scenario1.MainView) ViewTest(com.aire.ux.test.ViewTest) Navigate(com.aire.ux.test.Navigate)

Aggregations

MainView (com.aire.ux.spring.test.scenario1.MainView)1 Scenario1Configuration (com.aire.ux.spring.test.scenario1.Scenario1Configuration)1 TestService (com.aire.ux.spring.test.scenario1.TestService)1 AireTest (com.aire.ux.test.AireTest)1 Context (com.aire.ux.test.Context)1 Navigate (com.aire.ux.test.Navigate)1 Routes (com.aire.ux.test.Routes)1 Select (com.aire.ux.test.Select)1 TestContext (com.aire.ux.test.TestContext)1 ViewTest (com.aire.ux.test.ViewTest)1 EnableSpring (com.aire.ux.test.spring.EnableSpring)1 Button (com.vaadin.flow.component.button.Button)1 Element (com.vaadin.flow.dom.Element)1 Inject (javax.inject.Inject)1 lombok.val (lombok.val)1 Assertions.assertEquals (org.junit.jupiter.api.Assertions.assertEquals)1 Assertions.assertNotNull (org.junit.jupiter.api.Assertions.assertNotNull)1 Test (org.junit.jupiter.api.Test)1 Autowired (org.springframework.beans.factory.annotation.Autowired)1 ApplicationContext (org.springframework.context.ApplicationContext)1