# UE4游戏的poco初始化脚本 from poco.drivers.ue4 import UE4Poco poco = UE4Poco()
3)Cocos-lua poco:Cocos2dx-lua游戏专用
1 2 3
# UE4游戏的poco初始化脚本 from poco.drivers.ue4 import UE4Poco poco = UE4Poco()
4)Cocos-js poco:Cocos2dx-js和Cocos-Creator游戏使用
1 2 3
# Cocos2dx-js和Cocos-Creator游戏的poco初始化脚本 from poco.drivers.cocosjs import CocosJsPoco poco = CocosJsPoco()
5)Android poco:Android原生应用专用
1 2 3
# Android原生应用的初始化脚本 from poco.drivers.android.uiautomation import AndroidUiautomationPoco poco = AndroidUiautomationPoco(use_airtest_input=True, screenshot_each_action=False)
from airtest.core.api import * auto_setup(__file__)
# 初始化Android poco from poco.drivers.android.uiautomation import AndroidUiautomationPoco poco = AndroidUiautomationPoco(use_airtest_input=True, screenshot_each_action=False)
poco(text="poco").click()
sleep(5.0)
# 初始化unity poco from poco.drivers.unity3d import UnityPoco poco = UnityPoco()
poco("btn_start").click()
sleep(2.0)
keyevent("HOME")
当然,为了区分不同的poco,我们也可以在初始化的时候给poco设置不一样的变量名,比如:
1 2 3 4
from poco.drivers.unity3d import UnityPoco unity_poco = UnityPoco()
from poco.drivers.android.uiautomation import AndroidUiautomationPoco poco = AndroidUiautomationPoco(use_airtest_input=True, screenshot_each_action=False)
from poco.drivers.android.uiautomation import AndroidUiautomationPoco poco = AndroidUiautomationPoco(use_airtest_input=True, screenshot_each_action=False)