Search in sources :

Example 11 with DivElement

use of com.vaadin.flow.component.html.testbench.DivElement in project flow by vaadin.

the class ElementInnerHtmlIT method setInnerHtmlAfterChangeVisibility.

@Test
public void setInnerHtmlAfterChangeVisibility() {
    open();
    DivElement innerHtml = $(DivElement.class).id("inner-html-field");
    $(NativeButtonElement.class).id("set-foo").click();
    Assert.assertEquals("<p>Foo</p>", innerHtml.getPropertyString("innerHTML"));
    $(NativeButtonElement.class).id("toggle-visibility").click();
    $(NativeButtonElement.class).id("set-boo").click();
    $(NativeButtonElement.class).id("set-foo").click();
    $(NativeButtonElement.class).id("toggle-visibility").click();
    Assert.assertEquals("<p>Foo</p>", innerHtml.getPropertyString("innerHTML"));
}
Also used : DivElement(com.vaadin.flow.component.html.testbench.DivElement) Test(org.junit.Test) ChromeBrowserTest(com.vaadin.flow.testutil.ChromeBrowserTest)

Example 12 with DivElement

use of com.vaadin.flow.component.html.testbench.DivElement in project flow by vaadin.

the class ElementStyleIT method customPropertiesWork.

@Test
public void customPropertiesWork() {
    open();
    DivElement red = $(DivElement.class).id("red-border");
    DivElement green = $(DivElement.class).id("green-border");
    Assert.assertEquals(ElementStyleView.RED_BORDER, executeScript("return getComputedStyle(arguments[0]).border", red));
    Assert.assertEquals(ElementStyleView.GREEN_BORDER, executeScript("return getComputedStyle(arguments[0]).border", green));
}
Also used : DivElement(com.vaadin.flow.component.html.testbench.DivElement) Test(org.junit.Test) ChromeBrowserTest(com.vaadin.flow.testutil.ChromeBrowserTest)

Aggregations

DivElement (com.vaadin.flow.component.html.testbench.DivElement)12 ChromeBrowserTest (com.vaadin.flow.testutil.ChromeBrowserTest)11 Test (org.junit.Test)11 NativeButtonElement (com.vaadin.flow.component.html.testbench.NativeButtonElement)2 WebElement (org.openqa.selenium.WebElement)2 LabelElement (com.vaadin.flow.component.html.testbench.LabelElement)1 ArrayList (java.util.ArrayList)1