mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[remote-driver] add BuiltInHttpClientRequestWithBodyGenerationUiTest
GitOrigin-RevId: 01933923294bb32fce33908f81128cccf0630b04
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2cf29328a1
commit
901ab35a48
@@ -5,6 +5,7 @@ import com.intellij.driver.client.Remote
|
||||
import com.intellij.driver.client.service
|
||||
import com.intellij.driver.model.OnDispatcher
|
||||
import com.intellij.driver.sdk.remoteDev.GuestNavigationService
|
||||
import com.intellij.driver.sdk.ui.RectangleRef
|
||||
import java.awt.Point
|
||||
import kotlin.time.Duration.Companion.seconds
|
||||
|
||||
@@ -17,9 +18,10 @@ interface Editor {
|
||||
fun getVirtualFile(): VirtualFile
|
||||
fun getLineHeight(): Int
|
||||
fun offsetToVisualPosition(offset: Int): VisualPosition
|
||||
fun visualPositionToXY(visible: VisualPosition): Point
|
||||
fun visualPositionToXY(visualPosition: VisualPosition): Point
|
||||
fun getInlayModel(): InlayModel
|
||||
fun getColorsScheme(): EditorColorsScheme
|
||||
fun logicalPositionToOffset(logicalPosition: LogicalPosition): Int
|
||||
}
|
||||
@Remote("com.intellij.openapi.editor.VisualPosition")
|
||||
interface VisualPosition {
|
||||
@@ -49,6 +51,7 @@ interface InlayModel {
|
||||
interface Inlay {
|
||||
fun getRenderer(): EditorCustomElementRenderer
|
||||
fun getOffset(): Int
|
||||
fun getBounds(): RectangleRef
|
||||
}
|
||||
|
||||
@Remote("com.intellij.openapi.editor.EditorCustomElementRenderer")
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.intellij.driver.sdk.*
|
||||
import com.intellij.driver.sdk.remoteDev.BeControlClass
|
||||
import com.intellij.driver.sdk.remoteDev.EditorComponentImplBeControlBuilder
|
||||
import com.intellij.driver.sdk.ui.Finder
|
||||
import com.intellij.driver.sdk.ui.center
|
||||
import com.intellij.driver.sdk.ui.remote.Component
|
||||
import org.intellij.lang.annotations.Language
|
||||
import java.awt.Point
|
||||
@@ -37,6 +38,11 @@ class JEditorUiComponent(data: ComponentData) : UiComponent(data) {
|
||||
|
||||
fun isEditable() = editorComponent.isEditable()
|
||||
|
||||
fun clickInlay(inlay: Inlay) {
|
||||
val inlayCenter = driver.withContext(OnDispatcher.EDT) { inlay.getBounds() }.center
|
||||
click(inlayCenter)
|
||||
}
|
||||
|
||||
fun getInlayHints(): List<InlayHint> {
|
||||
val hints = mutableListOf<InlayHint>()
|
||||
this.editor.getInlayModel().getInlineElementsInRange(0, Int.MAX_VALUE).forEach { element ->
|
||||
|
||||
@@ -61,6 +61,8 @@ interface RectangleRef {
|
||||
fun getCenterY(): Double
|
||||
}
|
||||
|
||||
val RectangleRef.center get() = Point(getCenterX().toInt(), getCenterY().toInt())
|
||||
|
||||
fun printableString(toPrint: String): String {
|
||||
val resultString = toPrint.let {
|
||||
val maxLength = 600
|
||||
|
||||
Reference in New Issue
Block a user