Controller

interface Controller

显示控制器接口,用于模拟用户对显示设备的各种操作

提供按键、输入文本、返回、滚动和触摸等操作方法

Author

M8Test, [email protected], https://m8test.com

Functions

Link copied to clipboard
abstract fun inputText(text: String)

输入文本

Link copied to clipboard
abstract fun keyDown(keyBuilder: Key.() -> Unit)

模拟按键按下操作

Link copied to clipboard
abstract fun keyUp(keyBuilder: Key.() -> Unit)

模拟按键释放操作

Link copied to clipboard
abstract fun pressBack()

模拟按下返回键

Link copied to clipboard
abstract fun rotateDevice()

请求旋转设备

Link copied to clipboard
abstract fun scroll(scrollBuilder: Scroll.() -> Unit)

模拟滚动操作

Link copied to clipboard
abstract fun scrollDown(steps: Int)

模拟向下滚动(内容向上移动)

Link copied to clipboard
abstract fun scrollLeft(steps: Int)

模拟向左滚动(内容向右移动)

Link copied to clipboard
abstract fun scrollRight(steps: Int)

模拟向右滚动(内容向左移动)

Link copied to clipboard
abstract fun scrollUp(steps: Int)

模拟向上滚动(内容向下移动)

Link copied to clipboard
abstract fun touchDown(touchBuilder: Touch.() -> Unit)

模拟触摸按下操作

Link copied to clipboard
abstract fun touchMove(touchBuilder: Touch.() -> Unit)

模拟触摸移动操作

Link copied to clipboard
abstract fun touchUp(touchBuilder: Touch.() -> Unit)

模拟触摸释放操作