From 71ebfc4c2fa00f209832f8cdd11a29a5505fc024 Mon Sep 17 00:00:00 2001 From: Sergei Kharitontcev-Beglov Date: Wed, 23 Apr 2025 12:47:03 +0200 Subject: [PATCH] [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 --- .../common/toolwindows/StructureToolWindowUi.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/ui/components/common/toolwindows/StructureToolWindowUi.kt b/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/ui/components/common/toolwindows/StructureToolWindowUi.kt index 5e625dd9472c..e79cc9fdb0c5 100644 --- a/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/ui/components/common/toolwindows/StructureToolWindowUi.kt +++ b/platform/remote-driver/test-sdk/src/com/intellij/driver/sdk/ui/components/common/toolwindows/StructureToolWindowUi.kt @@ -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? = 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)) }