Skip to content

Commit

Permalink
Fixed compatibility with IJ 2022.2
Browse files Browse the repository at this point in the history
Signed-off-by: Oleksii Korniienko <[email protected]>
  • Loading branch information
olkornii committed Nov 2, 2023
1 parent fd90e94 commit f7c56f0
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/it/java/com/redhat/devtools/intellij/rsp/BasicTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
import com.intellij.remoterobot.fixtures.dataExtractor.RemoteText;
import com.intellij.remoterobot.utils.WaitForConditionTimeoutException;
import static com.intellij.remoterobot.search.locators.Locators.byXpath;

import com.redhat.devtools.intellij.rsp.dialogs.ProjectStructureDialog;
import com.redhat.devtools.intellij.rsp.mainIdeWindow.RspToolFixture;

import com.redhat.devtools.intellij.rsp.mainIdeWindow.SingleHeighLabelFixture;
import com.redhat.devtools.intellij.rsp.tests.RunRspConnectorsTest;
import org.junit.jupiter.api.AfterAll;
Expand All @@ -35,7 +35,7 @@
import com.redhat.devtools.intellij.commonuitest.utils.runner.IntelliJVersion;
import com.redhat.devtools.intellij.commonuitest.fixtures.dialogs.project.NewProjectDialogWizard;
import com.redhat.devtools.intellij.commonuitest.fixtures.mainidewindow.idestatusbar.IdeStatusBar;
import com.redhat.devtools.intellij.commonuitest.fixtures.mainidewindow.toolwindowspane.ToolWindowsPane;
import com.redhat.devtools.intellij.commonuitest.fixtures.mainidewindow.toolwindowspane.ToolWindowPane;

import com.redhat.devtools.intellij.rsp.tests.CheckRspConnectorsExistsTest;

Expand Down Expand Up @@ -76,16 +76,16 @@ public void checkRspConnectorsExists() {

@Test
public void runRspConnectors() {
step("Run RSP Connectors", () -> RunRspConnectorsTest.runRspServers(robot, rspViewTree));
step("Start/Stop RSP Connectors", () -> RunRspConnectorsTest.runRspServers(robot, rspViewTree));
}

private static void createEmptyProject(){
final FlatWelcomeFrame flatWelcomeFrame = robot.find(FlatWelcomeFrame.class);
flatWelcomeFrame.createNewProject();
final NewProjectDialogWizard newProjectDialogWizard = flatWelcomeFrame.find(NewProjectDialogWizard.class, Duration.ofSeconds(20));
selectNewProjectType("Empty Project");
// newProjectDialogWizard.finish(); // temporary commented
robot.find(ComponentFixture.class, byXpath("//div[@accessiblename='Finish' and @class='JButton' and @text='Finish']"), Duration.ofSeconds(5)).click(); // temporary workaround
newProjectDialogWizard.finish();
// robot.find(ComponentFixture.class, byXpath("//div[@accessiblename='Finish' and @class='JButton' and @text='Finish']"), Duration.ofSeconds(5)).click(); // workaround, if needed

final IdeStatusBar ideStatusBar = robot.find(IdeStatusBar.class, Duration.ofSeconds(5));
ideStatusBar.waitUntilProjectImportIsComplete();
Expand All @@ -103,14 +103,14 @@ private static boolean isRspViewTreeAvailable(ComponentFixture rspViewTree){
}

private static void openRspServersTab(){
final ToolWindowsPane toolWindowsPane = robot.find(ToolWindowsPane.class);
waitFor(Duration.ofSeconds(10), Duration.ofSeconds(1), "The 'RSP' stripe button is not available.", () -> isStripeButtonAvailable(toolWindowsPane, "RSP Servers"));
toolWindowsPane.stripeButton("RSP Servers", false).click();
final ToolWindowPane toolWindowPane = robot.find(ToolWindowPane.class);
waitFor(Duration.ofSeconds(10), Duration.ofSeconds(1), "The 'RSP' stripe button is not available.", () -> isStripeButtonAvailable(toolWindowPane, "RSP Servers"));
toolWindowPane.stripeButton("RSP Servers", false).click();
}

private static boolean isStripeButtonAvailable(ToolWindowsPane toolWindowsPane, String label) {
private static boolean isStripeButtonAvailable(ToolWindowPane toolWindowPane, String label) {
try {
toolWindowsPane.stripeButton(label, false);
toolWindowPane.stripeButton(label, false);
} catch (WaitForConditionTimeoutException e) {
return false;
}
Expand All @@ -134,7 +134,7 @@ public static void closeTipDialogIfItAppears() {

public static void closeGotItPopup() {
try {
robot.find(ComponentFixture.class, byXpath("JBList", "//div[@accessiblename='Got It' and @class='JButton' and @text='Got It']"), Duration.ofSeconds(10)).click();
robot.find(ComponentFixture.class, byXpath("GotIt Popup", "//div[@accessiblename='Got It' and @class='JButton' and @text='Got It']"), Duration.ofSeconds(10)).click();
} catch (WaitForConditionTimeoutException e) {
e.printStackTrace();
}
Expand Down

0 comments on commit f7c56f0

Please sign in to comment.