mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[remote-driver] JCefUI : inject elementFinder with retries
GitOrigin-RevId: a9b670554cbb0cc55695886de8dc69019ec41ee4
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3a70d10836
commit
73d7090650
@@ -5,6 +5,7 @@ import com.intellij.driver.sdk.ui.Finder
|
||||
import com.intellij.driver.sdk.ui.remote.REMOTE_ROBOT_MODULE_ID
|
||||
import com.intellij.driver.sdk.waitFor
|
||||
import com.intellij.driver.sdk.waitForOne
|
||||
import com.intellij.driver.sdk.withRetries
|
||||
import kotlinx.serialization.Serializable
|
||||
import kotlinx.serialization.json.Json
|
||||
import org.intellij.lang.annotations.Language
|
||||
@@ -106,7 +107,10 @@ class JCefUI(data: ComponentData) : UiComponent(data) {
|
||||
private fun String.escapeXpath() = replace("'", "\\x27").replace("\"", "\\x22")
|
||||
|
||||
private fun injectElementFinderIfNeeded() {
|
||||
if (!jcefWorker.callJs("!!window.elementFinder", 3_000).toBoolean()) {
|
||||
val isElementFinderInjected = withRetries("check elementFinder injected", 2) {
|
||||
jcefWorker.callJs("!!window.elementFinder", 3_000)
|
||||
}.toBoolean()
|
||||
if (!isElementFinderInjected) {
|
||||
jcefWorker.runJs(initScript)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user