#斷言存在
assert_exists(Template(r"tpl1611284952927.png", record_pos=(0.062, -0.287), resolution=(720, 1280)), "請填寫測試點")
#斷言包含
value = poco("com.createwit.kaidan:id/synthesize_tv").attr("text")
try:
assert_equal(value, "綜合", "按鈕值為:綜合")
except AssertionError:
print("按鈕值斷言失敗")
#判斷是否存在某個按鈕,具有則點擊,不具有則執行其他操作
if exists(Template(r"tpl1611283287349.png", record_pos=(0.004, -0.157), resolution=(720, 1280))) :
touch exists(Template(r"tpl1611283287349.png", record_pos=(0.004, -0.157), resolution=(720, 1280)))
else:
print("沒有這個選項")