use of com.vaadin.testbench.TestBenchElement in project flow by vaadin.
the class UpdatableModelPropertiesIT method assertNoUpdate.
private void assertNoUpdate(String unexpectedValue) {
waitUpdate();
TestBenchElement template = $(TestBenchElement.class).id("template");
WebElement value = template.$(TestBenchElement.class).id("property-value");
Assert.assertNotEquals(unexpectedValue, value.getText());
}
use of com.vaadin.testbench.TestBenchElement in project flow by vaadin.
the class UpdatableModelPropertiesIT method assertUpdate.
private void assertUpdate(String expectedValue) {
waitUpdate();
TestBenchElement template = $(TestBenchElement.class).id("template");
WebElement value = template.$(TestBenchElement.class).id("property-value");
Assert.assertEquals(expectedValue, value.getText());
}
use of com.vaadin.testbench.TestBenchElement in project flow by vaadin.
the class TwoWayPolymerBindingIT method initialModelValueIsPresentAndModelUpdatesNormally.
@Test
public void initialModelValueIsPresentAndModelUpdatesNormally() {
open();
TestBenchElement template = $(TestBenchElement.class).id("template");
WebElement input = template.$(TestBenchElement.class).id("input");
// The initial client-side value should be sent from the client to the
// model
waitUntil(driver -> "Value: foo".equals(getStatusMessage()));
// now make explicit updates from the client side
input.clear();
input.sendKeys("a");
Assert.assertEquals("Value: a", getStatusMessage());
input.sendKeys("b");
Assert.assertEquals("Value: ab", getStatusMessage());
// Reset the model value from the server-side
template.$(TestBenchElement.class).id("reset").click();
Assert.assertEquals("Value:", getStatusMessage());
Assert.assertEquals("", getValueProperty(input));
input.sendKeys("c");
Assert.assertEquals("Value: c", getStatusMessage());
}
use of com.vaadin.testbench.TestBenchElement in project flow by vaadin.
the class ListInsideListBindingIT method checkMessagesRemoval.
private void checkMessagesRemoval(TestBenchElement template, int initialSize) {
for (int i = 0; i < initialSize; i++) {
List<TestBenchElement> currentMessages = template.$(TestBenchElement.class).attribute("class", "submsg").all();
Assert.assertEquals("Wrong amount of nested messages", initialSize - i, currentMessages.size());
WebElement messageToRemove = currentMessages.iterator().next();
String messageToRemoveText = messageToRemove.getText();
messageToRemove.click();
String removedMessageLabelText = template.$(TestBenchElement.class).id("removedMessage").getText();
Assert.assertEquals("Expected removed message text to appear", "Removed message: " + messageToRemoveText, removedMessageLabelText);
}
}
use of com.vaadin.testbench.TestBenchElement in project flow by vaadin.
the class ListInsideListBindingIT method listDataBinding.
@Test
public void listDataBinding() {
int initialSize = 4;
open();
TestBenchElement template = $(TestBenchElement.class).id("template");
checkMessagesRemoval(template, initialSize);
template.$(TestBenchElement.class).id("reset").click();
checkAllElementsUpdated(template, initialSize);
}
Aggregations