airtest.core.linux.linux module¶
-
class
Linux
(pid=None, **kwargs)[源代码]¶ -
Linux desktop.
-
shell
(cmd)[源代码]¶ Run shell command in subprocess
参数: cmd – command to be run Raises: subprocess.CalledProcessError
– when command returns non-zero exit status返回: command output as a byte string
-
snapshot
(filename='tmp.png', quality=None)[源代码]¶ Take a screenshot and save it to tmp.png filename by default
参数: - filename – name of file where to store the screenshot
- quality – ignored
返回: display the screenshot
-
keyevent
(keyname, **kwargs)[源代码]¶ Perform a key event
References
https://pywinauto.readthedocs.io/en/latest/code/pywinauto.keyboard.html
参数: - keyname – key event
- **kwargs – optional arguments
返回: None
-
text
(text, **kwargs)[源代码]¶ Input text
参数: - text – text to input
- **kwargs – optional arguments
返回: None
-
touch
(pos, **kwargs)[源代码]¶ Perform mouse click action
References
https://pywinauto.readthedocs.io/en/latest/code/pywinauto.mouse.html
参数: - pos – coordinates where to click
- **kwargs – optional arguments
返回: None
-
swipe
(p1, p2, duration=0.8, steps=5)[源代码]¶ Perform swipe (mouse press and mouse release) :param p1: start point :param p2: end point :param duration: time interval to perform the swipe action :param steps: size of the swipe step
返回: None
-