diff --git a/.github/workflows/itests.yml.disabled b/.github/workflows/itests.yml similarity index 68% rename from .github/workflows/itests.yml.disabled rename to .github/workflows/itests.yml index 490cea705..026d12f5a 100644 --- a/.github/workflows/itests.yml.disabled +++ b/.github/workflows/itests.yml @@ -24,7 +24,7 @@ jobs: export DISPLAY=:99.0 Xvfb -ac :99 -screen 0 1920x1080x24 & chmod +x gradlew - ./gradlew integrationTest + ./gradlew integrationTest --info - uses: actions/upload-artifact@v2 with: name: ${{ runner.os }}-integration-test-reports @@ -38,30 +38,30 @@ jobs: build/screenshots/ if: always() - build-macos: - runs-on: macos-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 17 - uses: actions/setup-java@v1 - with: - java-version: 17 - - name: Run integration tests - run: | - ./gradlew integrationTest - - uses: actions/upload-artifact@v2 - with: - name: ${{ runner.os }}-integration-test-reports - path: build/reports/tests/integrationTest - if: always() - - name: Archiving screenshots - uses: actions/upload-artifact@v2 - with: - name: ${{ runner.os }}-screenshots - path: | - build/screenshots/ - if: always() +# build-macos: +# runs-on: macos-latest +# +# steps: +# - uses: actions/checkout@v2 +# - name: Set up JDK 17 +# uses: actions/setup-java@v1 +# with: +# java-version: 17 +# - name: Run integration tests +# run: | +# ./gradlew integrationTest --info +# - uses: actions/upload-artifact@v2 +# with: +# name: ${{ runner.os }}-integration-test-reports +# path: build/reports/tests/integrationTest +# if: always() +# - name: Archiving screenshots +# uses: actions/upload-artifact@v2 +# with: +# name: ${{ runner.os }}-screenshots +# path: | +# build/screenshots/ +# if: always() build-windows: runs-on: windows-latest @@ -74,7 +74,7 @@ jobs: java-version: 17 - name: Run integration tests run: | - .\gradlew.bat integrationTest + .\gradlew.bat integrationTest --info shell: powershell - uses: actions/upload-artifact@v2 with: diff --git a/build.gradle.kts b/build.gradle.kts index 109cc5aa8..76711f1f7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -117,7 +117,7 @@ dependencies { builtBy("copyDeps") }) - testImplementation("com.redhat.devtools.intellij:intellij-common-ui-test-library:0.2.0") + testImplementation("com.redhat.devtools.intellij:intellij-common-ui-test-library:0.4.0") // And now for some serious HACK!!! // Starting with 2023.1, all gradle tests fail importing projects with a: @@ -270,7 +270,7 @@ tasks { // Configure UI tests plugin // Read more: https://github.com/JetBrains/intellij-ui-test-robot runIdeForUiTests { - systemProperty("robot-server.port", "8082") + systemProperty("robot-server.port", System.getProperty("robot-server.port")) systemProperty("ide.mac.message.dialogs.as.sheets", "false") systemProperty("jb.privacy.policy.text", "") systemProperty("jb.consents.confirmation.enabled", "false") diff --git a/src/it/java/org/jboss/tools/intellij/quarkus/fixtures/dialogs/project/pages/QuarkusNewProjectSecondPage.java b/src/it/java/org/jboss/tools/intellij/quarkus/fixtures/dialogs/project/pages/QuarkusNewProjectSecondPage.java index fb73ebabb..3957b9c18 100644 --- a/src/it/java/org/jboss/tools/intellij/quarkus/fixtures/dialogs/project/pages/QuarkusNewProjectSecondPage.java +++ b/src/it/java/org/jboss/tools/intellij/quarkus/fixtures/dialogs/project/pages/QuarkusNewProjectSecondPage.java @@ -46,4 +46,15 @@ public void setBuildTool(BuildTool buildTool) { comboBoxFixture.selectItem(buildTool.toString()); } } + + /** + * Set java version + */ + public void setJavaVersion(String javaVersion){ + ComboBoxFixture comboBoxFixture = comboBox(byXpath(XPathDefinitions.JAVA_VERSION_COMBO_BOX), Duration.ofSeconds(10)); + if (!comboBoxFixture.selectedText().contains(javaVersion)) { + comboBoxFixture.click(); // extra click needed due to an issue - https://github.com/JetBrains/intellij-ui-test-robot/issues/112 + comboBoxFixture.selectItem(javaVersion); + } + } } \ No newline at end of file diff --git a/src/it/java/org/jboss/tools/intellij/quarkus/fixtures/dialogs/project/pages/QuarkusNewProjectThirdPage.java b/src/it/java/org/jboss/tools/intellij/quarkus/fixtures/dialogs/project/pages/QuarkusNewProjectThirdPage.java new file mode 100644 index 000000000..7ba6632ef --- /dev/null +++ b/src/it/java/org/jboss/tools/intellij/quarkus/fixtures/dialogs/project/pages/QuarkusNewProjectThirdPage.java @@ -0,0 +1,32 @@ +/******************************************************************************* + * Copyright (c) 2024 Red Hat, Inc. + * Distributed under license by Red Hat, Inc. All rights reserved. + * This program is made available under the terms of the + * Eclipse Public License v2.0 which accompanies this distribution, + * and is available at https://www.eclipse.org/legal/epl-v20.html + * + * Contributors: + * Red Hat, Inc. - initial API and implementation + ******************************************************************************/ +package org.jboss.tools.intellij.quarkus.fixtures.dialogs.project.pages; + +import com.intellij.remoterobot.RemoteRobot; +import com.intellij.remoterobot.data.RemoteComponent; +import com.intellij.remoterobot.fixtures.CommonContainerFixture; +import com.intellij.remoterobot.fixtures.DefaultXpath; +import com.intellij.remoterobot.fixtures.FixtureName; +import org.jboss.tools.intellij.quarkus.utils.XPathDefinitions; +import org.jetbrains.annotations.NotNull; + +/** + * New project dialog fixture + * + * @author olkornii@redhat.com + */ +@DefaultXpath(by = "MyDialog type", xpath = XPathDefinitions.DIALOG_ROOT_PANE) +@FixtureName(name = "New Project Dialog") +public class QuarkusNewProjectThirdPage extends CommonContainerFixture { + public QuarkusNewProjectThirdPage(@NotNull RemoteRobot remoteRobot, @NotNull RemoteComponent remoteComponent) { + super(remoteRobot, remoteComponent); + } +} \ No newline at end of file diff --git a/src/it/java/org/jboss/tools/intellij/quarkus/tests/AbstractQuarkusTest.java b/src/it/java/org/jboss/tools/intellij/quarkus/tests/AbstractQuarkusTest.java index 6ee86e639..31f2f1744 100644 --- a/src/it/java/org/jboss/tools/intellij/quarkus/tests/AbstractQuarkusTest.java +++ b/src/it/java/org/jboss/tools/intellij/quarkus/tests/AbstractQuarkusTest.java @@ -33,7 +33,7 @@ abstract public class AbstractQuarkusTest { @BeforeAll protected static void startIntelliJ() { if (!intelliJHasStarted) { - remoteRobot = UITestRunner.runIde(IntelliJVersion.COMMUNITY_V_2022_1, 8580); + remoteRobot = UITestRunner.runIde(IntelliJVersion.COMMUNITY_V_2023_2, 8580); intelliJHasStarted = true; Runtime.getRuntime().addShutdownHook(new CloseIntelliJBeforeQuit()); diff --git a/src/it/java/org/jboss/tools/intellij/quarkus/tests/BasicTest.java b/src/it/java/org/jboss/tools/intellij/quarkus/tests/BasicTest.java index 7d1430db1..3d59e1467 100644 --- a/src/it/java/org/jboss/tools/intellij/quarkus/tests/BasicTest.java +++ b/src/it/java/org/jboss/tools/intellij/quarkus/tests/BasicTest.java @@ -30,6 +30,7 @@ import org.jboss.tools.intellij.quarkus.fixtures.dialogs.project.pages.QuarkusNewProjectFinalPage; import org.jboss.tools.intellij.quarkus.fixtures.dialogs.project.pages.QuarkusNewProjectFirstPage; import org.jboss.tools.intellij.quarkus.fixtures.dialogs.project.pages.QuarkusNewProjectSecondPage; +import org.jboss.tools.intellij.quarkus.fixtures.dialogs.project.pages.QuarkusNewProjectThirdPage; import org.jboss.tools.intellij.quarkus.utils.BuildTool; import org.jboss.tools.intellij.quarkus.utils.EndpointURLType; import org.jboss.tools.intellij.quarkus.utils.XPathDefinitions; @@ -49,6 +50,7 @@ public class BasicTest extends AbstractQuarkusTest { private final String NEW_QUARKUS_MAVEN_PROJECT_NAME = "code-with-quarkus-maven"; private final String NEW_QUARKUS_GRADLE_PROJECT_NAME = "code-with-quarkus-gradle"; + private final String JAVA_VERSION_FOR_QUARKUS_PROJECT = "17"; @AfterEach public void finishTestRun() { @@ -100,7 +102,9 @@ private void createQuarkusProject(RemoteRobot remoteRobot, String projectName, B QuarkusNewProjectSecondPage quarkusNewProjectSecondPage = newProjectDialogWizard.find(QuarkusNewProjectSecondPage.class, Duration.ofSeconds(10)); quarkusNewProjectSecondPage.setBuildTool(buildTool); + quarkusNewProjectSecondPage.setJavaVersion(JAVA_VERSION_FOR_QUARKUS_PROJECT); newProjectDialogWizard.next(); + newProjectDialogWizard.find(QuarkusNewProjectThirdPage.class, Duration.ofSeconds(10)); // wait for third page to be loaded newProjectDialogWizard.next(); try { Thread.sleep(1000L); diff --git a/src/it/java/org/jboss/tools/intellij/quarkus/utils/XPathDefinitions.java b/src/it/java/org/jboss/tools/intellij/quarkus/utils/XPathDefinitions.java index a227a6ba0..7aae259db 100644 --- a/src/it/java/org/jboss/tools/intellij/quarkus/utils/XPathDefinitions.java +++ b/src/it/java/org/jboss/tools/intellij/quarkus/utils/XPathDefinitions.java @@ -23,4 +23,5 @@ public class XPathDefinitions { public static final String CUSTOM_ENDPOINT_URL_TEXT_FIELD = "//div[@class='BorderlessTextField']"; public static final String SET_BUILD_TOOL_COMBO_BOX = "//div[@accessiblename='Tool:' and @class='ComboBox']"; public static final String PROJECT_SETTINGS_COMPONENTS = "//div[@class='NamePathComponent']/*"; + public static final String JAVA_VERSION_COMBO_BOX = "//div[@accessiblename='Java version:' and @class='ComboBox']"; }