学习笔记——测试进阶之路 工作笔记:QCC 微信小程序自动化测试
大海
·
2020年11月11日
·
1516 次阅读
「原创声明:保留所有权利,禁止转载」
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@File : Test14_乐视网.py
@Time : 2020/11/23
@Author : lin bin
@Email : linbin@greatld.com
"""
__title__ = "微信小程序项目(乐视网企业维度)"
__author__ = "Tester"
__desc__ = """
测试目的:通过遍历微信小程序中企业主页各个维度信息,来完成对小程序的回归测试,保障发布流程的顺利运行。
运行设备:HUAWEI MATE 10
安卓版本:Android V10
网络环境:WiFi
import datetime
from airtest.core.api import *
from airtest.cli.parser import cli_setup
from airtest.report.report import simple_report
from poco.drivers.android.uiautomation import AndroidUiautomationPoco
from poco.exceptions import *
poco = AndroidUiautomationPoco(use_airtest_input=True, screenshot_each_action=False)
if not cli_setup():
auto_setup(__file__, logdir=r"D:/QCC_AIRTEST_PROJECTS/log/Test14_乐视网", project_root=r"D:/QCC_AIRTEST_PROJECTS", devices=[
"android://127.0.0.1:5037/NDF0217B10002156?cap_method=JAVACAP&&ori_method=MINICAPORI&&touch_method=MINITOUCH",
])
# script content
print("start...")
print("------------------------------------- 乐视网信息技术(北京)股份有限公司 ---------------------------------------")
time.sleep(5.0)
try:
if exists(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1628040419991.png", record_pos=(-0.092, -0.317),
resolution=(1440, 2560))):
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1628040419991.png", record_pos=(-0.092, -0.317),
resolution=(1440, 2560)))
else:
touch((400, 800))
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
# 搜索页
print("****************************点击搜索页弹框****************************")
touch((400, 350))
time.sleep(1.0)
touch((400, 350))
time.sleep(1.0)
# 输入搜索词
print("****************************输入搜索词:乐视网信息技术****************************")
text("乐视网信息技术", search=True)
except Exception as e:
log(e, snapshot=True)
print("------------------------------------- 输入:乐视网信息技术(北京)股份有限公司 ----------------------------------")
time.sleep(8.0)
# 点击跳转到主页
try:
poco(text="成立日期", name="android.view.View", type="android.view.View").wait(5.0)
if poco(text="成立日期", name="android.view.View", type="android.view.View").exists():
poco(text="成立日期", name="android.view.View", type="android.view.View").click()
# elif poco(text="2004-11-10", name="android.view.View").exists():
# poco(text="2004-11-10", name="android.view.View").click()
else:
touch((1000, 1200))
except Exception as e:
log(e, snapshot=True)
time.sleep(10.0)
try:
poco(text="乐视网信息技术(北京)股份有限公司", name="android.view.View", type="android.view.View").wait(5.0)
if poco(text="乐视网信息技术(北京)股份有限公司", name="android.view.View", type="android.view.View").exists():
assert_equal(poco(text="乐视网信息技术(北京)股份有限公司", name="android.view.View", type="android.view.View").get_text(),
"乐视网信息技术(北京)股份有限公司", msg="乐视网信息技术(北京)股份有限公司")
else:
assert_equal(poco(text="2004-11-10", name="android.view.View", type="android.view.View").get_text(),
"2004-11-10", msg="2004-11-10")
except Exception as e:
log(e, snapshot=True)
# 滑动到基本信息
print("******************************* 滑动到基本信息 *********************************")
time.sleep(2.0)
swipe((600, 2000), (600, 800), duration=2, steps=5)
time.sleep(2.0)
swipe((600, 2000), (600, 800), duration=2, steps=5)
time.sleep(2.0)
swipe((600, 2000), (600, 900), duration=2, steps=5)
time.sleep(2.0)
swipe((600, 2000), (600, 1700), duration=2, steps=5)
print("--------------------------- 乐视网:企业维度开始遍历 -------------------------------")
############################################################################################
# 基本信息模块
############################################################################################
# 验证财务简析信息
time.sleep(2.0)
print("************************************************************************************")
print("*********************************开始验证:财务简析*************************************")
print("************************************************************************************")
try:
poco(text="财务简析", name="android.view.View", type="android.view.View").wait(5.0)
except Exception as e:
log(e, snapshot=True)
try:
if poco(text="财务简析", name="android.view.View", type="android.view.View").exists():
assert_exists(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1622197737928.png", record_pos=(-0.373, 0.204), resolution=(1080, 1920)),
"财务简析")
poco(text="财务简析", name="android.view.View", type="android.view.View").click()
else:
touch((130, 1700))
except Exception as e:
log(e, snapshot=True)
try:
time.sleep(2.0)
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1634211673872.png", record_pos=(-0.444, -0.759), resolution=(1440, 2560)))
except Exception as e:
log(e, snapshot=True)
# 验证财务数据信息
time.sleep(2.0)
print("************************************************************************************")
print("*********************************开始验证:财务数据*************************************")
print("************************************************************************************")
try:
poco(text="财务数据", name="android.view.View", type="android.view.View").wait(5.0)
except Exception as e:
log(e, snapshot=True)
try:
if poco(text="财务数据", name="android.view.View", type="android.view.View").exists():
assert_exists(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1622197801618.png", record_pos=(-0.124, 0.204), resolution=(1080, 1920)),
"财务数据")
poco(text="财务数据", name="android.view.View", type="android.view.View").click()
else:
touch((500, 1700))
except Exception as e:
log(e, snapshot=True)
time.sleep(3.0)
# try:
# time.sleep(2.0)
# assert_equal(poco(text="利润表", name="android.view.View", type="android.view.View").get_text(),
# "利润表", msg="利润表")
# except Exception as e:
# log(e, snapshot=True)
time.sleep(2.0)
try:
time.sleep(2.0)
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1634211673872.png", record_pos=(-0.444, -0.759), resolution=(1440, 2560)))
except Exception as e:
log(e, snapshot=True)
############################################################################################
# 法律风险模块
############################################################################################
# 滑动到法律风险模块
print("*******************************滑动到法律风险模块***********************************")
time.sleep(2.0)
swipe((600, 1800), (600, 800), duration=2, steps=5)
time.sleep(2.0)
swipe((600, 1800), (600, 800), duration=2, steps=5)
time.sleep(2.0)
swipe((600, 1800), (600, 1400), duration=2, steps=5)
# 验证失信信息
time.sleep(2.0)
print("************************************************************************************")
print("*********************************开始验证:失信信息*************************************")
print("************************************************************************************")
try:
poco(text="失信信息", name="android.view.View", type="android.view.View").wait(5.0)
except Exception as e:
log(e, snapshot=True)
try:
if poco(text="失信信息", name="android.view.View", type="android.view.View").exists():
assert_exists(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1622198042719.png", record_pos=(0.369, -0.45), resolution=(1080, 1920)),
"失信信息")
poco(text="失信信息", name="android.view.View", type="android.view.View").click()
else:
touch((1200, 600))
except Exception as e:
log(e, snapshot=True)
try:
time.sleep(2.0)
assert_equal(poco(text="条失信信息", name="android.widget.TextView", type="android.widget.TextView").get_text(),
"条失信信息", msg="失信信息")
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1634211673872.png", record_pos=(-0.444, -0.759), resolution=(1440, 2560)))
except Exception as e:
log(e, snapshot=True)
# 验证被执行人信息
time.sleep(2.0)
print("************************************************************************************")
print("*********************************开始验证:被执行人信息*********************************")
print("************************************************************************************")
try:
poco(text="被执行人", name="android.view.View", type="android.view.View").wait(5.0)
except Exception as e:
log(e, snapshot=True)
try:
if poco(text="被执行人", name="android.view.View", type="android.view.View").exists():
assert_exists(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1622198084935.png", record_pos=(-0.384, -0.208), resolution=(1080, 1920)),
"被执行人")
poco(text="被执行人", name="android.view.View", type="android.view.View").click()
else:
touch((130, 900))
except Exception as e:
log(e, snapshot=True)
try:
time.sleep(2.0)
assert_equal(poco(text="条被执行人", name="android.widget.TextView", type="android.widget.TextView").get_text(),
"条被执行人", msg="乐视网被执行人")
except Exception as e:
log(e, snapshot=True)
try:
time.sleep(2.0)
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1634211673872.png", record_pos=(-0.444, -0.759), resolution=(1440, 2560)))
except Exception as e:
log(e, snapshot=True)
# 验证终本案件信息
time.sleep(2.0)
print("************************************************************************************")
print("*********************************开始验证:终本案件信息*********************************")
print("************************************************************************************")
try:
poco(text="终本案件", name="android.view.View", type="android.view.View").wait(5.0)
except Exception as e:
log(e, snapshot=True)
try:
if poco(text="终本案件", name="android.view.View", type="android.view.View").exists():
assert_exists(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1622198120002.png", record_pos=(-0.13, -0.218), resolution=(1080, 1920)),
"终本案件")
poco(text="终本案件", name="android.view.View", type="android.view.View").click()
else:
touch((500, 900))
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
if poco(text="乐视网信息技术(北京)股份有限公司", name="android.view.View", type="android.view.View").exists():
assert_equal(poco(text="乐视网信息技术(北京)股份有限公司", name="android.view.View", type="android.view.View").get_text(),
"乐视网信息技术(北京)股份有限公司", msg="乐视网信息技术(北京)股份有限公司")
else:
poco(text="乐视网信息技术(北京)股份有限公司", name="android.view.View", type="android.view.View").wait(5.0)
assert_equal(poco(text="乐视网信息技术(北京)股份有限公司", name="android.view.View", type="android.view.View").get_text(),
"乐视网信息技术(北京)股份有限公司", msg="乐视网信息技术(北京)股份有限公司")
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
time.sleep(2.0)
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1634211673872.png", record_pos=(-0.444, -0.759), resolution=(1440, 2560)))
except Exception as e:
log(e, snapshot=True)
# 验证限制高消费信息
time.sleep(2.0)
print("************************************************************************************")
print("*********************************开始验证:限制高消费信息********************************")
print("************************************************************************************")
try:
poco(text="限制高消费", name="android.view.View", type="android.view.View").wait(5.0)
except Exception as e:
log(e, snapshot=True)
try:
if poco(text="限制高消费", name="android.view.View", type="android.view.View").exists():
assert_exists(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1622198392123.png", record_pos=(0.374, -0.218), resolution=(1080, 1920)),
"限制高消费")
poco(text="限制高消费", name="android.view.View", type="android.view.View").click()
else:
touch((1200, 900))
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
if poco(text="条限制高消费", name="android.widget.TextView", type="android.widget.TextView").exists():
assert_equal(poco(text="条限制高消费", name="android.widget.TextView", type="android.widget.TextView").get_text(),
"条限制高消费", msg="限制高消费")
else:
poco(text="条限制高消费", name="android.widget.TextView", type="android.widget.TextView").wait(5.0)
assert_equal(poco(text="条限制高消费", name="android.widget.TextView", type="android.widget.TextView").get_text(),
"条限制高消费", msg="限制高消费")
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
time.sleep(2.0)
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1634211673872.png", record_pos=(-0.444, -0.759), resolution=(1440, 2560)))
except Exception as e:
log(e, snapshot=True)
# 验证法院公告信息
time.sleep(2.0)
print("************************************************************************************")
print("*********************************开始验证:法院公告信息*********************************")
print("************************************************************************************")
try:
poco(text="法院公告", name="android.view.View", type="android.view.View").wait(5.0)
except Exception as e:
log(e, snapshot=True)
try:
if poco(text="法院公告", name="android.view.View", type="android.view.View").exists():
assert_exists(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1622198403834.png", record_pos=(-0.13, 0.242), resolution=(1080, 1920)),
"法院公告")
poco(text="法院公告", name="android.view.View", type="android.view.View").click()
else:
touch((500, 1800))
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
if poco(text="裁判文书", name="android.view.View", type="android.view.View").exists():
assert_equal(poco(text="裁判文书", name="android.view.View", type="android.view.View").get_text(),
"裁判文书", msg="裁判文书")
else:
poco(text="裁判文书", name="android.view.View", type="android.view.View").wait(5.0)
assert_equal(poco(text="裁判文书", name="android.view.View", type="android.view.View").get_text(),
"裁判文书", msg="裁判文书")
except Exception as e:
log(e, snapshot=True)
try:
time.sleep(2.0)
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1634211673872.png", record_pos=(-0.444, -0.759), resolution=(1440, 2560)))
except Exception as e:
log(e, snapshot=True)
# 验证询价评估信息
time.sleep(2.0)
print("************************************************************************************")
print("*********************************开始验证:询价评估信息*********************************")
print("************************************************************************************")
try:
poco(text="询价评估", name="android.view.View", type="android.view.View").wait(5.0)
except Exception as e:
log(e, snapshot=True)
try:
if poco(text="询价评估", name="android.view.View", type="android.view.View").exists():
assert_exists(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1622198413257.png", record_pos=(0.374, 0.257), resolution=(1080, 1920)),
"询价评估")
poco(text="询价评估", name="android.view.View", type="android.view.View").click()
else:
touch((1200, 1800))
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
if poco(text="选定评估机构", name="android.view.View", type="android.view.View").exists():
assert_equal(poco(text="选定评估机构", name="android.view.View", type="android.view.View").get_text(),
"选定评估机构", msg="选定评估机构")
else:
poco(text="选定评估机构", name="android.view.View", type="android.view.View").wait(5.0)
assert_equal(poco(text="选定评估机构", name="android.view.View", type="android.view.View").get_text(),
"选定评估机构", msg="选定评估机构")
except Exception as e:
log(e, snapshot=True)
try:
time.sleep(2.0)
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1634211673872.png", record_pos=(-0.444, -0.759), resolution=(1440, 2560)))
except Exception as e:
log(e, snapshot=True)
# 验证股权冻结信息
time.sleep(2.0)
print("************************************************************************************")
print("*********************************开始验证:股权冻结信息*********************************")
print("************************************************************************************")
try:
poco(text="股权冻结", name="android.view.View", type="android.view.View").wait(5.0)
except Exception as e:
log(e, snapshot=True)
try:
if poco(text="股权冻结", name="android.view.View", type="android.view.View").exists():
assert_exists(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1622198423589.png", record_pos=(-0.133, 0.485), resolution=(1080, 1920)),
"股权冻结")
poco(text="股权冻结", name="android.view.View", type="android.view.View").click()
else:
touch((500, 2100))
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
if poco(text="条股权冻结", name="android.widget.TextView", type="android.widget.TextView").exists():
assert_equal(poco(text="条股权冻结", name="android.widget.TextView", type="android.widget.TextView").get_text(),
"条股权冻结", msg="股权冻结")
else:
poco(text="条股权冻结", name="android.widget.TextView", type="android.widget.TextView").wait(5.0)
assert_equal(poco(text="条股权冻结", name="android.widget.TextView", type="android.widget.TextView").get_text(),
"条股权冻结", msg="股权冻结")
except Exception as e:
log(e, snapshot=True)
try:
time.sleep(2.0)
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1634211673872.png", record_pos=(-0.444, -0.759), resolution=(1440, 2560)))
except Exception as e:
log(e, snapshot=True)
#########################################################################################
# 经营风险模块
#########################################################################################
time.sleep(2.0)
print("-------------------------------------------------------------------------------------------------------")
print("----------------------------------------------- 经营风险模块 --------------------------------------------")
print("-------------------------------------------------------------------------------------------------------")
# 滑动到经营风险模块
print("******************************滑动到经营风险模块*****************************")
time.sleep(2.0)
swipe((600, 1900), (600, 800), duration=2, steps=5)
time.sleep(2.0)
swipe((600, 1900), (600, 800), duration=2, steps=5)
# 验证债务/债权信息
time.sleep(2.0)
print("************************************************************************************")
print("*********************************开始验证:债务/债权信息*********************************")
print("************************************************************************************")
try:
poco(text="债务/债权", name="android.view.View", type="android.view.View").wait(5.0)
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
if poco(text="债务/债权", name="android.view.View", type="android.view.View").exists():
assert_equal(poco(text="债务/债权", name="android.view.View", type="android.view.View").get_text(),
"债务/债权", msg="债务/债权")
poco(text="债务/债权", name="android.view.View", type="android.view.View").click()
else:
touch((130, 600))
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
if poco(text="乐视网信息技术(北京)股份有限公司", name="android.view.View", type="android.view.View").exists():
assert_equal(poco(text="乐视网信息技术(北京)股份有限公司", name="android.view.View", type="android.view.View").get_text(),
"乐视网信息技术(北京)股份有限公司", msg="乐视网信息技术(北京)股份有限公司")
else:
poco(text="乐视网信息技术(北京)股份有限公司", name="android.view.View", type="android.view.View").wait(10.0)
assert_equal(poco(text="乐视网信息技术(北京)股份有限公司", name="android.view.View", type="android.view.View").get_text(),
"乐视网信息技术(北京)股份有限公司", msg="乐视网信息技术(北京)股份有限公司")
except Exception as e:
log(e, snapshot=True)
try:
time.sleep(2.0)
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1634211673872.png", record_pos=(-0.444, -0.759), resolution=(1440, 2560)))
except Exception as e:
log(e, snapshot=True)
# 验证合作风险信息
time.sleep(2.0)
print("************************************************************************************")
print("*********************************开始验证:合作风险信息*********************************")
print("************************************************************************************")
try:
poco(text="合作风险", name="android.view.View", type="android.view.View").wait(5.0)
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
if poco(text="合作风险", name="android.view.View", type="android.view.View").exists():
assert_equal(poco(text="合作风险", name="android.view.View", type="android.view.View").get_text(),
"合作风险", msg="合作风险")
poco(text="合作风险", name="android.view.View", type="android.view.View").click()
else:
touch((500, 600))
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
# try:
# if poco(text="合作风险等级", name="android.view.View", type="android.view.View").exists():
# assert_equal(poco(text="起诉供应商", name="android.view.View", type="android.view.View").get_text(),
# "起诉供应商", msg="起诉供应商")
# else:
# poco(text="合作风险等级", name="android.view.View", type="android.view.View").wait(5.0)
# assert_equal(poco(text="起诉供应商", name="android.view.View", type="android.view.View").get_text(),
# "起诉供应商", msg="起诉供应商")
# except Exception as e:
# log(e, snapshot=True)
try:
time.sleep(2.0)
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1634211673872.png", record_pos=(-0.444, -0.759), resolution=(1440, 2560)))
except Exception as e:
log(e, snapshot=True)
# 验证股权出质信息
time.sleep(2.0)
print("************************************************************************************")
print("*********************************开始验证:股权出质信息*********************************")
print("************************************************************************************")
try:
poco(text="股权出质", name="android.view.View").wait(5.0)
except Exception as e:
log(e, snapshot=True)
try:
if poco(text="股权出质", name="android.view.View", type="android.view.View").exists():
assert_equal(poco(text="股权出质", name="android.view.View", type="android.view.View").get_text(),
"股权出质", msg="股权出质")
poco(text="股权出质", name="android.view.View", type="android.view.View").click()
else:
touch((500, 1700))
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
if poco(text="91110108306374259M_0003", name="android.view.View", type="android.view.View").exists():
assert_equal(poco(text="91110108306374259M_0003", name="android.view.View", type="android.view.View").get_text(),
"91110108306374259M_0003", msg="91110108306374259M_0003")
else:
poco(text="91110108306374259M_0003", name="android.view.View", type="android.view.View").wait(5.0)
assert_equal(poco(text="91110108306374259M_0003", name="android.view.View", type="android.view.View").get_text(),
"91110108306374259M_0003", msg="91110108306374259M_0003")
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
time.sleep(2.0)
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1634211673872.png", record_pos=(-0.444, -0.759), resolution=(1440, 2560)))
except Exception as e:
log(e, snapshot=True)
#########################################################################################
# 知识产权模块
#########################################################################################
time.sleep(2.0)
print("-------------------------------------------------------------------------------------------------------")
print("----------------------------------------------- 知识产权模块 --------------------------------------------")
print("-------------------------------------------------------------------------------------------------------")
# 滑动到知识产权模块
print("***************************滑动到知识产权模块******************************")
time.sleep(2.0)
swipe((600, 1700), (600, 1000), duration=2, steps=5)
time.sleep(2.0)
swipe((600, 1700), (600, 1000), duration=2, steps=5)
#########################################################################################
# 经营信息模块
#########################################################################################
time.sleep(2.0)
print("-------------------------------------------------------------------------------------------------------")
print("----------------------------------------------- 经营信息模块 --------------------------------------------")
print("-------------------------------------------------------------------------------------------------------")
# 滑动到经营信息模块
print("***************************滑动到经营信息模块******************************")
time.sleep(2.0)
swipe((600, 1800), (600, 900), duration=2, steps=5)
time.sleep(2.0)
swipe((600, 1800), (600, 900), duration=2, steps=5)
# 验证税务信用信息
time.sleep(2.0)
print("************************************************************************************")
print("*********************************开始验证:税务信用信息*********************************")
print("************************************************************************************")
try:
poco(text="税务信用", name="android.view.View").wait(5.0)
except Exception as e:
log(e, snapshot=True)
try:
if poco(text="税务信用", name="android.view.View", type="android.view.View").exists():
assert_equal(poco(text="税务信用", name="android.view.View", type="android.view.View").get_text(),
"税务信用", msg="税务信用")
poco(text="税务信用", name="android.view.View", type="android.view.View").click()
else:
touch((500, 800))
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
if poco(text="911100007693890511", name="android.view.View", type="android.view.View").exists():
assert_equal(poco(text="110108769389051", name="android.view.View", type="android.view.View").get_text(),
"110108769389051", msg="纳税人识别号")
else:
poco(text="911100007693890511", name="android.view.View", type="android.view.View").wait(5.0)
assert_equal(poco(text="110108769389051", name="android.view.View", type="android.view.View").get_text(),
"110108769389051", msg="纳税人识别号")
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
time.sleep(2.0)
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1634211673872.png", record_pos=(-0.444, -0.759), resolution=(1440, 2560)))
except Exception as e:
log(e, snapshot=True)
# 验证债券信息信息
time.sleep(2.0)
print("************************************************************************************")
print("*********************************开始验证:债券信息信息*********************************")
print("************************************************************************************")
try:
poco(text="债券信息", name="android.view.View").wait(5.0)
except Exception as e:
log(e, snapshot=True)
try:
if poco(text="债券信息", name="android.view.View", type="android.view.View").exists():
assert_equal(poco(text="债券信息", name="android.view.View", type="android.view.View").get_text(),
"债券信息", msg="债券信息")
poco(text="债券信息", name="android.view.View", type="android.view.View").click()
else:
touch((1200, 800))
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
if poco(text="118370", name="android.view.View", type="android.view.View").exists():
assert_equal(poco(text="118370", name="android.view.View", type="android.view.View").get_text(),
"118370", msg="债券代码1")
else:
poco(text="118370", name="android.view.View", type="android.view.View").wait(5.0)
assert_equal(poco(text="118370", name="android.view.View", type="android.view.View").get_text(),
"118370", msg="债券代码1")
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
time.sleep(2.0)
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1634211673872.png", record_pos=(-0.444, -0.759), resolution=(1440, 2560)))
except Exception as e:
log(e, snapshot=True)
#########################################################################################
# 企业发展模块
#########################################################################################
time.sleep(2.0)
print("-------------------------------------------------------------------------------------------------------")
print("----------------------------------------------- 企业发展模块 --------------------------------------------")
print("-------------------------------------------------------------------------------------------------------")
# 滑动到企业发展模块
print("**************************滑动到企业发展模块******************************")
time.sleep(2.0)
swipe((600, 1800), (600, 1000), duration=2, steps=5)
time.sleep(2.0)
swipe((600, 1800), (600, 1000), duration=2, steps=5)
#########################################################################################
# 历史信息模块
#########################################################################################
time.sleep(2.0)
print("-------------------------------------------------------------------------------------------------------")
print("----------------------------------------------- 历史信息模块 --------------------------------------------")
print("-------------------------------------------------------------------------------------------------------")
# 滑动到历史信息模块
print("****************************滑动到历史信息模块***********************************")
time.sleep(2.0)
swipe((600, 1800), (600, 800), duration=2, steps=5)
time.sleep(2.0)
swipe((600, 1800), (600, 800), duration=2, steps=5)
time.sleep(2.0)
swipe((600, 1800), (600, 800), duration=2, steps=5)
# 验证历史失信信息
time.sleep(2.0)
print("************************************************************************************")
print("*********************************开始验证:历史失信信息*********************************")
print("************************************************************************************")
try:
poco(text="失信信息", name="android.view.View").wait(5.0)
except Exception as e:
log(e, snapshot=True)
try:
touch((500, 800))
except Exception as e:
log(e, snapshot=True)
time.sleep(5.0)
try:
assert_exists(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1630576702922.png", record_pos=(0.235, -0.651),
resolution=(1440, 2560)), "历史失信信息")
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
time.sleep(2.0)
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1634211673872.png", record_pos=(-0.444, -0.759), resolution=(1440, 2560)))
except Exception as e:
log(e, snapshot=True)
# 验证历史被执行人信息
time.sleep(2.0)
print("************************************************************************************")
print("*********************************开始验证:历史被执行人信息******************************")
print("************************************************************************************")
try:
poco(text="被执行人", name="android.view.View").wait(5.0)
except Exception as e:
log(e, snapshot=True)
try:
touch((900, 800))
except Exception as e:
log(e, snapshot=True)
time.sleep(5.0)
try:
assert_exists(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1630576153083.png", record_pos=(0.212, -0.65),
resolution=(1440, 2560)), "历史被执行人信息")
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
time.sleep(2.0)
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1634211673872.png", record_pos=(-0.444, -0.759), resolution=(1440, 2560)))
except Exception as e:
log(e, snapshot=True)
# 验证历史限制高消费信息
time.sleep(2.0)
print("************************************************************************************")
print("*********************************开始验证:历史限制高消费信息****************************")
print("************************************************************************************")
try:
poco(text="限制高消费", name="android.view.View").wait(5.0)
except Exception as e:
log(e, snapshot=True)
try:
touch((130, 1100))
except Exception as e:
log(e, snapshot=True)
time.sleep(5.0)
try:
assert_exists(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1630576658179.png", record_pos=(0.222, -0.649),
resolution=(1440, 2560)), "历史限制高消费信息")
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
time.sleep(2.0)
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1634211673872.png", record_pos=(-0.444, -0.759), resolution=(1440, 2560)))
except Exception as e:
log(e, snapshot=True)
# 验证历史裁判文书信息
time.sleep(2.0)
print("************************************************************************************")
print("*********************************开始验证:历史裁判文书信息******************************")
print("************************************************************************************")
try:
poco(text="裁判文书", name="android.view.View").wait(5.0)
except Exception as e:
log(e, snapshot=True)
try:
touch((900, 1500))
except Exception as e:
log(e, snapshot=True)
time.sleep(5.0)
try:
assert_exists(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1630576618981.png", record_pos=(-0.04, -0.524),
resolution=(1440, 2560)), "历史裁判文书信息")
except Exception as e:
log(e, snapshot=True)
try:
time.sleep(2.0)
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1634211673872.png", record_pos=(-0.444, -0.759), resolution=(1440, 2560)))
except Exception as e:
log(e, snapshot=True)
# 验证历史行政处罚信息
time.sleep(2.0)
print("************************************************************************************")
print("*********************************开始验证:历史行政处罚信息******************************")
print("************************************************************************************")
try:
poco(text="行政处罚", name="android.view.View").wait(5.0)
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
touch((1200, 1500))
except Exception as e:
log(e, snapshot=True)
time.sleep(5.0)
try:
assert_exists(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1630576581486.png", record_pos=(0.235, -0.651),
resolution=(1440, 2560)), "历史行政处罚信息")
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
time.sleep(2.0)
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1634211673872.png", record_pos=(-0.444, -0.759), resolution=(1440, 2560)))
except Exception as e:
log(e, snapshot=True)
# 验证历史开庭公告信息
time.sleep(2.0)
print("************************************************************************************")
print("*********************************开始验证:历史开庭公告信息******************************")
print("************************************************************************************")
try:
poco(text="开庭公告", name="android.view.View").wait(5.0)
except Exception as e:
log(e, snapshot=True)
try:
touch((900, 1800))
except Exception as e:
log(e, snapshot=True)
time.sleep(5.0)
try:
assert_exists(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1630576546793.png", record_pos=(0.222, -0.651),
resolution=(1440, 2560)), "历史开庭公告信息")
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
time.sleep(2.0)
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1634211673872.png", record_pos=(-0.444, -0.759), resolution=(1440, 2560)))
except Exception as e:
log(e, snapshot=True)
# 验证历史行政许可信息
time.sleep(2.0)
print("************************************************************************************")
print("*********************************开始验证:历史行政许可信息******************************")
print("************************************************************************************")
try:
poco(text="行政许可", name="android.view.View").wait(5.0)
except Exception as e:
log(e, snapshot=True)
try:
touch((1200, 1800))
except Exception as e:
log(e, snapshot=True)
time.sleep(5.0)
try:
assert_exists(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1630576508741.png", record_pos=(0.235, -0.648),
resolution=(1440, 2560)), "历史行政许可信息")
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
time.sleep(2.0)
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1634211673872.png", record_pos=(-0.444, -0.759), resolution=(1440, 2560)))
except Exception as e:
log(e, snapshot=True)
# 验证历史股权出质信息
time.sleep(2.0)
print("************************************************************************************")
print("*********************************开始验证:历史股权出质信息******************************")
print("************************************************************************************")
try:
poco(text="股权出质", name="android.view.View").wait(5.0)
except Exception as e:
log(e, snapshot=True)
try:
touch((130, 2100))
except Exception as e:
log(e, snapshot=True)
time.sleep(5.0)
try:
assert_exists(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1630576465042.png", record_pos=(0.226, -0.649),
resolution=(1440, 2560)), "历史股权出质信息")
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
time.sleep(2.0)
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1634211673872.png", record_pos=(-0.444, -0.759), resolution=(1440, 2560)))
except Exception as e:
log(e, snapshot=True)
# 验证历史股权冻结信息
time.sleep(2.0)
print("************************************************************************************")
print("*********************************开始验证:历史股权冻结信息******************************")
print("************************************************************************************")
try:
poco(text="股权冻结", name="android.view.View").wait(5.0)
except Exception as e:
log(e, snapshot=True)
try:
touch((500, 2100))
except Exception as e:
log(e, snapshot=True)
time.sleep(5.0)
try:
assert_exists(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1630576264953.png", record_pos=(0.213, -0.649),
resolution=(1440, 2560)), "历史股权冻结信息")
except Exception as e:
log(e, snapshot=True)
time.sleep(2.0)
try:
time.sleep(2.0)
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1634211673872.png", record_pos=(-0.444, -0.759), resolution=(1440, 2560)))
except Exception as e:
log(e, snapshot=True)
print("-------------------------------- 返回到上一级的企业主页 -------------------------------")
print("------------------------------ 乐视网:企业主页维度遍历完毕 -----------------------------")
try:
time.sleep(2.0)
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1634211673872.png", record_pos=(-0.444, -0.759), resolution=(1440, 2560)))
print("------------------------------------- 返回到上一级的搜索页面 -------------------------------------")
time.sleep(2.0)
touch(Template(r"D:/QCC_AIRTEST_PROJECTS/air/images/tpl1634211673872.png", record_pos=(-0.444, -0.759), resolution=(1440, 2560)))
print("-------------------------------------- 返回到小程序首页 -----------------------------------------")
except Exception as e:
log(e, snapshot=True)
TesterHome 为用户提供「保留所有权利,禁止转载」的选项。
除非获得原作者的单独授权,任何第三方不得转载标注了「原创声明:保留所有权利,禁止转载」的内容,否则均视为侵权。
具体请参见TesterHome 知识产权保护协议。
如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
暂无回复。