use of com.vaadin.flow.testutil.DevModeGizmoElement in project flow by vaadin.
the class DebugWindowFeatureFlagsIT method exampleFeatureFlagNotShown.
@Test
public void exampleFeatureFlagNotShown() {
open();
DevModeGizmoElement debugWindow = $(DevModeGizmoElement.class).first();
debugWindow.expand();
debugWindow.showExperimentalFeatures();
List<String> features = debugWindow.listExperimentalFeatures();
for (String feature : features) {
Assert.assertFalse("Example feature should not be shown in the debug window", feature.contains("Example feature"));
}
}
use of com.vaadin.flow.testutil.DevModeGizmoElement in project flow by vaadin.
the class DebugWindowErrorHandlingIT method clientSideErrorsReported.
@Test
public void clientSideErrorsReported() {
open();
clientSideError();
DevModeGizmoElement gizmo = $(DevModeGizmoElement.class).first();
gizmo.waitForErrorMessage(text -> text.equals("Client side error"));
Assert.assertTrue(gizmo.isExpanded());
}
use of com.vaadin.flow.testutil.DevModeGizmoElement in project flow by vaadin.
the class DebugWindowErrorHandlingIT method clientSideExceptionReported.
@Test
public void clientSideExceptionReported() {
open();
clientSideException();
DevModeGizmoElement gizmo = $(DevModeGizmoElement.class).first();
gizmo.waitForErrorMessage(text -> text.matches("Uncaught TypeError: Cannot read properties of null \\(reading 'foo'\\).*"));
}
use of com.vaadin.flow.testutil.DevModeGizmoElement in project flow by vaadin.
the class DebugWindowErrorHandlingIT method numberOfLogRowsLimited.
@Test
public void numberOfLogRowsLimited() {
open();
DevModeGizmoElement gizmo = $(DevModeGizmoElement.class).first();
gizmo.expand();
causeErrors("1001");
gizmo.waitForLastErrorMessageToMatch(msg -> msg.equals("Error 1001"));
Assert.assertEquals("Error 2", gizmo.getFirstErrorLogRow());
Assert.assertEquals("Error 1001", gizmo.getLastErrorLogRow());
Assert.assertEquals(1000, gizmo.getNumberOfErrorLogRows());
causeErrors("2");
gizmo.waitForLastErrorMessageToMatch(msg -> msg.equals("Error 2"));
Assert.assertEquals("Error 4", gizmo.getFirstErrorLogRow());
Assert.assertEquals("Error 2", gizmo.getLastErrorLogRow());
}
use of com.vaadin.flow.testutil.DevModeGizmoElement in project flow by vaadin.
the class JavaLiveReloadIT method overlayShouldRender.
@Test
public void overlayShouldRender() {
open();
// Upon opening, the LiveReloadUI should show the indicator but not the
// message window
DevModeGizmoElement liveReload = $(DevModeGizmoElement.class).waitForFirst();
TestBenchElement window = liveReload.$("*").attributeContains("class", "window").first();
Assert.assertFalse(window.isDisplayed());
// After clicking the icon in the indicator, the live-reload message
// window should appear
WebElement liveReloadIcon = liveReload.$("*").attributeContains("class", "gizmo").first();
liveReloadIcon.click();
waitForElementPresent(By.tagName("vaadin-devmode-gizmo"));
WebElement window2 = liveReload.$("*").attributeContains("class", "gizmo").first();
Assert.assertTrue(window2.isDisplayed());
}
Aggregations