Vaadin Flow Automated Test

Hi,

We are looking for a way to have automated UI testing on our vaadin flow application.

We did try couple of things with the Selenium chrome plugin, but with no success (the input entered within the fields was not recorded).

Does anyone here have some recommendations in that regard? With Selenium, or any other technologies that would fit, really :slight_smile:

Thanks a lot!

Hi,

What we (Vaadin) provide for this is TestBench which solves the problems you see with Selenium. The main features are

  • Automatically waits for server communication to end
  • Works with shadow roots
  • Provides testing API for each component

It allows you to write tests looking like

@Test
public void assertNotificationShown() {
  $(TextFieldElement.class).id("name").setValue("John Doe");
  $(ButtonElement.class).id("sayHello").click();
  Assert.assertEquals("Hello John Doe", $(NotificationElement.class).first().getText());
}