Search in sources :

Example 26 with TestBenchElement

use of com.vaadin.testbench.TestBenchElement in project flow by vaadin.

the class AbstractUpdateDivIT method getUpdateCount.

private int getUpdateCount() {
    TestBenchElement div = $(TestBenchElement.class).id("push-update");
    String count = div.getText();
    return Integer.parseInt(count);
}
Also used : TestBenchElement(com.vaadin.testbench.TestBenchElement)

Example 27 with TestBenchElement

use of com.vaadin.testbench.TestBenchElement in project flow by vaadin.

the class CompositeIT method htmlImportOfContentLoaded.

@Test
public void htmlImportOfContentLoaded() {
    open();
    waitForElementPresent(By.id(CompositeView.COMPOSITE_PAPER_SLIDER));
    TestBenchElement paperSlider = (TestBenchElement) findElement(By.id(CompositeView.COMPOSITE_PAPER_SLIDER));
    Assert.assertEquals("100", paperSlider.getPropertyString("max"));
}
Also used : TestBenchElement(com.vaadin.testbench.TestBenchElement) Test(org.junit.Test) ChromeBrowserTest(com.vaadin.flow.testutil.ChromeBrowserTest)

Example 28 with TestBenchElement

use of com.vaadin.testbench.TestBenchElement in project flow by vaadin.

the class CustomCustomElementIT method clickOnButton_removeFromLayout.

@Test
public void clickOnButton_removeFromLayout() {
    TestBenchElement customElement = $("custom-custom-element").first();
    Assert.assertEquals("initial", customElement.getPropertyString("shadowRoot", "textContent"));
    findElement(By.tagName("button")).click();
    Assert.assertEquals("updated", customElement.getPropertyString("shadowRoot", "textContent"));
}
Also used : TestBenchElement(com.vaadin.testbench.TestBenchElement) Test(org.junit.Test) ChromeBrowserTest(com.vaadin.flow.testutil.ChromeBrowserTest)

Example 29 with TestBenchElement

use of com.vaadin.testbench.TestBenchElement in project flow by vaadin.

the class DnDIT method testCopyEffectElement_droppedToDeactivatedLane_noDrop.

@Test
public void testCopyEffectElement_droppedToDeactivatedLane_noDrop() {
    open();
    TestBenchElement boxElement = getBoxElement("COPY");
    dragBoxToLanes(boxElement, getLaneElement("COPY"), true);
    dragBoxToLanes(boxElement, getLaneElement("deactivated"), false);
}
Also used : TestBenchElement(com.vaadin.testbench.TestBenchElement) ChromeBrowserTest(com.vaadin.flow.testutil.ChromeBrowserTest) Test(org.junit.Test)

Example 30 with TestBenchElement

use of com.vaadin.testbench.TestBenchElement in project flow by vaadin.

the class DnDIT method testCopyEffectElement_disableElement_draggedNotPresent.

@Test
public void testCopyEffectElement_disableElement_draggedNotPresent() {
    open();
    TestBenchElement boxElement = getBoxElement("COPY");
    clickElementWithJs("button-disable-enable-drag-sources");
    Assert.assertTrue("Invalid enabled state found in drag source", boxElement.hasAttribute("disabled"));
    clearEvents();
    drag(boxElement);
    Assert.assertFalse(boxElement.hasClassName("v-dragged"));
}
Also used : TestBenchElement(com.vaadin.testbench.TestBenchElement) ChromeBrowserTest(com.vaadin.flow.testutil.ChromeBrowserTest) Test(org.junit.Test)

Aggregations

TestBenchElement (com.vaadin.testbench.TestBenchElement)154 Test (org.junit.Test)120 ChromeBrowserTest (com.vaadin.flow.testutil.ChromeBrowserTest)98 WebElement (org.openqa.selenium.WebElement)46 By (org.openqa.selenium.By)6 DivElement (com.vaadin.flow.component.html.testbench.DivElement)5 List (java.util.List)5 Assert (org.junit.Assert)5 SpanElement (com.vaadin.flow.component.html.testbench.SpanElement)4 ChromeDeviceTest (com.vaadin.flow.testutil.ChromeDeviceTest)4 NativeButtonElement (com.vaadin.flow.component.html.testbench.NativeButtonElement)3 File (java.io.File)3 Ignore (org.junit.Ignore)3 ButtonElement (com.vaadin.flow.component.button.testbench.ButtonElement)2 DevModeGizmoElement (com.vaadin.flow.testutil.DevModeGizmoElement)2 Optional (java.util.Optional)2 JavascriptExecutor (org.openqa.selenium.JavascriptExecutor)2 WebDriver (org.openqa.selenium.WebDriver)2 ParagraphElement (com.vaadin.flow.component.html.testbench.ParagraphElement)1 TextFieldElement (com.vaadin.flow.component.textfield.testbench.TextFieldElement)1