Skip to content

Commit 9aa0f7f

Browse files
committed
fix: fix CodeWithMe on 2023.1
Signed-off-by: Stephane Bouchet <[email protected]>
1 parent d6852d1 commit 9aa0f7f

File tree

1 file changed

+9
-1
lines changed
  • src/main/java/com/redhat/devtools/intellij/commonuitest/fixtures/dialogs/information

1 file changed

+9
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import com.intellij.remoterobot.fixtures.DefaultXpath;
1717
import com.intellij.remoterobot.fixtures.FixtureName;
1818
import com.intellij.remoterobot.utils.WaitForConditionTimeoutException;
19+
import com.redhat.devtools.intellij.commonuitest.UITestRunner;
1920
import com.redhat.devtools.intellij.commonuitest.utils.constants.ButtonLabels;
2021
import com.redhat.devtools.intellij.commonuitest.utils.constants.XPathDefinitions;
2122
import org.jetbrains.annotations.NotNull;
@@ -24,6 +25,8 @@
2425
import java.util.logging.Level;
2526
import java.util.logging.Logger;
2627

28+
import static com.intellij.remoterobot.search.locators.Locators.byXpath;
29+
2730
/**
2831
* Code With Me dialog fixture
2932
*
@@ -45,8 +48,13 @@ public CodeWithMeDialog(@NotNull RemoteRobot remoteRobot, @NotNull RemoteCompone
4548
*/
4649
public static void closeCodeWithMePopupIfItAppears(RemoteRobot remoteRobot) {
4750
CodeWithMeDialog codeWithMeDialog;
51+
int ideaVersionInt = UITestRunner.getIdeaVersionInt();
4852
try {
49-
codeWithMeDialog = remoteRobot.find(CodeWithMeDialog.class, Duration.ofSeconds(10));
53+
if (ideaVersionInt <= 20231) {
54+
codeWithMeDialog = remoteRobot.find(CodeWithMeDialog.class, byXpath("//div[@class='Wrapper']//div[@class='JPanel']"), Duration.ofSeconds(10));
55+
} else {
56+
codeWithMeDialog = remoteRobot.find(CodeWithMeDialog.class, Duration.ofSeconds(10));
57+
}
5058
} catch (WaitForConditionTimeoutException e) {
5159
LOGGER.log(Level.INFO, "Code With Me popup not found, nothing to close.");
5260
return;

0 commit comments

Comments
 (0)