Skip to content

Commit 67655e9

Browse files
committed
chore: bump minimal version to 2022.3, due to IJ gradle plugin 2.x used.
see https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin.html#requirements fixes #287 Signed-off-by: Stephane Bouchet <sbouchet@redhat.com>
1 parent 5ff766f commit 67655e9

File tree

19 files changed

+42
-219
lines changed

19 files changed

+42
-219
lines changed

src/main/java/com/redhat/devtools/intellij/commonuitest/fixtures/dialogs/project/NewProjectDialogWizard.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -34,20 +34,6 @@ public NewProjectDialogWizard(@NotNull RemoteRobot remoteRobot, @NotNull RemoteC
3434
super(remoteRobot, remoteComponent);
3535
}
3636

37-
/**
38-
* Move to the previous page of the 'New Project' dialog by clicking on the 'Previous' button
39-
*/
40-
public void previous() {
41-
clickOnButton(ButtonLabels.PREVIOUS_LABEL);
42-
}
43-
44-
/**
45-
* Move to the next page of the 'New Project' dialog by clicking on the 'Next' button
46-
*/
47-
public void next() {
48-
clickOnButton(ButtonLabels.NEXT_LABEL);
49-
}
50-
5137
/**
5238
* Finish the 'New Project' dialog
5339
*/

src/main/java/com/redhat/devtools/intellij/commonuitest/fixtures/dialogs/project/pages/AbstractNewProjectFinalPage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ public void closeAdvanceSettings() {
9393
}
9494
}
9595

