mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[driver][ui-tests] Added an ability of right-clicking with retries
GitOrigin-RevId: 8e28a882e79e99cc3511ca4266e58589c58aab89
This commit is contained in:
committed by
intellij-monorepo-bot
parent
04fc41ddac
commit
d611071c86
+3
-3
@@ -409,13 +409,13 @@ open class UiComponent(private val data: ComponentData) : Finder, WithKeyboard {
|
||||
}
|
||||
|
||||
// Mouse
|
||||
fun click(point: Point? = null) {
|
||||
fun click(point: Point? = null, mouseButton: RemoteMouseButton = RemoteMouseButton.LEFT) {
|
||||
LOG.info("Click at $this${point?.let { ": $it" } ?: ""}")
|
||||
if (point != null) {
|
||||
withComponent { robot.click(it, point) }
|
||||
withComponent { robot.click(it, point, mouseButton) }
|
||||
}
|
||||
else {
|
||||
withComponent { robot.click(it) }
|
||||
withComponent { robot.click(it, mouseButton) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,9 @@ interface Robot {
|
||||
fun click(component: Component, mouseButton: RemoteMouseButton)
|
||||
fun click(component: Component, mouseButton: RemoteMouseButton, counts: Int)
|
||||
fun click(component: Component, point: Point)
|
||||
fun click(point: Point, button: RemoteMouseButton)
|
||||
fun click(point: Point, button: RemoteMouseButton, times: Int)
|
||||
fun click(component: Component, point: Point, button: RemoteMouseButton)
|
||||
fun click(component: Component, point: Point, button: RemoteMouseButton, times: Int)
|
||||
fun pressAndReleaseKey(keyCode: Int, vararg modifiers: Int)
|
||||
fun pressModifiers(modifierMask: Int)
|
||||
|
||||
+8
@@ -109,6 +109,14 @@ internal class SmoothRobot @JvmOverloads constructor(
|
||||
click(c, where, button.toAssertJ(), times)
|
||||
}
|
||||
|
||||
fun click(c: Component, where: Point, button: RemoteMouseButton) {
|
||||
click(c, where, button.toAssertJ(), 1)
|
||||
}
|
||||
|
||||
fun click(where: Point, button: RemoteMouseButton) {
|
||||
click(where, button.toAssertJ(), 1)
|
||||
}
|
||||
|
||||
fun click(where: Point, button: RemoteMouseButton, times: Int) {
|
||||
click(where, button.toAssertJ(), times)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user