use of com.vaadin.flow.component.textfield.testbench.TextFieldElement in project skeleton-starter-flow-spring by vaadin.
the class MainViewIT method testEnterShowsHelloUserNotificationWhenUserIsNotEmpty.
@Test
public void testEnterShowsHelloUserNotificationWhenUserIsNotEmpty() {
TextFieldElement textField = $(TextFieldElement.class).waitForFirst();
textField.setValue("Vaadiner");
textField.sendKeys(Keys.ENTER);
$(NotificationElement.class).waitForFirst();
Assert.assertTrue($(NotificationElement.class).exists());
NotificationElement notification = $(NotificationElement.class).first();
Assert.assertEquals("Hello Vaadiner", notification.getText());
}
use of com.vaadin.flow.component.textfield.testbench.TextFieldElement in project skeleton-starter-flow-spring by vaadin.
the class MainViewIT method testClickButtonShowsHelloUserNotificationWhenUserIsNotEmpty.
@Test
public void testClickButtonShowsHelloUserNotificationWhenUserIsNotEmpty() {
TextFieldElement textField = $(TextFieldElement.class).waitForFirst();
textField.setValue("Vaadiner");
$(ButtonElement.class).waitForFirst().click();
$(NotificationElement.class).waitForFirst();
Assert.assertTrue($(NotificationElement.class).exists());
NotificationElement notification = $(NotificationElement.class).first();
Assert.assertEquals("Hello Vaadiner", notification.getText());
}
use of com.vaadin.flow.component.textfield.testbench.TextFieldElement in project flow by vaadin.
the class SimpleIT method simplePage_withWhiteList_works.
@Test
public void simplePage_withWhiteList_works() {
TestBenchElement viewElement = $("simple-view").first();
ButtonElement button = viewElement.$(ButtonElement.class).id("button");
button.click();
TextFieldElement log = viewElement.$(TextFieldElement.class).id("log");
Assert.assertEquals(SimpleView.CLICKED_MESSAGE, log.getValue());
}
Aggregations