From 8c0e51d101cb7b5b8e43db78a9dafffa5157a346 Mon Sep 17 00:00:00 2001 From: Oleksii Korniienko Date: Thu, 2 Nov 2023 11:31:15 +0100 Subject: [PATCH] Updated RunRspConnectorsTests. Added verification for "Stop RSP". Signed-off-by: Oleksii Korniienko --- .../devtools/intellij/rsp/tests/AbstractRspServersTest.java | 5 +++++ .../devtools/intellij/rsp/tests/RunRspConnectorsTest.java | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/it/java/com/redhat/devtools/intellij/rsp/tests/AbstractRspServersTest.java b/src/it/java/com/redhat/devtools/intellij/rsp/tests/AbstractRspServersTest.java index 1b204e5..91551b0 100644 --- a/src/it/java/com/redhat/devtools/intellij/rsp/tests/AbstractRspServersTest.java +++ b/src/it/java/com/redhat/devtools/intellij/rsp/tests/AbstractRspServersTest.java @@ -21,4 +21,9 @@ public static boolean isRspServerStarted(ComponentFixture rspViewTree, int serve RemoteText server = rspViewTree.findAllText().get(serverNumber); return server.getText().contains("[STARTED]"); } + + public static boolean isRspServerStopped(ComponentFixture rspViewTree, int serverNumber){ + RemoteText server = rspViewTree.findAllText().get(serverNumber); + return server.getText().contains("[STOPPED]"); + } } diff --git a/src/it/java/com/redhat/devtools/intellij/rsp/tests/RunRspConnectorsTest.java b/src/it/java/com/redhat/devtools/intellij/rsp/tests/RunRspConnectorsTest.java index 7f27a6d..ae8be74 100644 --- a/src/it/java/com/redhat/devtools/intellij/rsp/tests/RunRspConnectorsTest.java +++ b/src/it/java/com/redhat/devtools/intellij/rsp/tests/RunRspConnectorsTest.java @@ -35,10 +35,16 @@ public static void runRspServers(RemoteRobot robot, ComponentFixture rspViewTree contextMenu.select("Download / Update RSP"); final IdeStatusBar ideStatusBar = robot.find(IdeStatusBar.class); ideStatusBar.waitUntilAllBgTasksFinish(); + rspViewTree.findAllText().get(serverNumber).click(MouseButton.RIGHT_BUTTON); contextMenu = robot.find(RightClickMenu.class, Duration.ofSeconds(10)); contextMenu.select("Start RSP"); waitFor(Duration.ofSeconds(15), Duration.ofSeconds(1), "Server did not started.", () -> isRspServerStarted(rspViewTree ,serverNumber)); + + rspViewTree.findAllText().get(serverNumber).click(MouseButton.RIGHT_BUTTON); + contextMenu = robot.find(RightClickMenu.class, Duration.ofSeconds(10)); + contextMenu.select("Stop RSP"); + waitFor(Duration.ofSeconds(15), Duration.ofSeconds(1), "Server did not stopped.", () -> isRspServerStopped(rspViewTree ,serverNumber)); } } }