Skip to content

Commit 39b5e77

Browse files
committed
chore: fix integration tests
Signed-off-by: Stephane Bouchet <[email protected]>
1 parent 7c5aaf8 commit 39b5e77

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,8 @@ public void setProjectSdkIfAvailable(String targetSdkName) {
157157
CommonContainerFixture parentFixture = waitFor(Duration.ofSeconds(20), Duration.ofSeconds(2), "Wait for the 'Project SDK' list to finish loading all items.", "The project JDK list did not load all items in 20 seconds.", this::didProjectSdkListLoadAllItems);
158158
JPopupMenuFixture projectSdkList = parentFixture.jPopupMenus(byXpath(XPathDefinitions.HEAVY_WEIGHT_WINDOW)).get(0); // issue https://github.com/JetBrains/intellij-ui-test-robot/issues/104
159159
List<String> sdkItems = projectSdkList.jList().collectItems();
160+
System.out.println(sdkItems);
161+
ScreenshotUtils.takeScreenshot(remoteRobot, "before searching correct JDK "+targetSdkName);
160162
Map<String, String> foundItems = new HashMap<>();
161163
sdkItems.forEach(item ->
162164
Arrays.stream(item.split(" ")).filter(s ->

src/main/java/com/redhat/devtools/intellij/commonuitest/utils/testextension/ScreenshotAfterTestFailExtension.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public ScreenshotAfterTestFailExtension() {
5151
@Override
5252
public void afterTestExecution(ExtensionContext extensionContext) {
5353
if (remoteRobot == null) {
54-
LOGGER.log(Level.SEVERE, "Can take a screenshot, remoteRobot is null!");
54+
LOGGER.log(Level.SEVERE, "Can't take a screenshot, remoteRobot is null!");
5555
return;
5656
}
5757
boolean testFailed = extensionContext.getExecutionException().isPresent();

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,9 +332,9 @@ public void cancelButtonTest() {
332332
@Test
333333
public void setProjectSdkIfAvailableTest() {
334334
if (ideaVersionInt >= 20242 && remoteRobot.isWin()) {
335-
newProjectFirstPage.setProjectSdkIfAvailable("Download JDK");
335+
newProjectFirstPage.setProjectSdkIfAvailable("Download");
336336
try {
337-
ContainerFixture downloadJdkDialog = remoteRobot.find(ContainerFixture.class, byXpath("//div[@title='Download JDK']"), Duration.ofSeconds(10));
337+
ContainerFixture downloadJdkDialog = remoteRobot.find(ContainerFixture.class, byXpath("//div[@title='Download JDK...']"), Duration.ofSeconds(10));
338338
downloadJdkDialog.find(ActionButtonFixture.class, byXpath(XPathDefinitions.label(ButtonLabels.CANCEL_LABEL)), Duration.ofSeconds(5)).click();
339339
} catch (WaitForConditionTimeoutException e) {
340340
fail("Download JDK button was not pressed and Download JDK dialog was not found");

0 commit comments

Comments
 (0)