Skip to content

Commit cb40785

Browse files
committed
fix: Fixed create new project link for 2024.1
Signed-off-by: Richard Kocian <[email protected]> rh-pre-commit.version: 2.2.0 rh-pre-commit.check-secrets: ENABLED
1 parent 9274d27 commit cb40785

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,9 @@ private JButtonFixture welcomeFrameLink(String label) {
241241
if (UtilsKt.hasAnyComponent(this, byXpath(XPathDefinitions.RECENT_PROJECT_PANEL_NEW))) {
242242
return button(byXpath(XPathDefinitions.jBOptionButton(label)), Duration.ofSeconds(2));
243243
}
244+
if (ideaVersion >= 20241 && label.equals("New Project")) {
245+
return button(byXpath(XPathDefinitions.CREATE_NEW_PROJECT), Duration.ofSeconds(2));
246+
}
244247
return button(byXpath(XPathDefinitions.nonOpaquePanel(label)), Duration.ofSeconds(2));
245248
}
246249

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public class XPathDefinitions {
8181
public static final String GET_SET_MODULE_NAME = "//div[@accessiblename='Module name:' and @accessiblename.key='label.project.wizard.new.project.module.name' and @class='JBTextField']";
8282
public static final String GET_SET_CONTENT_ROOT = "//div[@accessiblename='Content root:' and @accessiblename.key='label.project.wizard.new.project.content.root' and @class='ExtendableTextField']";
8383
public static final String GET_SET_MODULE_FILE_LOCATION = "//div[@accessiblename='Module file location:' and @accessiblename.key='label.project.wizard.new.project.module.file.location' and @class='ExtendableTextField']";
84+
public static final String CREATE_NEW_PROJECT = "//div[@defaulticon='createNewProjectTab.svg']"; // works for 2024.1 and higher
8485

8586
private XPathDefinitions() {
8687
throw new UITestException("Utility class with static methods.");

0 commit comments

Comments
 (0)