Skip to content

Commit 264f61a

Browse files
Updated accessibleName of files in the UI tests (#1461)
* Update SingleModLibertyLSTestCommon.java * Update SingleModMPLSTestCommon.java * Update SingleModMPProjectTestCommon.java * Update UIBotTestUtils.java * copyright year update * editor tab name change revert * modified equals() to startsWith() * Update SingleModLibertyLSTestCommon.java * Update SingleModLibertyLSTestCommon.java * modified to use starts-with() * Update SingleModLibertyLSTestCommon.java Revert "Update SingleModLibertyLSTestCommon.java" This reverts commit e678a1a. Update SingleModMPLSTestCommon.java
1 parent e83d828 commit 264f61a

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

src/test/java/io/openliberty/tools/intellij/it/UIBotTestUtils.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ public static void clickOnFileTab(RemoteRobot remoteRobot, String fileName) {
744744
ProjectFrameFixture projectFrame = remoteRobot.find(ProjectFrameFixture.class, Duration.ofSeconds(10));
745745

746746
try {
747-
String xPath = "//div[@accessiblename='" + fileName + "' and @class='EditorTabLabel']";
747+
String xPath = "//div[starts-with(@accessiblename, '" + fileName + "') and @class='EditorTabLabel']";
748748
ComponentFixture actionButton = projectFrame.getActionButton(xPath, "10");
749749
actionButton.click();
750750

@@ -780,7 +780,7 @@ public static void hoverInAppServerCfgFile(RemoteRobot remoteRobot, String hover
780780
// Find the target text on the editor and move the move to it.
781781
editorNew.findText(contains(hoverTarget)).moveMouse();
782782
// clear and "lightbulb" icons?
783-
if (!hoverFile.equals("server.xml")) {
783+
if (!hoverFile.startsWith("server.xml")) {
784784
keyboard.hotKey(VK_ESCAPE);
785785
}
786786

@@ -2069,6 +2069,11 @@ public static void createLibertyConfiguration(RemoteRobot remoteRobot, String cf
20692069
ActionButtonFixture addCfgButton = addProjectDialog.actionButton(addButtonLocator);
20702070
addCfgButton.click();
20712071

2072+
// Click on the Collapse All button.
2073+
Locator collapseButtonLocator = byXpath("//div[@accessiblename='Collapse All']");
2074+
ActionButtonFixture collapseButton = addProjectDialog.actionButton(collapseButtonLocator);
2075+
collapseButton.click();
2076+
20722077
// Look for the Liberty entry in the Add New configuration window and create a new configuration.
20732078
ComponentFixture pluginCfgTree = addProjectDialog.getMyTree();
20742079
RepeatUtilsKt.waitFor(Duration.ofSeconds(10),
@@ -2400,7 +2405,7 @@ public static void selectConfigUsingMenu(RemoteRobot remoteRobot, String cfgName
24002405
public static void runConfigUsingIconOnToolbar(RemoteRobot remoteRobot, ExecMode execMode) {
24012406
ProjectFrameFixture projectFrame = remoteRobot.find(ProjectFrameFixture.class, Duration.ofSeconds(10));
24022407

2403-
Locator locator = byXpath("//div[@class='ActionButton' and @myaction='Run (Run selected configuration)']");
2408+
Locator locator = byXpath("//div[@class='ActionButton' and @myaction='Run (Run the selected configuration)']");
24042409
if (execMode == ExecMode.DEBUG) {
24052410
locator = byXpath("//div[@class='ActionButton' and @myicon='debug.svg']");
24062411
}

src/test/java/io/openliberty/tools/intellij/it/fixtures/ProjectFrameFixture.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ public static void clickMenuOption(ProjectFrameFixture projectFrame, String text
251251
public ComponentFixture getInplaceButton(String... xpathVars) {
252252
String name = xpathVars[0];
253253
String waitTime = xpathVars[1];
254-
Locator locator = byXpath("//div[@accessiblename='" + name + "' and @class='EditorTabLabel']//div[@class='InplaceButton']");
254+
Locator locator = byXpath("//div[starts-with(@accessiblename, '" + name + "') and @class='EditorTabLabel']//div[@class='InplaceButton']");
255255
return find(ComponentFixture.class, locator, Duration.ofSeconds(Integer.parseInt(waitTime)));
256256
}
257257

0 commit comments

Comments
 (0)