diff --git a/vaadin-platform-react-hybrid-test/src/main/java/com/vaadin/platform/react/test/views/FlowHillaView.java b/vaadin-platform-react-hybrid-test/src/main/java/com/vaadin/platform/react/test/views/FlowHillaView.java index 814f9e544..605e9e314 100644 --- a/vaadin-platform-react-hybrid-test/src/main/java/com/vaadin/platform/react/test/views/FlowHillaView.java +++ b/vaadin-platform-react-hybrid-test/src/main/java/com/vaadin/platform/react/test/views/FlowHillaView.java @@ -17,6 +17,7 @@ public class FlowHillaView extends HorizontalLayout { private Button sayHello; public FlowHillaView() { + setId("flow-hilla"); setPadding(true); setSpacing(true); name = new TextField("Your name for Flow"); diff --git a/vaadin-platform-react-hybrid-test/src/main/java/com/vaadin/platform/react/test/views/FlowMainView.java b/vaadin-platform-react-hybrid-test/src/main/java/com/vaadin/platform/react/test/views/FlowMainView.java index 98300d2e9..89c415976 100644 --- a/vaadin-platform-react-hybrid-test/src/main/java/com/vaadin/platform/react/test/views/FlowMainView.java +++ b/vaadin-platform-react-hybrid-test/src/main/java/com/vaadin/platform/react/test/views/FlowMainView.java @@ -7,6 +7,8 @@ @Route("flow") public class FlowMainView extends VerticalLayout { public FlowMainView() { - add(new Span("Flow root view for menu!")); + Span span = new Span("Flow root view for menu!"); + span.setId("flow-main"); + add(span); } } diff --git a/vaadin-platform-react-hybrid-test/src/test/java/com/vaadin/platform/react/test/FlowInHillaIT.java b/vaadin-platform-react-hybrid-test/src/test/java/com/vaadin/platform/react/test/FlowInHillaIT.java new file mode 100644 index 000000000..f0b1701de --- /dev/null +++ b/vaadin-platform-react-hybrid-test/src/test/java/com/vaadin/platform/react/test/FlowInHillaIT.java @@ -0,0 +1,31 @@ +package com.vaadin.platform.react.test; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.support.ui.ExpectedConditions; + +import com.vaadin.flow.component.sidenav.testbench.SideNavItemElement; + +public class FlowInHillaIT extends AbstractPlatformTest{ + + @Test + public void flowViewInHillaLayout() { + Assert.assertNotNull(findElement(By.id("hilla"))); + + // Navigate to Flow view + $(SideNavItemElement.class).withCaption("Flow in hilla").first().click(); + + waitUntil(ExpectedConditions.presenceOfElementLocated(By.id("flow-hilla"))); + + Assert.assertNull("Showing hilla placeholder even though Flow should be shown", findElement(By.id("placeholder"))); + + // navigate away from Flow view + $(SideNavItemElement.class).withCaption("React Components").first().click(); + } + + @Override + protected String getTestPath() { + return "/hilla"; + } +} diff --git a/vaadin-platform-react-hybrid-test/src/test/java/com/vaadin/platform/react/test/HillaInFlowIT.java b/vaadin-platform-react-hybrid-test/src/test/java/com/vaadin/platform/react/test/HillaInFlowIT.java new file mode 100644 index 000000000..ce50a685c --- /dev/null +++ b/vaadin-platform-react-hybrid-test/src/test/java/com/vaadin/platform/react/test/HillaInFlowIT.java @@ -0,0 +1,31 @@ +package com.vaadin.platform.react.test; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.support.ui.ExpectedConditions; + +import com.vaadin.flow.component.sidenav.testbench.SideNavItemElement; + +public class HillaInFlowIT extends AbstractPlatformTest{ + + @Test + public void hillaViewInFlowLayout() { + waitUntil(ExpectedConditions.presenceOfElementLocated(By.id("flow-main"))); + + // Navigate to Flow view + $(SideNavItemElement.class).withCaption("Flow in hilla").first().click(); + + waitUntil(ExpectedConditions.presenceOfElementLocated(By.id("flow-hilla"))); + + Assert.assertNull("Showing hilla placeholder even though Flow should be shown", findElement(By.id("placeholder"))); + + // navigate away from Flow view + $(SideNavItemElement.class).withCaption("React Components").first().click(); + } + + @Override + protected String getTestPath() { + return "/flow"; + } +}