use of com.vaadin.testbench.TestBenchElement in project flow by vaadin.
the class DnDIT method testCopyEffectElement_disableTarget_dragOverTargetNotPresent.
@Test
public void testCopyEffectElement_disableTarget_dragOverTargetNotPresent() {
open();
TestBenchElement boxElement = getBoxElement("COPY");
TestBenchElement targetElement = getLaneElement("COPY");
clickElementWithJs("button-disable-enable-drop-targets");
Assert.assertTrue("Invalid enabled state found in drop target", targetElement.hasAttribute("disabled"));
dragElementOver(boxElement, targetElement);
Assert.assertFalse(targetElement.hasClassName("v-drag-over-target"));
}
use of com.vaadin.testbench.TestBenchElement in project flow by vaadin.
the class DnDIT method verifyDropEvent.
private void verifyDropEvent(int i, TestBenchElement boxElement, TestBenchElement laneElement) {
TestBenchElement eventlog = getEventlog(i);
String effectAllowed = boxElement.getText();
String dropEffect = laneElement.getText();
String expected = new StringBuilder().append(i).append(": Drop: ").append(effectAllowed).append(" ").append(dropEffect).toString();
Assert.assertEquals("Invalid drop event details", expected, eventlog.getText());
}
use of com.vaadin.testbench.TestBenchElement in project flow by vaadin.
the class DnDIT method testCopyEffectElement_droppedToAllLanes.
@Test
public void testCopyEffectElement_droppedToAllLanes() {
open();
TestBenchElement boxElement = getBoxElement("COPY");
// not testing with the lane that does not have drop effect set, because
// that just causes complex mocking logic and doesn't validate
// anything else
dragBoxToLanes(boxElement, getLaneElement("COPY"), true);
dragBoxToLanes(boxElement, getLaneElement("MOVE"), false);
dragBoxToLanes(boxElement, getLaneElement("LINK"), false);
dragBoxToLanes(boxElement, getLaneElement("NONE"), false);
}
use of com.vaadin.testbench.TestBenchElement in project flow by vaadin.
the class DnDIT method verifyStartEvent.
private void verifyStartEvent(int i, TestBenchElement boxElement) {
TestBenchElement eventlog = getEventlog(i);
String expected = new StringBuilder().append(i).append(": Start: ").append(boxElement.getText()).toString();
Assert.assertEquals("Invalid start event details", expected, eventlog.getText());
}
use of com.vaadin.testbench.TestBenchElement in project flow by vaadin.
the class ElementInitOrderIT method assertInitOrder.
private void assertInitOrder() {
for (String name : Arrays.asList("init-order-polymer", "init-order-nopolymer")) {
TestBenchElement element = $(name).first();
String status = element.$(TestBenchElement.class).id("status").getText();
Assert.assertEquals("property = property, attribute = attribute, child count = 1, style = style, class = class", status);
}
}
Aggregations