mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 04:51:24 +07:00
[remote-driver] add SearchEveryWhereUiTest#testPopupResize
GitOrigin-RevId: c7e80734b753bc6d77c428fa2af4a84b1532d76b
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a67dd3c112
commit
ced38a59c2
@@ -6,6 +6,7 @@ import com.intellij.driver.sdk.ui.Finder
|
||||
import com.intellij.driver.sdk.ui.remote.Window
|
||||
import com.intellij.driver.sdk.waitForOne
|
||||
import org.intellij.lang.annotations.Language
|
||||
import java.awt.Rectangle
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
fun Finder.popup(@Language("xpath") xpath: String? = null) =
|
||||
@@ -44,6 +45,8 @@ open class PopupUiComponent(data: ComponentData) : UiComponent(data) {
|
||||
fun close() = driver.withContext(OnDispatcher.EDT) {
|
||||
popupComponent.dispose()
|
||||
}
|
||||
|
||||
fun setBounds(bounds: Rectangle) = popupComponent.setBounds(bounds.x, bounds.y, bounds.width, bounds.height)
|
||||
}
|
||||
|
||||
@Remote("com.intellij.openapi.actionSystem.impl.ActionMenuItem")
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.intellij.driver.sdk.ui.AccessibleNameCellRendererReader
|
||||
import com.intellij.driver.sdk.ui.Finder
|
||||
import com.intellij.driver.sdk.ui.should
|
||||
import com.intellij.driver.sdk.ui.xQuery
|
||||
import com.intellij.driver.sdk.waitFor
|
||||
import org.intellij.lang.annotations.Language
|
||||
import javax.swing.JList
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
@@ -56,6 +57,11 @@ class SearchEverywherePopupUI(data: ComponentData) : PopupUiComponent(data) {
|
||||
}
|
||||
}
|
||||
|
||||
fun closePopup() {
|
||||
searchEverywhereUi.closePopup()
|
||||
waitFor("Popup is closed") { notPresent() }
|
||||
}
|
||||
|
||||
private fun invokeActionWithShortcut(shortcut: String, chooser: (List<AnAction>) -> AnAction? = { it.singleOrNull() }) {
|
||||
val action = driver.utility(ActionUtils::class).getActions(searchEverywhereUi.component).filter {
|
||||
it.getShortcutSet().getShortcuts().singleOrNull()?.toString() == shortcut
|
||||
@@ -77,10 +83,13 @@ class SearchEverywherePopupUI(data: ComponentData) : PopupUiComponent(data) {
|
||||
private val searchEverywhereUiComponent get() = driver.cast(component, SearchEverywhereUiComponent::class)
|
||||
|
||||
fun getSelectedTabID(): String = searchEverywhereUiComponent.getSelectedTabID()
|
||||
|
||||
fun closePopup() = driver.withContext(OnDispatcher.EDT) { searchEverywhereUiComponent.closePopup() }
|
||||
}
|
||||
|
||||
@Remote("com.intellij.ide.actions.searcheverywhere.SearchEverywhereUI")
|
||||
interface SearchEverywhereUiComponent {
|
||||
fun getSelectedTabID(): String
|
||||
fun closePopup()
|
||||
}
|
||||
}
|
||||
@@ -31,6 +31,7 @@ interface Window: Component {
|
||||
fun dispose()
|
||||
fun requestFocus()
|
||||
fun toFront()
|
||||
fun setBounds(x: Int, y: Int, width: Int, height: Int)
|
||||
}
|
||||
|
||||
@Remote("java.awt.Color")
|
||||
|
||||
Reference in New Issue
Block a user