Search in sources :

Example 11 with DevModeGizmoElement

use of com.vaadin.flow.testutil.DevModeGizmoElement in project flow by vaadin.

the class JavaLiveReloadIT method splashMessageShownOnAutoReloadAndClosedOnBodyClick.

@Test
public void splashMessageShownOnAutoReloadAndClosedOnBodyClick() {
    open();
    WebElement liveReloadTrigger = findElement(By.id(JavaLiveReloadView.JAVA_LIVE_RELOAD_TRIGGER_BUTTON));
    liveReloadTrigger.click();
    waitForLiveReload();
    DevModeGizmoElement liveReload = $(DevModeGizmoElement.class).waitForFirst();
    WebElement gizmo1 = liveReload.$("*").attributeContains("class", "gizmo").first();
    Assert.assertTrue(gizmo1.getAttribute("class").contains("active"));
    findElement(By.tagName("body")).click();
    DevModeGizmoElement liveReload2 = $(DevModeGizmoElement.class).waitForFirst();
    Assert.assertNotNull(liveReload2);
    WebElement gizmo2 = liveReload2.$("*").attributeContains("class", "gizmo").first();
    Assert.assertFalse(gizmo2.getAttribute("class").contains("active"));
    Assert.assertTrue(gizmo2.getAttribute("class").contains("gizmo"));
}
Also used : WebElement(org.openqa.selenium.WebElement) DevModeGizmoElement(com.vaadin.flow.testutil.DevModeGizmoElement) Test(org.junit.Test)

Example 12 with DevModeGizmoElement

use of com.vaadin.flow.testutil.DevModeGizmoElement in project flow by vaadin.

the class JavaLiveReloadIT method deactivateLiveReload.

@Test
public void deactivateLiveReload() {
    open();
    // given: live reload is deactivated
    DevModeGizmoElement gizmo = $(DevModeGizmoElement.class).waitForFirst();
    gizmo.setLiveReload(false);
    // when: live reload is triggered
    WebElement liveReloadTrigger = findElement(By.id(JavaLiveReloadView.JAVA_LIVE_RELOAD_TRIGGER_BUTTON));
    liveReloadTrigger.click();
    // then: page is not reloaded
    DevModeGizmoElement liveReload2 = $(DevModeGizmoElement.class).waitForFirst();
    WebElement gizmo2 = liveReload2.$("*").attributeContains("class", "gizmo").first();
    Assert.assertFalse(gizmo2.getAttribute("class").contains("active"));
    Assert.assertTrue(gizmo2.getAttribute("class").contains("gizmo"));
}
Also used : WebElement(org.openqa.selenium.WebElement) DevModeGizmoElement(com.vaadin.flow.testutil.DevModeGizmoElement) Test(org.junit.Test)

Example 13 with DevModeGizmoElement

use of com.vaadin.flow.testutil.DevModeGizmoElement in project flow by vaadin.

the class BasicsIT method debugWindowShown.

@Test
public void debugWindowShown() {
    DevModeGizmoElement gizmo = $(DevModeGizmoElement.class).waitForFirst();
    gizmo.expand();
    Assert.assertNotNull(gizmo.$("div").attributeContains("class", "window").attributeContains("class", "visible").waitForFirst());
}
Also used : DevModeGizmoElement(com.vaadin.flow.testutil.DevModeGizmoElement) Test(org.junit.Test)

Aggregations

DevModeGizmoElement (com.vaadin.flow.testutil.DevModeGizmoElement)13 Test (org.junit.Test)12 ChromeBrowserTest (com.vaadin.flow.testutil.ChromeBrowserTest)7 WebElement (org.openqa.selenium.WebElement)4 TestBenchElement (com.vaadin.testbench.TestBenchElement)2