use of com.aire.ux.test.ViewTest 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);
}
use of com.aire.ux.test.ViewTest in project aire-components by aire-ux.
the class NavigationTest method ensureRouteIsAvailable.
@Order(2)
@ViewTest
@Navigate("main")
@Routes(scanClassPackage = MainLayout.class)
void ensureRouteIsAvailable(@Context TestContext context) {
val layout = context.selectFirst(MainLayout.class);
assertTrue(layout.isPresent());
}
use of com.aire.ux.test.ViewTest in project aire-components by aire-ux.
the class TopLevelVaadinTestCaseTest method ensureTestMethodGeneratesFrameWithCurrentMethod.
@ViewTest
@Navigate("test")
@Routes(scanPackage = "com.aire.ux.test.vaadin.scenarios.classroutes")
void ensureTestMethodGeneratesFrameWithCurrentMethod() throws NoSuchMethodException {
val method = Frames.resolveCurrentFrame().getContext().getTestMethod();
assertTrue(method.isPresent());
val m = method.get();
assertEquals(m, TopLevelVaadinTestCaseTest.class.getDeclaredMethod("ensureTestMethodGeneratesFrameWithCurrentMethod"));
}
use of com.aire.ux.test.ViewTest in project aire-components by aire-ux.
the class TopLevelVaadinTestCaseTest method ensureTestMethodGeneratesFrameWithCurrentMethod2.
@ViewTest
@Navigate("test")
@Routes(scanPackage = "com.aire.ux.test.vaadin.scenarios.classroutes")
void ensureTestMethodGeneratesFrameWithCurrentMethod2(@Select ClassScenarioRouteLayout layout) throws NoSuchMethodException {
val method = Frames.resolveCurrentFrame().getContext().getTestMethod();
assertTrue(method.isPresent());
val m = method.get();
assertEquals(m, TopLevelVaadinTestCaseTest.class.getDeclaredMethod("ensureTestMethodGeneratesFrameWithCurrentMethod2", ClassScenarioRouteLayout.class));
}
use of com.aire.ux.test.ViewTest in project aire-components by aire-ux.
the class AddVerticesRemoteActionTest method ensureConnectingNodesWorks.
@ViewTest
@DirtiesContext
void ensureConnectingNodesWorks(@View Canvas canvas) {
val source = new Vertex();
val target = new Vertex();
canvas.invoke(AddVerticesAction.class, List.of(source, target));
assertEquals(2, canvas.getModel().getVertices().size());
assertTrue(canvas.getModel().getEdges().isEmpty());
canvas.invoke(ConnectVerticesAction.class, List.of(new Edge(source.getId(), target.getId())));
assertEquals(1, canvas.getModel().getEdges().size());
}
Aggregations