mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[driver][ui-tests] AT-3237 Added tests for new terminal
GitOrigin-RevId: 22abcf398a3d0bea9f69b1b480ee66fcf9b63ce3
This commit is contained in:
committed by
intellij-monorepo-bot
parent
fe68eb81d4
commit
813b05defa
@@ -38,6 +38,5 @@
|
||||
<orderEntry type="module" module-name="intellij.driver.model" />
|
||||
<orderEntry type="module" module-name="intellij.platform.util" />
|
||||
<orderEntry type="module" module-name="intellij.platform.ui.jcef" />
|
||||
<orderEntry type="module" module-name="intellij.terminal" />
|
||||
</component>
|
||||
</module>
|
||||
+19
-8
@@ -11,17 +11,32 @@ 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')]"): TerminalDialogUI =
|
||||
fun Finder.terminal(@Language("xpath") xpath: String = "//div[contains(@class, 'TerminalToolWindow') or contains(@class, 'ConsoleTerminalWidget')]"): TerminalDialogUI =
|
||||
x(xpath, TerminalDialogUI::class.java)
|
||||
|
||||
fun Finder.terminal(action: TerminalDialogUI.() -> Unit) {
|
||||
x("//div[contains(@class, 'TerminalPanel') or contains(@class, 'ConsoleTerminalWidget')]", TerminalDialogUI::class.java).action()
|
||||
x("//div[contains(@class, 'TerminalToolWindow') or contains(@class, 'ConsoleTerminalWidget')]", TerminalDialogUI::class.java).action()
|
||||
}
|
||||
|
||||
fun Finder.terminalPanel(@Language("xpath") xpath: String = "//div[contains(@class, 'TerminalPanel')]"): TerminalPanelUi =
|
||||
x(xpath, TerminalPanelUi::class.java)
|
||||
|
||||
fun Finder.terminalPanel(action: TerminalPanelUi.() -> Unit) {
|
||||
x("//div[contains(@class, 'TerminalPanel')]", TerminalPanelUi::class.java).action()
|
||||
}
|
||||
|
||||
fun Driver.terminal(action: TerminalDialogUI.() -> Unit) {
|
||||
this.ui.terminal(action)
|
||||
}
|
||||
|
||||
fun Driver.terminalPanel(action: TerminalPanelUi.() -> Unit) {
|
||||
this.ui.terminalPanel(action)
|
||||
}
|
||||
|
||||
class TerminalPanelUi(data: ComponentData) : UiComponent(data) {
|
||||
val terminalView: TerminalViewImpl by lazy { driver.cast(component, TerminalViewImpl::class) }
|
||||
}
|
||||
|
||||
class TerminalDialogUI(data: ComponentData) : UiComponent(data) {
|
||||
init {
|
||||
if (notPresent()) {
|
||||
@@ -30,10 +45,6 @@ class TerminalDialogUI(data: ComponentData) : UiComponent(data) {
|
||||
waitFound()
|
||||
}
|
||||
|
||||
val terminalView: TerminalViewImpl by lazy { driver.cast(component, TerminalViewImpl::class) }
|
||||
|
||||
|
||||
|
||||
val rdPortForwardingPanelWidget: RdPortForwardingPanelWidget
|
||||
get() = x(RdPortForwardingPanelWidget::class.java) { byJavaClass("com.jetbrains.thinclient.portForwarding.ThinClientPortForwardingPanelWidget") }
|
||||
|
||||
@@ -60,12 +71,12 @@ interface TerminalViewImpl {
|
||||
fun getActiveOutputModel() : TerminalOutputModel
|
||||
}
|
||||
|
||||
@Remote("org.jetbrains.plugins.terminal.block.reworked.TerminalOutputModel")
|
||||
@Remote("org.jetbrains.plugins.terminal.view.TerminalOutputModel")
|
||||
interface TerminalOutputModel {
|
||||
val cursorOffset: TerminalOffset
|
||||
}
|
||||
|
||||
@Remote("org.jetbrains.plugins.terminal.block.reworked.TerminalOffset", plugin = "org.jetbrains.plugins.terminal")
|
||||
@Remote("org.jetbrains.plugins.terminal.view.TerminalOffset", plugin = "org.jetbrains.plugins.terminal")
|
||||
interface TerminalOffset {
|
||||
fun toAbsolute(): Long
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Deferred
|
||||
import kotlinx.coroutines.flow.StateFlow
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
import org.jetbrains.plugins.terminal.block.reworked.TerminalOutputModel
|
||||
import org.jetbrains.plugins.terminal.session.TerminalGridSize
|
||||
import org.jetbrains.plugins.terminal.session.TerminalStartupOptions
|
||||
import org.jetbrains.plugins.terminal.view.TerminalOutputModel
|
||||
@@ -125,10 +124,6 @@ interface TerminalView {
|
||||
*/
|
||||
fun createSendTextBuilder(): TerminalSendTextBuilder
|
||||
|
||||
// todo
|
||||
|
||||
fun getActiveOutputModel(): TerminalOutputModel
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* The data context key for accessing the Terminal View from actions.
|
||||
|
||||
+2
-5
@@ -123,10 +123,6 @@ class TerminalViewImpl(
|
||||
get() = getCurEditor().calculateTerminalSize()
|
||||
override val title: TerminalTitle = TerminalTitle()
|
||||
|
||||
@VisibleForTesting
|
||||
override fun getActiveOutputModel(): TerminalOutputModel {
|
||||
return outputModels.active.value
|
||||
}
|
||||
private val mutableOutputModels: TerminalOutputModelsSetImpl
|
||||
override val outputModels: TerminalOutputModelsSet
|
||||
|
||||
@@ -602,8 +598,9 @@ class TerminalViewImpl(
|
||||
}
|
||||
|
||||
@Suppress("unused")
|
||||
@ApiStatus.Internal
|
||||
@VisibleForTesting
|
||||
private fun getActiveOutputModel(): TerminalOutputModel {
|
||||
fun getActiveOutputModel(): TerminalOutputModel {
|
||||
return outputModels.active.value
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user