diff --git a/CHANGELOG.md b/CHANGELOG.md index 85ad294c..81704e0b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to this project will be documented in this file. ## [Unreleased] +## [2.0.6] - 2023-08-14 + +### Bug Fixes + +- Solve some minor issues and update dependencies + ## [2.0.5] - 2023-08-14 ### Bug Fixes diff --git a/gradle.properties b/gradle.properties index 111c0bad..808b52fc 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,7 +5,7 @@ pluginName = IntelliJ Nuxt.js Plugin pluginRepositoryUrl = https://github.com/KartanHQ/intellij-nuxtjs # SemVer format -> https://semver.org -pluginVersion = 2.0.5 +pluginVersion = 2.0.6 # Supported build number ranges and IntelliJ Platform versions -> https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html pluginSinceBuild = 222 diff --git a/src/test/kotlin/com/nekofar/milad/intellij/nuxtjs/UITest.kt b/src/test/kotlin/com/nekofar/milad/intellij/nuxtjs/UITest.kt deleted file mode 100644 index 0bb5049d..00000000 --- a/src/test/kotlin/com/nekofar/milad/intellij/nuxtjs/UITest.kt +++ /dev/null @@ -1,69 +0,0 @@ -package com.nekofar.milad.intellij.nuxtjs - -import com.automation.remarks.junit5.Video -import com.intellij.remoterobot.RemoteRobot -import com.intellij.remoterobot.search.locators.byXpath -import com.intellij.remoterobot.stepsProcessing.step -import com.intellij.remoterobot.utils.waitFor -import com.nekofar.milad.intellij.nuxtjs.fixtures.terminal -import com.nekofar.milad.intellij.nuxtjs.pages.dialog -import com.nekofar.milad.intellij.nuxtjs.pages.idea -import com.nekofar.milad.intellij.nuxtjs.pages.welcomeFrame -import com.nekofar.milad.intellij.nuxtjs.utils.RemoteRobotExtension -import com.nekofar.milad.intellij.nuxtjs.utils.StepsLogger -import org.junit.jupiter.api.AfterEach -import org.junit.jupiter.api.MethodOrderer.OrderAnnotation -import org.junit.jupiter.api.Order -import org.junit.jupiter.api.Test -import org.junit.jupiter.api.TestMethodOrder -import org.junit.jupiter.api.extension.ExtendWith -import java.time.Duration.ofSeconds - -@TestMethodOrder(OrderAnnotation::class) -@ExtendWith(RemoteRobotExtension::class) -class UITest { - init { - StepsLogger.init() - } - - @AfterEach - fun closeProject(remoteRobot: RemoteRobot) = with(remoteRobot) { - idea { - menuBar.select("File", "Close Project") - } - } - - @Test - @Video - @Order(1) - fun createNewProject(remoteRobot: RemoteRobot) = with(remoteRobot) { - welcomeFrame { - createNewProjectLink.click() - dialog("New Project") { - findText("JavaScript").click() - jList( - byXpath( - "//div[contains(@visible_text_keys, 'create.react.app.name')]" - ) - ).clickItem("Nuxt.js") - button("Next").click() - button("Finish").click() - } - } - idea { - waitForFinishBackgroundTasks() - step("Find terminal") { - terminal().click() - } - step("Find config file") { - with(projectViewTree) { - if (hasText("nuxt.config.js").not()) { - findText(projectName).doubleClick() - waitFor(ofSeconds(10)) { hasText("nuxt.config.js") } - } - findText("nuxt.config.js").click() - } - } - } - } -} \ No newline at end of file diff --git a/src/test/kotlin/com/nekofar/milad/intellij/nuxtjs/fixtures/TerminalFixture.kt b/src/test/kotlin/com/nekofar/milad/intellij/nuxtjs/fixtures/TerminalFixture.kt deleted file mode 100644 index 527daac4..00000000 --- a/src/test/kotlin/com/nekofar/milad/intellij/nuxtjs/fixtures/TerminalFixture.kt +++ /dev/null @@ -1,46 +0,0 @@ -package com.nekofar.milad.intellij.nuxtjs.fixtures - -import com.intellij.remoterobot.RemoteRobot -import com.intellij.remoterobot.data.RemoteComponent -import com.intellij.remoterobot.fixtures.ComponentFixture -import com.intellij.remoterobot.fixtures.ContainerFixture -import com.intellij.remoterobot.fixtures.DefaultXpath -import com.intellij.remoterobot.fixtures.FixtureName -import com.intellij.remoterobot.stepsProcessing.step -import com.intellij.remoterobot.utils.Locators -import com.intellij.terminal.JBTerminalPanel -import java.time.Duration - -fun ContainerFixture.terminal( - timeout: Duration = Duration.ofSeconds(20), - function: TerminalFixture.() -> Unit = {} -): TerminalFixture = step("Search for terminal") { - find(timeout).apply(function) -} - -@Suppress("JSUnresolvedFunction", "unused") -@DefaultXpath(by = "JBTerminalPanel type", xpath = "//div[@class='JBTerminalPanel']") -@FixtureName("Terminal") -class TerminalFixture( - remoteRobot: RemoteRobot, - remoteComponent: RemoteComponent -) : ComponentFixture(remoteRobot, remoteComponent) { - companion object { - fun byType() = Locators.byType(JBTerminalPanel::class.java) - } - - val windowTitle: String - get() = step("Get window title") { - callJs("""component.getWindowTitle() || """"", true) - } - - val screenLines: String - get() = step("Get screen lines") { - callJs("""component.getTerminalTextBuffer().getScreenLines() || """"", true) - } - - val screenLinesCount: Int - get() = step("Get screen lines count") { - callJs("""component.getTerminalTextBuffer().getScreenLinesCount() || 0""", true) - } -} \ No newline at end of file diff --git a/src/test/kotlin/com/nekofar/milad/intellij/nuxtjs/pages/DialogFixture.kt b/src/test/kotlin/com/nekofar/milad/intellij/nuxtjs/pages/DialogFixture.kt deleted file mode 100644 index ea82b63a..00000000 --- a/src/test/kotlin/com/nekofar/milad/intellij/nuxtjs/pages/DialogFixture.kt +++ /dev/null @@ -1,33 +0,0 @@ -package com.nekofar.milad.intellij.nuxtjs.pages - -import com.intellij.remoterobot.RemoteRobot -import com.intellij.remoterobot.data.RemoteComponent -import com.intellij.remoterobot.fixtures.CommonContainerFixture -import com.intellij.remoterobot.fixtures.ContainerFixture -import com.intellij.remoterobot.fixtures.FixtureName -import com.intellij.remoterobot.search.locators.byXpath -import com.intellij.remoterobot.stepsProcessing.step -import java.time.Duration - -fun ContainerFixture.dialog( - title: String, - timeout: Duration = Duration.ofSeconds(20), - function: DialogFixture.() -> Unit = {} -): DialogFixture = step("Search for dialog with title $title") { - find(DialogFixture.byTitle(title), timeout).apply(function) -} - -@FixtureName("Dialog") -class DialogFixture( - remoteRobot: RemoteRobot, - remoteComponent: RemoteComponent -) : CommonContainerFixture(remoteRobot, remoteComponent) { - - companion object { - @JvmStatic - fun byTitle(title: String) = byXpath("title $title", "//div[@title='$title' and @class='MyDialog']") - } - - val title: String - get() = callJs("component.getTitle();") -} \ No newline at end of file diff --git a/src/test/kotlin/com/nekofar/milad/intellij/nuxtjs/pages/IdeaFrame.kt b/src/test/kotlin/com/nekofar/milad/intellij/nuxtjs/pages/IdeaFrame.kt deleted file mode 100644 index e318dd73..00000000 --- a/src/test/kotlin/com/nekofar/milad/intellij/nuxtjs/pages/IdeaFrame.kt +++ /dev/null @@ -1,51 +0,0 @@ -package com.nekofar.milad.intellij.nuxtjs.pages - -import com.intellij.remoterobot.RemoteRobot -import com.intellij.remoterobot.data.RemoteComponent -import com.intellij.remoterobot.fixtures.* -import com.intellij.remoterobot.search.locators.byXpath -import com.intellij.remoterobot.stepsProcessing.step -import com.intellij.remoterobot.utils.waitFor -import java.lang.Thread.currentThread -import java.lang.Thread.sleep -import java.time.Duration.ofSeconds - - -fun RemoteRobot.idea(function: IdeaFrame.() -> Unit) { - find(timeout = ofSeconds(10)).apply(function) -} - -@FixtureName("Idea frame") -@DefaultXpath("IdeFrameImpl type", "//div[@class='IdeFrameImpl']") -class IdeaFrame(remoteRobot: RemoteRobot, remoteComponent: RemoteComponent) : - CommonContainerFixture(remoteRobot, remoteComponent) { - - val inlineProgressPanel - get() = find(byXpath("//div[@class='InlineProgressPanel']")) - - val projectViewTree - get() = find(byXpath("ProjectViewTree", "//div[@class='ProjectViewTree']")) - - val projectName - get() = step("Get project name") { return@step callJs("component.getProject().getName()") } - - val menuBar - get() = step("Menu...") { return@step remoteRobot.find(JMenuBarFixture::class.java, JMenuBarFixture.byType()) } - - fun waitForFinishBackgroundTasks() { - waitFor(ofSeconds(300), ofSeconds(10), "The background tasks did not finish in 5 minutes.") { - (0..4).forEach { _ -> - val inlineProgressPanelContent = inlineProgressPanel.findAllText() - if (inlineProgressPanelContent.isNotEmpty()) { - return@waitFor false - } - try { - sleep(1000) - } catch (e: InterruptedException) { - currentThread().interrupt() - } - } - return@waitFor true - } - } -} \ No newline at end of file diff --git a/src/test/kotlin/com/nekofar/milad/intellij/nuxtjs/pages/WelcomeFrame.kt b/src/test/kotlin/com/nekofar/milad/intellij/nuxtjs/pages/WelcomeFrame.kt deleted file mode 100644 index dd4fd5e0..00000000 --- a/src/test/kotlin/com/nekofar/milad/intellij/nuxtjs/pages/WelcomeFrame.kt +++ /dev/null @@ -1,26 +0,0 @@ -package com.nekofar.milad.intellij.nuxtjs.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 com.intellij.remoterobot.search.locators.byXpath -import java.time.Duration - -fun RemoteRobot.welcomeFrame(function: WelcomeFrame.() -> Unit) { - find(WelcomeFrame::class.java, Duration.ofSeconds(10)).apply(function) -} - -@FixtureName("Welcome Frame") -@DefaultXpath("type", "//div[@class='FlatWelcomeFrame']") -class WelcomeFrame(remoteRobot: RemoteRobot, remoteComponent: RemoteComponent) : - CommonContainerFixture(remoteRobot, remoteComponent) { - val createNewProjectLink - get() = actionLink( - byXpath( - "New Project", - "//div[(@class='MainButton' and @text='New Project') or (@accessiblename='New Project' and @class='JButton')]" - ) - ) -} \ No newline at end of file diff --git a/src/test/kotlin/com/nekofar/milad/intellij/nuxtjs/utils/RemoteRobotExtension.kt b/src/test/kotlin/com/nekofar/milad/intellij/nuxtjs/utils/RemoteRobotExtension.kt deleted file mode 100644 index b2c4691b..00000000 --- a/src/test/kotlin/com/nekofar/milad/intellij/nuxtjs/utils/RemoteRobotExtension.kt +++ /dev/null @@ -1,19 +0,0 @@ -package com.nekofar.milad.intellij.nuxtjs.utils - -import com.intellij.remoterobot.RemoteRobot -import org.junit.jupiter.api.extension.ExtensionContext -import org.junit.jupiter.api.extension.ParameterContext -import org.junit.jupiter.api.extension.ParameterResolver - -class RemoteRobotExtension : ParameterResolver { - private val url = System.getProperty("remote-robot-url") ?: "http://127.0.0.1:8082" - private val remoteRobot = RemoteRobot(url) - - override fun supportsParameter( - parameterContext: ParameterContext?, extensionContext: ExtensionContext? - ) = parameterContext?.parameter?.type?.equals(RemoteRobot::class.java) ?: false - - override fun resolveParameter( - parameterContext: ParameterContext?, extensionContext: ExtensionContext? - ) = remoteRobot -} \ No newline at end of file diff --git a/src/test/kotlin/com/nekofar/milad/intellij/nuxtjs/utils/StepsLogger.kt b/src/test/kotlin/com/nekofar/milad/intellij/nuxtjs/utils/StepsLogger.kt deleted file mode 100644 index e9901194..00000000 --- a/src/test/kotlin/com/nekofar/milad/intellij/nuxtjs/utils/StepsLogger.kt +++ /dev/null @@ -1,15 +0,0 @@ -package com.nekofar.milad.intellij.nuxtjs.utils - -import com.intellij.remoterobot.stepsProcessing.StepLogger -import com.intellij.remoterobot.stepsProcessing.StepWorker - -object StepsLogger { - private var initializaed = false - @JvmStatic - fun init() = synchronized(initializaed) { - if (initializaed.not()) { - StepWorker.registerProcessor(StepLogger()) - initializaed = true - } - } -} \ No newline at end of file diff --git a/src/test/resources/log4j2.xml b/src/test/resources/log4j2.xml deleted file mode 100644 index aad4a7f5..00000000 --- a/src/test/resources/log4j2.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file