[remote-driver] fix JCefUI

GitOrigin-RevId: 78f642297735a0625bee4341698d0340524b6247
This commit is contained in:
vladislav.shishov
2024-10-03 22:52:33 +00:00
committed by intellij-monorepo-bot
parent 5f44d48b99
commit 5b394dc5ef
2 changed files with 3 additions and 3 deletions
@@ -44,6 +44,7 @@ fun Finder.jcef(@Language("xpath") xpath: String? = null, action: JCefUI.() -> U
class JCefUI(data: ComponentData) : UiComponent(data) {
private val jcefWorker by lazy {
driver.new(JcefComponentWrapper::class, component).apply {
waitFor("Document exists") { hasDocument() }
runJs(initScript)
}
}
@@ -94,7 +95,6 @@ class JCefUI(data: ComponentData) : UiComponent(data) {
fun getUrl(): String = jcefWorker.getUrl()
fun getHtml(): String {
waitFor("Document exists") { hasDocument() }
return callJs("""document.documentElement.outerHTML""")
}
@@ -49,10 +49,10 @@ internal class JcefComponentWrapper(private val component: Component) {
jbCefBrowser = currentComponent.getClientProperty(JB_BROWSER_KEY)
currentComponent = currentComponent.parent as JComponent
}
require(jbCefBrowser != null) {
check(jbCefBrowser != null) {
"Failed to retrieve jbCefBrowser from $component"
}
require(jbCefBrowser is JBCefBrowserBase) {
check(jbCefBrowser is JBCefBrowserBase) {
"$jbCefBrowser is not JBCefBrowser"
}
return jbCefBrowser