From 4e228795042f2e4c41d9a5e8a3f2e336da77426c Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Thu, 3 May 2018 09:47:47 +0300 Subject: Fix usage of debug window in websocket test (#10868) --- .../com/vaadin/tests/integration/AbstractIntegrationTest.java | 6 +++--- .../integration/websocket/ServletIntegrationWebsocketIT.java | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'test') diff --git a/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/AbstractIntegrationTest.java b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/AbstractIntegrationTest.java index 21dca1cf57..90bec7ae48 100644 --- a/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/AbstractIntegrationTest.java +++ b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/AbstractIntegrationTest.java @@ -44,12 +44,12 @@ public abstract class AbstractIntegrationTest extends ParallelTest { testBench().resizeViewPortTo(SCREENSHOT_WIDTH, SCREENSHOT_HEIGHT); - openTestURL(); + openTestURL(getParameters()); } - private void openTestURL() { + protected void openTestURL(Stream parameters) { String url = getDeploymentURL() + getContextPath() + getTestPath() + "?" - + getParameters().collect(Collectors.joining("&")); + + parameters.collect(Collectors.joining("&")); driver.get(url); diff --git a/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/websocket/ServletIntegrationWebsocketIT.java b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/websocket/ServletIntegrationWebsocketIT.java index 3a722768e4..668f8611a4 100644 --- a/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/websocket/ServletIntegrationWebsocketIT.java +++ b/test/servlet-containers/generic-tests/src/main/java/com/vaadin/tests/integration/websocket/ServletIntegrationWebsocketIT.java @@ -36,6 +36,10 @@ public class ServletIntegrationWebsocketIT @Test public void testWebsockedUsed() { + // Reopen the page with debug window + openTestURL( + Stream.concat(getParameters(), Stream.of("debug")).distinct()); + // Make sure the correct debug window tab is open. findElements(By.className("v-debugwindow-tab")).get(1).click(); @@ -51,9 +55,4 @@ public class ServletIntegrationWebsocketIT assertEquals("Client to server: websocket, server to client: websocket", row.findElement(By.className("value")).getText()); } - - protected Stream getParameters() { - return Stream.concat(super.getParameters(), Stream.of("debug")) - .distinct(); - } } -- cgit v1.2.3