[rdct] IJPL-183262: Do not Expand All

Some test runs have been failed due to expanding timeout. This commit changes the way how the logical tab selection check works from expanding all to expanding only a necessary path

GitOrigin-RevId: 0393fcf37f028f3b9e88cb7dae31b225b333f646
This commit is contained in:
Sergei Kharitontcev-Beglov
2025-04-23 19:19:43 +00:00
committed by intellij-monorepo-bot
parent b913b727e8
commit 71ebfc4c2f
@@ -9,6 +9,7 @@ import com.intellij.driver.sdk.ui.components.elements.ActionButtonUi
import com.intellij.driver.sdk.ui.components.elements.JTreeUiComponent
import com.intellij.driver.sdk.ui.components.elements.tree
import com.intellij.driver.sdk.ui.rdTarget
import com.intellij.driver.sdk.wait
import org.intellij.lang.annotations.Language
import java.awt.Point
import kotlin.time.Duration.Companion.seconds
@@ -32,6 +33,14 @@ class StructureToolWindowUi(data: ComponentData) : UiComponent(data) {
waitForText?.let { structureTree.waitAnyTexts(message = message, timeout = 10.seconds, predicate = it) }
return structureTree
}
fun waitExpandedAndGetStructureTree(message: String? = null, expandPath: List<String>? = null, waitForText: ((UiText) -> Boolean)? = null): JTreeUiComponent {
val structureTree = structureTree.waitFound(10.seconds)
expandPath?.toTypedArray()?.let {
structureTree.expandPath(*it)
}
waitForText?.let { structureTree.waitAnyTexts(message = message, timeout = 10.seconds, predicate = it) }
return structureTree
}
private val structureTree
get() = tree().apply { replaceCellRendererReader(driver.new(AccessibleNameCellRendererReader::class, rdTarget = component.rdTarget)) }