96-
private boolean isAdvancedSettingsOpened() {
96+
public boolean isAdvancedSettingsOpened() {
9797
List<ComponentFixture> cf = findAll(ComponentFixture.class, byXpath(XPathDefinitions.COLLAPSIBLE_TITLED_SEPARATOR_NEW_SIBLINGS));
9898

9999
for (int i = 0; i < cf.size(); i++) {

src/main/java/com/redhat/devtools/intellij/commonuitest/fixtures/dialogs/project/pages/AbstractProjectNamePage.java

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/main/java/com/redhat/devtools/intellij/commonuitest/fixtures/dialogs/project/pages/JavaNewProjectSecondPage.java

Lines changed: 0 additions & 51 deletions
This file was deleted.

src/main/java/com/redhat/devtools/intellij/commonuitest/fixtures/dialogs/project/pages/NewProjectFirstPage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public NewProjectFirstPage(@NotNull RemoteRobot remoteRobot, @NotNull RemoteComp
6262
* @param projectType name of the project type to which will be changed the current settings
6363
*/
6464
public void selectNewProjectType(NewProjectType projectType) {
65-
if (ideaVersionInt == 20223 && projectType != NewProjectType.NEW_PROJECT && projectType != NewProjectType.EMPTY_PROJECT) {
65+
if (ideaVersionInt <= 20223 && projectType != NewProjectType.NEW_PROJECT && projectType != NewProjectType.EMPTY_PROJECT) {
6666
jLists(JListFixture.Companion.byType()).get(0).findText(NewProjectType.NEW_PROJECT.toString()).click();
6767
setLanguage(projectType.toString());
6868
} else {

src/main/java/com/redhat/devtools/intellij/commonuitest/fixtures/mainidewindow/MainIdeWindow.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ public MainIdeWindow(@NotNull RemoteRobot remoteRobot, @NotNull RemoteComponent
5050
* Maximize the main IDE window
5151
*/
5252
public void maximizeIdeWindow() {
53+
if (UITestRunner.getIdeaVersionInt() <= 20223) {
54+
return;
55+
}
5356
if (remoteRobot.isWin()) {
5457
runJs("""
5558
const width = component.getWidth();

src/main/java/com/redhat/devtools/intellij/commonuitest/fixtures/mainidewindow/menubar/MenuBar.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,15 @@ private JButtonFixture mainMenuItem(String label) {
9595
}
9696

9797
public CommonContainerFixture getMainMenu() {
98-
CommonContainerFixture cf = null;
98+
CommonContainerFixture cf;
9999
if (remoteRobot.isLinux() && ideaVersionInt <= 20242) {
100100
cf = remoteRobot.find(CommonContainerFixture.class, byXpath(XPathDefinitions.LINUX_MAIN_MENU), Duration.ofSeconds(5));
101101
} else if ((remoteRobot.isWin() && ideaVersionInt >= 20241) || (remoteRobot.isLinux() && ideaVersionInt > 20242)) {
102102
cf = remoteRobot.find(CommonContainerFixture.class, byXpath(XPathDefinitions.WINDOWS_MAIN_MENU_2024_1_AND_NEWER), Duration.ofSeconds(5));
103103
} else if (remoteRobot.isWin()) {
104104
cf = remoteRobot.find(CommonContainerFixture.class, byXpath(XPathDefinitions.WINDOWS_MAIN_MENU_2022_2_TO_2023_2), Duration.ofSeconds(5));
105105
} else {
106-
LOGGER.severe("Can't get main menu. System OS is %s / IdeaVersion is %d".formatted(remoteRobot.getOs(), ideaVersionInt));
106+
throw new IllegalStateException("Can't get main menu. System OS is %s / IdeaVersion is %d".formatted(remoteRobot.getOs(), ideaVersionInt));
107107
}
108108
return cf;
109109
}

src/main/java/com/redhat/devtools/intellij/commonuitest/fixtures/mainidewindow/toolwindowspane/AbstractToolWinPane.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public JButtonFixture stripeButton(String label, boolean isPaneOpened) {
103103
}
104104

105105
protected void togglePane(String label, Class<? extends Fixture> fixtureClass, boolean openPane) {
106-
if ((!isPaneOpened(fixtureClass) && openPane)) {
106+
if (!isPaneOpened(fixtureClass) && openPane) {
107107
clickOnStripeButton(label, false);
108108
} else if (isPaneOpened(fixtureClass) && !openPane) {
109109
clickOnStripeButton(label, true);
@@ -112,11 +112,7 @@ protected void togglePane(String label, Class<? extends Fixture> fixtureClass, b
112112

113113
private boolean isPaneOpened(Class<? extends Fixture> fixtureClass) {
114114
try {
115-
if (ideaVersionInt <= 20223) {
116-
return find(fixtureClass, Duration.ofSeconds(10)).isShowing();
117-
} else {
118-
return find(CommonContainerFixture.class, byXpath("//div[@class='MavenProjectsNavigatorPanel']"), Duration.ofSeconds(10)).isShowing();
119-
}
115+
return find(fixtureClass, Duration.ofSeconds(10)).isShowing();
120116
} catch (WaitForConditionTimeoutException e) {
121117
return false;
122118
}

src/main/java/com/redhat/devtools/intellij/commonuitest/utils/constants/ButtonLabels.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ public class ButtonLabels {
2323
public static final String CANCEL_LABEL = "Cancel";
2424
public static final String OK_LABEL = "OK";
2525
public static final String APPLY_LABEL = "Apply";
26-
public static final String NEXT_LABEL = "Next";
27-
public static final String PREVIOUS_LABEL = "Previous";
2826
public static final String CREATE_LABEL = "Create";
2927
public static final String PROJECT_STRIPE_BUTTON_LABEL = "Project";
3028
public static final String MAVEN_STRIPE_BUTTON_LABEL = "Maven";

src/test-project/src/test/java/com/redhat/devtools/intellij/commonuitest/fixtures/test/dialogs/FlatWelcomeFrameTest.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727

2828
import static com.intellij.remoterobot.search.locators.Locators.byXpath;
2929
import static org.junit.jupiter.api.Assertions.assertEquals;
30+
import static org.junit.jupiter.api.Assertions.assertTrue;
3031

3132
/**
3233
* FlatWelcomeFrame test
@@ -49,6 +50,7 @@ void createNewProjectLinkTest() {
4950
flatWelcomeFrame.createNewProject();
5051
NewProjectDialogWizard newProjectDialogWizard = remoteRobot.find(NewProjectDialogWizard.class, Duration.ofSeconds(10));
5152
newProjectDialogWizard.cancel();
53+
assertTrue(flatWelcomeFrame.isShowing(), "The Welcome Window should be open.");
5254
}
5355

5456
@Test
@@ -73,6 +75,7 @@ void clearExceptionsTest() {
7375
prepareWorkspace(PROJECT_NAME);
7476
flatWelcomeFrame = remoteRobot.find(FlatWelcomeFrame.class, Duration.ofSeconds(10));
7577
flatWelcomeFrame.clearExceptions();
78+
assertTrue(flatWelcomeFrame.isShowing(), "The Welcome Window should be open.");
7679
}
7780

7881
private int getNumberOfProjectsOnDisk() {

src/test-project/src/test/java/com/redhat/devtools/intellij/commonuitest/fixtures/test/dialogs/information/ProjectStructureDialogTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ static void closeProject() {
4848
@Test
4949
void projectStructureDialogTest() {
5050
dialogTest(() -> {
51-
ProjectStructureDialog projectStructureDialog = remoteRobot.find(ProjectStructureDialog.class, Duration.ofSeconds(10));
51+
ProjectStructureDialog projectStructureDialog = remoteRobot.find(ProjectStructureDialog.class, Duration.ofSeconds(15));
5252
projectStructureDialog.cancel();
5353
});
5454
}

src/test-project/src/test/java/com/redhat/devtools/intellij/commonuitest/fixtures/test/dialogs/information/TipDialogTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,10 @@ void prepareTipDialog() {
4848

4949
@Test
5050
void closeButtonTest() {
51-
Duration timeout = Duration.ofSeconds(5);
52-
remoteRobot.find(TipDialog.class, timeout);
51+
remoteRobot.find(TipDialog.class, Duration.ofSeconds(5));
5352
tipDialog.close();
5453
try {
55-
remoteRobot.find(TipDialog.class, timeout);
54+
remoteRobot.find(TipDialog.class);
5655
fail("The 'Tif of the Day' dialog should be closed but is not.");
5756
} catch (WaitForConditionTimeoutException e) {
5857
LOGGER.log(Level.INFO, e.getMessage(), e);

0 commit comments

Comments
 (0)