-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c9b2abc
commit 6f0ca64
Showing
4 changed files
with
77 additions
and
10 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
.../intellij/src/test/kotlin/com/github/continuedev/continueintellijextension/BrowserTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<String>("return component.getTitle();") | ||
assert(title.contains("Example Domain")) { "Title does not match" } | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters