mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[driver][ui-tests] AT-3237 Retrieve TerminalOutputModel from TerminalViewImpl$TerminalPanel
GitOrigin-RevId: eccd8cca9c260ba1ca9239863f135f8694e674e5
This commit is contained in:
committed by
intellij-monorepo-bot
parent
7742011fcd
commit
fe68eb81d4
+6
-20
@@ -11,7 +11,7 @@ import com.intellij.driver.sdk.waitFor
|
||||
import org.intellij.lang.annotations.Language
|
||||
|
||||
|
||||
fun Finder.terminal(@Language("xpath") xpath: String = "//div[contains(@class, 'TerminalPanel') or contains(@class, 'ConsoleTerminalWidget')]") =
|
||||
fun Finder.terminal(@Language("xpath") xpath: String = "//div[contains(@class, 'TerminalPanel') or contains(@class, 'ConsoleTerminalWidget')]"): TerminalDialogUI =
|
||||
x(xpath, TerminalDialogUI::class.java)
|
||||
|
||||
fun Finder.terminal(action: TerminalDialogUI.() -> Unit) {
|
||||
@@ -30,11 +30,7 @@ class TerminalDialogUI(data: ComponentData) : UiComponent(data) {
|
||||
waitFound()
|
||||
}
|
||||
|
||||
val terminalView: TerminalView
|
||||
get() = driver.cast(component, TerminalView::class)
|
||||
val terminalOutputModel: TerminalOutputModel get() = terminalView.outputModels.active.value
|
||||
val cursorOffset: Long get() = terminalOutputModel.cursorOffset.toAbsolute()
|
||||
|
||||
val terminalView: TerminalViewImpl by lazy { driver.cast(component, TerminalViewImpl::class) }
|
||||
|
||||
|
||||
|
||||
@@ -58,20 +54,10 @@ class RdPortForwardingPanelWidget(data: ComponentData) : UiComponent(data) {
|
||||
get() = x { byJavaClass("com.jetbrains.thinclient.portForwarding.ui.ForwardedPortDropDownLink") }
|
||||
}
|
||||
|
||||
@Remote("com.intellij.terminal.frontend.view.TerminalView", plugin = "org.jetbrains.plugins.terminal/intellij.terminal.frontend")
|
||||
interface TerminalView {
|
||||
fun getActiveOutputModel(): TerminalOutputModel
|
||||
val outputModels: TerminalOutputModelsSet
|
||||
}
|
||||
|
||||
@Remote("org.jetbrains.plugins.terminal.view.TerminalOutputModelsSet", plugin = "org.jetbrains.plugins.terminal")
|
||||
interface TerminalOutputModelsSet {
|
||||
val active: StateFlow<TerminalOutputModel>
|
||||
}
|
||||
|
||||
@Remote("kotlinx.coroutines.flow.StateFlow")
|
||||
interface StateFlow<out T> {
|
||||
val value: T
|
||||
@Suppress("InjectedReferences")
|
||||
@Remote("com.intellij.terminal.frontend.view.impl.TerminalViewImpl\$TerminalPanel", plugin = "org.jetbrains.plugins.terminal/intellij.terminal.frontend")
|
||||
interface TerminalViewImpl {
|
||||
fun getActiveOutputModel() : TerminalOutputModel
|
||||
}
|
||||
|
||||
@Remote("org.jetbrains.plugins.terminal.block.reworked.TerminalOutputModel")
|
||||
|
||||
+8
-2
@@ -123,8 +123,8 @@ class TerminalViewImpl(
|
||||
get() = getCurEditor().calculateTerminalSize()
|
||||
override val title: TerminalTitle = TerminalTitle()
|
||||
|
||||
//@VisibleForTesting
|
||||
override fun getActiveOutputModel(): TerminalOutputModel{
|
||||
@VisibleForTesting
|
||||
override fun getActiveOutputModel(): TerminalOutputModel {
|
||||
return outputModels.active.value
|
||||
}
|
||||
private val mutableOutputModels: TerminalOutputModelsSetImpl
|
||||
@@ -601,6 +601,12 @@ class TerminalViewImpl(
|
||||
updateFocusListeners(initialContent, initialContent)
|
||||
}
|
||||
|
||||
@Suppress("unused")
|
||||
@VisibleForTesting
|
||||
private fun getActiveOutputModel(): TerminalOutputModel {
|
||||
return outputModels.active.value
|
||||
}
|
||||
|
||||
override fun uiDataSnapshot(sink: DataSink) {
|
||||
sink[TerminalView.DATA_KEY] = this@TerminalViewImpl
|
||||
sink[TerminalActionUtil.EDITOR_KEY] = curEditor
|
||||
|
||||
Reference in New Issue
Block a user