diff --git a/.github/workflows/run-ui-tests.yml b/.github/workflows/run-ui-tests.yml index 363d9e8..629dd51 100644 --- a/.github/workflows/run-ui-tests.yml +++ b/.github/workflows/run-ui-tests.yml @@ -19,15 +19,24 @@ jobs: fail-fast: false matrix: include: +# - os: windows-latest +# runIde: start gradlew.bat runIdeForUiTests +# - os: macos-latest +# runIde: ./gradlew runIdeForUiTests & +# runTest: | +# export TEST_TYPE=UI +# ./gradlew :test --info --tests "com.cschar.pmode3.uitest.OpenSettingsJavaTest.opens_project" + - os: ubuntu-latest runIde: | export DISPLAY=:99.0 Xvfb -ac :99 -screen 0 1920x1080x16 & gradle runIdeForUiTests & - - os: windows-latest - runIde: start gradlew.bat runIdeForUiTests - - os: macos-latest - runIde: ./gradlew runIdeForUiTests & + runUITest: | + export TEST_TYPE=UI + export DISPLAY=:99.0 + Xvfb -ac :99 -screen 0 1920x1080x16 & + ./gradlew :test --info --tests "com.cschar.pmode3.uitest.OpenSettingsJavaTest.opens_project" steps: @@ -51,9 +60,27 @@ jobs: uses: jtalk/url-health-check-action@v3 with: url: http://127.0.0.1:8082 - max-attempts: 15 + max-attempts: 30 retry-delay: 30s # Run tests - name: Tests run: ./gradlew test + + - name: Run UI Tests + run: ${{ matrix.runUITest }} + +# - name: Tests IDE +# env: +# TEST_TYPE: UI +# run: | +# ./gradlew :test --info --tests "com.cschar.pmode3.uitest.OpenSettingsJavaTest.opens_project" +# +## linux broken +# - name: Tests IDE +# env: +# TEST_TYPE: UI +# DISPLAY: ":99" +# run: | +# Xvfb -ac :99 -screen 0 1920x1080x16 & +# ./gradlew :test --info --tests "com.cschar.pmode3.uitest.OpenSettingsJavaTest.opens_project" diff --git a/.github/workflows/runTest.yaml b/.github/workflows/runTest.yaml index ba607fc..148236e 100644 --- a/.github/workflows/runTest.yaml +++ b/.github/workflows/runTest.yaml @@ -1,4 +1,4 @@ -name: Run UI Tests (old version) +name: Run UI Tests v1 on: @@ -72,7 +72,7 @@ jobs: uses: actions/setup-java@v3 with: distribution: zulu - java-version: 11 + java-version: 17 - name: Setup FFmpeg uses: FedericoCarboni/setup-ffmpeg@v1 with: @@ -83,14 +83,19 @@ jobs: run: gradle :clean - name: Run Idea - run: start gradlew.bat :runIdeForUiTests + run: | + pwd + ls + ./gradlew runIdeForUiTests +# run: start gradlew.bat :runIdeForUiTests - name: Wait for Idea started - uses: jtalk/url-health-check-action@v1.5 + uses: jtalk/url-health-check-action@v3 with: url: http://localhost:8082 - max-attempts: 15 - retry-delay: 30s + max-attempts: 30 +# retry-delay: 30s + retry-delay: 15s - name: Tests run: gradle :test diff --git a/CHANGELOG.md b/CHANGELOG.md index 7060c51..9375bf4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,10 +3,11 @@ # power-mode-zeranthium Changelog ## [Unreleased] -- 2023.1 eap update +- 2023.1 update - basic particles now show on first time startup - disable lizard on first time startup + ## [3.1.0] - 2023-03-13 - 2022.3 update - quieter logs diff --git a/README.md b/README.md index 17ff031..e4dfbca 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # power-mode-zeranthium -[![Build](https://github.com/cschar/power-mode-zeranthium/actions/workflows/runTest.yaml/badge.svg)](https://github.com/cschar/power-mode-zeranthium/actions/workflows/runTest.yaml) +[![Build](https://github.com/cschar/power-mode-zeranthium/actions/workflows/run-ui-tests.yml/badge.svg)](https://github.com/cschar/power-mode-zeranthium/actions/workflows/run-ui-tests.yaml) [![Version](https://img.shields.io/jetbrains/plugin/v/13176-power-mode--zeranthium.svg)](https://plugins.jetbrains.com/plugin/13176-power-mode--zeranthium) [![Downloads](https://img.shields.io/jetbrains/plugin/d/13176-power-mode--zeranthium.svg)](https://plugins.jetbrains.com/plugin/13176-power-mode--zeranthium) diff --git a/README_dev_notes.md b/README_dev_notes.md index 8acd9dd..ddf63ce 100644 --- a/README_dev_notes.md +++ b/README_dev_notes.md @@ -21,10 +21,7 @@ add in Help > diagnostic Tools > Debug Log Settings #com.cschar.pmode3:all (including # at start) -# upgrading gradle -https://tomgregory.com/how-to-update-gradle/ -./gradlew wrapper --gradle-version 7.6.1 -./gradlew --version + # logo design diff --git a/README_dev_refactor.md b/README_dev_refactor.md index 00f589c..6e174ff 100644 --- a/README_dev_refactor.md +++ b/README_dev_refactor.md @@ -18,7 +18,9 @@ links to [1] https://github.com/krasa/StringManipulation/commit/43a4bc5e99f63663a7b2c5d8d75b1550a3e0a408 [2] https://github.com/krasa/StringManipulation/commit/08422d714ce70126093c051bd5147c8f9dbcdd3f +# TODO +RE-enable memory monitor UI ## DIAGNOSTICS #com.cschar.pmode3:all @@ -31,10 +33,6 @@ links to ## BUGS ? - --- Dyanmic Plugin memory when shutting down - -- HeapDump debug with VisualVM, start VM with same JDK that Sandbox IDe is running - -- Use VisualVMPlugin extension tool to start it with same JDK -- When stopping with CTRL+SHIFT+Z.... particles/dinos still float away instead of immediatly disappearing -- in Droste, moving caret with arrow keys doesnt resize cover @@ -42,6 +40,9 @@ links to put docs on astro site https://docs.astro.build/en/guides/deploy/github/ +# potentially.. +- dynamic plugin enable/disable +- pack loaders now use Modal UIs when fetching packs from github /opt/jdk/11/bin/javadoc \ -docletpath -docletpath ./build/classes/java/main \ diff --git a/build.gradle.kts b/build.gradle.kts index 6178b10..13f6afd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -133,7 +133,7 @@ tasks { patchPluginXml { version.set(properties("pluginVersion")) sinceBuild.set(properties("pluginSinceBuild")) - untilBuild.set(properties("pluginUntilBuild")) +// untilBuild.set(properties("pluginUntilBuild")) // Extract the section from README.md and provide for the plugin's manifest pluginDescription.set(providers.fileContents(layout.projectDirectory.file("README.md")).asText.map { diff --git a/gradle.properties b/gradle.properties index 5b99d05..f9a6d0f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,10 +4,12 @@ pluginGroup = com.github.cschar.pmode3 pluginName = power-mode-zeranthium pluginRepositoryUrl = https://github.com/cschar/power-mode-zeranthium # SemVer format -> https://semver.org -pluginVersion = 3.2.0-eap.2 +#pluginVersion = 3.2.0-eap.2 +pluginVersion = 3.2.0 # Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html pluginSinceBuild = 231 +# Not specifying until-build means it will include all future builds (including unreleased IDE versions, which might impact compatibility later). pluginUntilBuild = 231.* # IntelliJ Platform Properties -> https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html#configuration-intellij-extension diff --git a/src/main/java/com/cschar/pmode3/services/GitPackLoaderJComponent.java b/src/main/java/com/cschar/pmode3/services/GitPackLoaderJComponent.java index d2647cb..584e5c6 100644 --- a/src/main/java/com/cschar/pmode3/services/GitPackLoaderJComponent.java +++ b/src/main/java/com/cschar/pmode3/services/GitPackLoaderJComponent.java @@ -340,26 +340,26 @@ public void actionPerformed(ActionEvent e) { LOGGER.debug("launching Git Clone task"); //TODO Add this task to a hashmap to keep track of it. - Task.Modal modalTask2 = new Task.Modal(null, downloadBUtton, - "Cloning "+customRepoName+"...", - true) { -// Task.Backgroundable bgTask2 = new Task.Backgroundable(null, -// "Cloning "+customRepoName+"...", -// true, null) { +// Task.Modal task = new Task.Modal(null, downloadBUtton, +// "Cloning "+customRepoName+"...", +// true) { + Task.Backgroundable task = new Task.Backgroundable(null, + "Cloning "+customRepoName+"...", + true, null) { @Override public void onCancel() { super.onCancel(); GitPackLoaderService gitService = ApplicationManager.getApplication().getService(GitPackLoaderService.class); gitService.runningMonitors.remove(customRepoName); - gitService.backgroundTasks.remove(customRepoName); +// gitService.backgroundTasks.remove(customRepoName); } @Override public void onFinished() { GitPackLoaderService gitService = ApplicationManager.getApplication().getService(GitPackLoaderService.class); gitService.runningMonitors.remove(customRepoName); - gitService.backgroundTasks.remove(customRepoName); +// gitService.backgroundTasks.remove(customRepoName); super.onFinished(); } @@ -403,7 +403,7 @@ public void run(@NotNull ProgressIndicator progressIndicator) { LOGGER.trace("Launching cloning task from thread " + Thread.currentThread().toString()); // ProgressManager.getInstance().run(bgTask2); // gitService.backgroundTasks.put(customRepoName, bgTask2); - ProgressManager.getInstance().run(modalTask2); + ProgressManager.getInstance().run(task); diff --git a/src/main/java/com/cschar/pmode3/services/GitPackLoaderService.java b/src/main/java/com/cschar/pmode3/services/GitPackLoaderService.java index efea2b8..0cb5e98 100644 --- a/src/main/java/com/cschar/pmode3/services/GitPackLoaderService.java +++ b/src/main/java/com/cschar/pmode3/services/GitPackLoaderService.java @@ -31,7 +31,7 @@ public GitPackLoaderService() { // runningMonitors = new HashMap<>(); - backgroundTasks = new HashMap<>(); +// backgroundTasks = new HashMap<>(); } diff --git a/src/main/resources/META-INF/plugin.xml b/src/main/resources/META-INF/plugin.xml index 610e621..c9afa15 100644 --- a/src/main/resources/META-INF/plugin.xml +++ b/src/main/resources/META-INF/plugin.xml @@ -1,6 +1,6 @@ - - + + com.cschar.power.mode3.zeranthium Power Mode - Zeranthium @@ -21,7 +21,7 @@ groupWeight="20" instance="com.cschar.pmode4.AppSettingsConfigurable" id="power.mode3.zeranthium" - displayName="PowerMode Zeranthium"/> + displayName="Power Mode - Zeranthium"/> !idea.isDumbMode()); - System.out.println("opening settings.."); + System.out.println("opening settings..."); if (remoteRobot.isMac()) { keyboard.hotKey(VK_META, VK_COMMA); @@ -130,23 +128,25 @@ void opens_project(final RemoteRobot remoteRobot) { byXpath("//div[@text.key='button.cancel']"), Duration.ofSeconds(5)).click(); - System.out.println("Closing the project..."); - - step("Close the project", () -> { - if (remoteRobot.isMac()) { - keyboard.hotKey(VK_SHIFT, VK_META, VK_A); - keyboard.enterText("Close Project"); - keyboard.enter(); - } else { - actionMenu(remoteRobot, "File").click(); - actionMenuItem(remoteRobot, "Close Project").click(); - } - }); + //Don't close so next test can run +// System.out.println("Closing the project..."); +// +// step("Close the project", () -> { +// if (remoteRobot.isMac()) { +// keyboard.hotKey(VK_SHIFT, VK_META, VK_A); +// keyboard.enterText("Close Project"); +// keyboard.enter(); +// } else { +// actionMenu(remoteRobot, "File").click(); +// actionMenuItem(remoteRobot, "Close Project").click(); +// } +// }); // assert 5 == 3; } @Test + @Order(2) void createDownloadAndCancel_ReopeningShows_ReadyStatus(final RemoteRobot remoteRobot) { // sharedSteps.createNewCommandLineProject(); // sharedSteps.closeTipOfTheDay(); @@ -184,7 +184,8 @@ void createDownloadAndCancel_ReopeningShows_ReadyStatus(final RemoteRobot remote settingsDialog.find(ComponentFixture.class, // byXpath("//div[@accessiblename.key='icon.nodes.nodePlaceholder.tooltip' and @class='JLabel']"), - byXpath("//div[@text='packs']"), +// byXpath("//div[@text='packs']"), + byXpath("//div[@text='|']"), Duration.ofSeconds((3))).click(); settingsDialog.find(ComponentFixture.class, @@ -216,13 +217,25 @@ void createDownloadAndCancel_ReopeningShows_ReadyStatus(final RemoteRobot remote // assert(gitService.runningMonitors.size() == 1); idea.find(ComponentFixture.class, - byXpath("//div[@mytext='Cloning zeranthium-extras-vol1...']"), +// byXpath("//div[@mytext='Cloning zeranthium-extras-vol1...']"), + //2023.1 elements... + byXpath("//div[@accessiblename='Cloning zeranthium-extras-vol1...' and @class='TextPanel' and @text='Cloning zeranthium-extras-vol1...']"), Duration.ofSeconds(LONG_WAIT_5s)).click(); + + idea.find(ComponentFixture.class, byXpath("//div[@myicon='stop.svg']"), Duration.ofSeconds(2)).click(); + //incase we click it too fast... try to click again + try { + idea.find(ComponentFixture.class, + byXpath("//div[@myicon='stop.svg']"), + Duration.ofSeconds(5)).click(); + }catch (Exception e){ + + } // waitFor(ofSeconds(3), () -> gitService.runningMonitors.size() == 0); // assert(gitService.runningMonitors.size() == 0); @@ -243,8 +256,8 @@ void createDownloadAndCancel_ReopeningShows_ReadyStatus(final RemoteRobot remote Duration.ofSeconds(LONG_WAIT_5s)).click(); settingsRentry.find(ComponentFixture.class, - byXpath("//div[@text='packs']"), -// byXpath("//div[@accessiblename.key='icon.nodes.nodePlaceholder.tooltip' and @class='JLabel']"), +// byXpath("//div[@text='packs']"), + byXpath("//div[@text='|']"), Duration.ofSeconds((LONG_WAIT_5s))).click(); settingsRentry.find(ComponentFixture.class, @@ -266,8 +279,11 @@ void createDownloadAndCancel_ReopeningShows_ReadyStatus(final RemoteRobot remote @Test + @Order(3) + @Disabled() void createDownload_ReopeningShows_DownloadLabel(final RemoteRobot remoteRobot) { + //This frame is an open project,not the home screen final IdeaFrame idea = remoteRobot.find(IdeaFrame.class, ofSeconds(10)); waitFor(ofMinutes(5), () -> !idea.isDumbMode());