diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml
index fdc392fe87..e824b92299 100644
--- a/.idea/jarRepositories.xml
+++ b/.idea/jarRepositories.xml
@@ -16,5 +16,10 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/extensions/intellij/build.gradle.kts b/extensions/intellij/build.gradle.kts
index 05dc3c3b3b..0a0db69d43 100644
--- a/extensions/intellij/build.gradle.kts
+++ b/extensions/intellij/build.gradle.kts
@@ -4,14 +4,17 @@ fun properties(key: String) = providers.gradleProperty(key)
fun environment(key: String) = providers.environmentVariable(key)
+val remoteRobotVersion = "0.11.23"
+
plugins {
id("java") // Java support
alias(libs.plugins.kotlin) // Kotlin support
- alias(libs.plugins.gradleIntelliJPlugin) // Gradle IntelliJ Plugin
+// alias(libs.plugins.gradleIntelliJPlugin) // Gradle IntelliJ Plugin
alias(libs.plugins.changelog) // Gradle Changelog Plugin
alias(libs.plugins.qodana) // Gradle Qodana Plugin
alias(libs.plugins.kover) // Gradle Kover Plugin
kotlin("plugin.serialization") version "1.8.0"
+ id("org.jetbrains.intellij") version "1.17.4"
}
group = properties("pluginGroup").get()
@@ -19,7 +22,10 @@ group = properties("pluginGroup").get()
version = properties("pluginVersion").get()
// Configure project's dependencies
-repositories { mavenCentral() }
+repositories {
+ mavenCentral()
+ maven { url = uri("https://packages.jetbrains.team/maven/p/ij/intellij-dependencies") }
+}
// Dependencies are managed with Gradle version catalog - read more:
// https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog
@@ -31,6 +37,10 @@ dependencies {
implementation("org.jetbrains.kotlin:kotlin-stdlib:1.4.32")
implementation("com.posthog.java:posthog:1.+")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.0")
+ testImplementation("com.intellij.remoterobot:remote-robot:$remoteRobotVersion")
+ testImplementation("com.intellij.remoterobot:remote-fixtures:$remoteRobotVersion")
+ testImplementation("org.junit.jupiter:junit-jupiter-api:5.10.0")
+ testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.9.2")
}
// Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for
@@ -70,6 +80,10 @@ qodana {
koverReport { defaults { xml { onCheck = true } } }
tasks {
+ downloadRobotServerPlugin {
+ version.set(remoteRobotVersion)
+ }
+
prepareSandbox {
from("../../binary/bin") { into("${intellij.pluginName.get()}/core/") }
from("../vscode/node_modules/@vscode/ripgrep") { into("${intellij.pluginName.get()}/ripgrep/") }
@@ -108,10 +122,9 @@ tasks {
// Configure UI tests plugin
// Read more: https://github.com/JetBrains/intellij-ui-test-robot
runIdeForUiTests {
- systemProperty("robot-server.port", "8082")
- systemProperty("ide.mac.message.dialogs.as.sheets", "false")
- systemProperty("jb.privacy.policy.text", "")
- systemProperty("jb.consents.confirmation.enabled", "false")
+// systemProperty("robot-server.port", "8082")
+ systemProperty("ide.browser.jcef.jsQueryPoolSize", "10000")
+
}
signPlugin {
@@ -141,4 +154,8 @@ tasks {
"${rootProject.projectDir.parentFile.parentFile}/manual-testing-sandbox/test.kt"
).map { file(it).absolutePath }
}
+
+ test {
+ useJUnitPlatform()
+ }
}
diff --git a/extensions/intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/BrowserTest.kt b/extensions/intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/BrowserTest.kt
new file mode 100644
index 0000000000..c2e43f4972
--- /dev/null
+++ b/extensions/intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/BrowserTest.kt
@@ -0,0 +1,46 @@
+package com.github.continuedev.continueintellijextension
+
+import com.intellij.remoterobot.RemoteRobot
+import com.intellij.remoterobot.fixtures.JCefBrowserFixture
+import com.intellij.remoterobot.search.locators.byXpath
+import org.junit.jupiter.api.Test
+import java.util.concurrent.TimeUnit
+//import org.junit.jupiter.api.extension.ExtendWith
+import com.intellij.remoterobot.stepsProcessing.step
+
+//import org.intellij.examples.simple.plugin.utils.RemoteRobotExtension
+
+//@ExtendWith(RemoteRobotExtension::class)
+class BrowserTest {
+// init {
+// StepsLogger.init()
+// }
+
+ private val remoteRobot = RemoteRobot("http://127.0.0.1:8082")
+
+ @Test
+ fun testAccessJCefBrowser() {
+ // Assume that JCefBrowser is within a frame, window, or dialog in your application.
+ // Locate the JCefBrowser component. You might need to update the XPath based on your UI structure.
+ val jCefBrowser = remoteRobot.find(
+ JCefBrowserFixture::class.java,
+ byXpath("//div[@class='JCefBrowserComponent']")
+ )
+
+ // Interact with the JCef Browser
+ remoteRobot.run {
+ step("Navigate to a URL in JCEF") {
+ // Replace with code that interacts with the JCEF Browser.
+ // This might involve accessing browser features or performing navigation.
+ jCefBrowser.runJs("component.loadURL('https://continue')")
+ }
+
+ step("Check if URL loaded successfully") {
+ TimeUnit.SECONDS.sleep(5) // Wait for the page to load
+ // Example JS command to check a condition in the Browser
+ val title = jCefBrowser.callJs("return component.getTitle();")
+ assert(title.contains("Example Domain")) { "Title does not match" }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/extensions/intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/VerticalDiffBlock.kt b/extensions/intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/VerticalDiffBlock.kt
index 411441c8ed..605d8e864d 100644
--- a/extensions/intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/VerticalDiffBlock.kt
+++ b/extensions/intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/VerticalDiffBlock.kt
@@ -1,3 +1,5 @@
+package com.github.continuedev.continueintellijextension
+
import com.github.continuedev.continueintellijextension.editor.VerticalDiffBlock
import com.intellij.openapi.command.WriteCommandAction
import com.intellij.openapi.editor.Editor
@@ -34,10 +36,6 @@ class VerticalDiffBlockTest : BasePlatformTestCase() {
val textToAdd = "This is a new line"
val startLine = 0
- // Ensure the editor's colorsScheme is initialized
-// val globalScheme = EditorColorsManager.getInstance().globalScheme
-// editor.setScheme(globalScheme) // Use setScheme() instead of setColorsScheme()
-
// Create an instance of VerticalDiffBlock
val verticalDiffBlock = VerticalDiffBlock(
editor = editor,
@@ -53,6 +51,7 @@ class VerticalDiffBlockTest : BasePlatformTestCase() {
// Assert
val documentText = editor.document.text
+
// We expect a newline to be inserted in addition to our line
val expectedText = "$textToAdd\n\n"
assertEquals(expectedText, documentText)