use of com.vaadin.flow.testutil.DevModeGizmoElement in project flow by vaadin.
the class PreserveOnRefreshLiveReloadIT method notificationShownWhenLoadingPreserveOnRefreshView.
@Test
public void notificationShownWhenLoadingPreserveOnRefreshView() {
open();
DevModeGizmoElement liveReload = $(DevModeGizmoElement.class).waitForFirst();
WebElement messageDetails = liveReload.$("*").attributeContains("class", "warning").first();
Assert.assertTrue(messageDetails.getText().contains("@PreserveOnRefresh"));
}
use of com.vaadin.flow.testutil.DevModeGizmoElement in project flow by vaadin.
the class DependencyIT method loadingUnavailableResources.
@Test
public void loadingUnavailableResources() throws IOException {
open();
findElement(By.id("loadUnavailableResources")).click();
DevModeGizmoElement gizmo = $(DevModeGizmoElement.class).first();
gizmo.waitForErrorMessage(s -> s.startsWith("Error loading http://") && s.endsWith("/not-found.css"));
gizmo.waitForErrorMessage(s -> s.startsWith("Error loading http://") && s.endsWith("/not-found.js"));
}
use of com.vaadin.flow.testutil.DevModeGizmoElement in project flow by vaadin.
the class DebugWindowErrorHandlingIT method clientSidePromiseRejectionReported.
@Test
public void clientSidePromiseRejectionReported() {
open();
clientSidePromiseRejection();
DevModeGizmoElement gizmo = $(DevModeGizmoElement.class).first();
gizmo.waitForErrorMessage(text -> text.matches("TypeError: Failed to fetch dynamically imported module: .*this-file-does-not-exist.js"));
}
use of com.vaadin.flow.testutil.DevModeGizmoElement in project flow by vaadin.
the class DebugWindowErrorHandlingIT method execJSExceptionReported.
@Test
public void execJSExceptionReported() {
open();
execJSException();
DevModeGizmoElement gizmo = $(DevModeGizmoElement.class).first();
gizmo.waitForErrorMessage(text -> text.equals("Exception is thrown during JavaScript execution. Stacktrace will be dumped separately."));
gizmo.waitForErrorMessage(text -> text.equals("The error has occurred in the JS code: 'null.foo'"));
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 FeatureIT method toggleViteFeature.
private void toggleViteFeature(boolean expectedInitialState) {
DevModeGizmoElement gizmo = $(DevModeGizmoElement.class).waitForFirst();
gizmo.expand();
gizmo.$(NativeButtonElement.class).id("features").click();
TestBenchElement toggleButton = gizmo.$(TestBenchElement.class).id("feature-toggle-viteForFrontendBuild");
String checked = getCommandExecutor().executeScript("return arguments[0].checked", toggleButton).toString();
Assert.assertEquals("Toggle button state expected " + expectedInitialState, Boolean.toString(expectedInitialState), checked);
toggleButton.click();
}
Aggregations