Commit 00256c81 authored by 刘丙寅's avatar 刘丙寅

最新代码推送

parent 7091b4d8
This source diff could not be displayed because it is too large. You can view the blob instead.
# import os
# import sys
# sys.path.append(os.path.dirname(os.path.dirname(__file__)))
# # import event
# from appiumConfigure.config import appiumConfig
# from appiumConfigure import find_element
# from page import home_Page,search_Page,shoppinghome_Page
# from Charles.mitm import mitm_query
# from appiumConfigure import backtoapp
# from Charles import AssertLen
#
# class Case(appiumConfig):
#
# def test_01_shopping_city(self):
# '商城首页城市筛选器点击'
# # 关闭弹窗点击
# find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel)
# # 商城按钮点击
# ele = find_element.element(self.driver,home_Page.Shooping_mall_click)
# ele.click()
# # 点击商城筛选器
# ele = find_element.element(self.driver, shoppinghome_Page.shopping_city)
# ele.click()
# backtoapp.backapp(self.driver,2)
#
# # "params": {
# # "page_name": "home",
# # "referrer_link": [
# #
# # ]
# # },
# # "type": "welfare_home_click_navbar_area",
#
# result = mitm_query(action="welfare_home_click_navbar_area", page_name="home")
# AssertLen.maidiannumber(result)
#
#
# def test_02_shopping_search_click(self):
# '商城首页搜索框点击'
# # 关闭弹窗点击
# find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel)
# # 商城按钮点击
# ele = find_element.element(self.driver, home_Page.Shooping_mall_click)
# ele.click()
# # 点击搜索框
# ele = find_element.element(self.driver,shoppinghome_Page.shopping_search)
# ele.click()
# backtoapp.backapp(self.driver,2)
#
# # "params": {
# # "page_name": "welfare_home",
# # "referrer_link": [
# #
# # ]
# # },
# # "type": "on_click_navbar_search",
#
# result = mitm_query(action="on_click_navbar_search", page_name="welfare_home")
# AssertLen.maidiannumber(result)
#
#
# def test_03_shopping_car(self):
# '商城首页购物车按钮'
# # 关闭弹窗点击
# find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel)
# # 商城按钮点击
# ele = find_element.element(self.driver, home_Page.Shooping_mall_click)
# ele.click()
# # 点击商城首页 购物车按钮
# ele = find_element.element(self.driver, shoppinghome_Page.shopping_car)
# ele.click()
# backtoapp.backapp(self.driver,2)
#
# # "params": {
# # "page_name": "welfare_home",
# # "referrer_link": [
# #
# # ]
# # },
# # "type": "on_click_navbar_cart",
#
# result = mitm_query(action="on_click_navbar_cart", page_name="welfare_home")
# AssertLen.maidiannumber(result)
#
#
# def test_04_shopping_doufu(self):
# '点击商城首页豆腐块'
# # 关闭弹窗点击
# find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel)
# # 商城按钮点击
# ele = find_element.element(self.driver, home_Page.Shooping_mall_click)
# ele.click()
# # 豆腐块点击
# ele = find_element.element(self.driver,shoppinghome_Page.shopping_doufu)
# ele.click()
# backtoapp.backapp(self.driver,2)
# # "params": {
# # "module_id": 12,
# # "page_name": "welfare_home",
# # "card_name": "玻尿酸",
# # "referrer_link": [
# #
# # ],
# # "position": 0,
# # "transaction_type": "operating",
# # "card_type": "icon",
# # "card_content_type": "",
# # "url": "gengmei://operation_together?cp_id=9",
# # "card_id": ""
# # },
# # "type": "on_click_card",
#
# result = mitm_query(action="on_click_card", page_name="welfare_home",card_type="icon")
# AssertLen.maidiannumber(result)
#
#
# def test_05_banner_click(self):
# '商城首页banner点击'
# # 关闭弹窗点击
# find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel)
# # 商城按钮点击
# ele = find_element.element(self.driver, home_Page.Shooping_mall_click)
# ele.click()
# # 点击banner按钮
# ele = find_element.element(self.driver, shoppinghome_Page.shopping_banner)
# ele.click()
# backtoapp.backapp(self.driver,2)
#
# # "params": {
# # "target_name": "",
# # "referrer_id": "",
# # "referrer_link": [
# #
# # ],
# # "card_type": "slide_banner",
# # "transaction_type": "operation",
# # "card_content_type": "自定义专题页面",
# # "url": "gengmei://common_webview?url=https%3A//backend.igengmei.com/phantom/visual_special/2090%3Fusepage%3Dwk",
# # "card_id": "2090",
# # "referrer": "home",
# # "module_id": 936,
# # "page_name": "welfare_home",
# # "position": 0,
# # "business_id": "",
# # "in_page_pos": "middle"
# # },
# # "type": "on_click_card",
#
# result = mitm_query(action="on_click_card", card_type="slide_banner", card_content_type="自定义专题页面", page_name="welfare_home")
# AssertLen.maidiannumber(result)
#
#
# def test_06_shopping_4fenqu(self):
# '商城首页四分区点击'
# # 关闭弹窗点击
# find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel)
# # 商城按钮点击
# ele = find_element.element(self.driver, home_Page.Shooping_mall_click)
# ele.click()
# # 点击四分区
# ele = find_element.element(self.driver, shoppinghome_Page.shopping_4fenqu)
# ele.click()
# backtoapp.backapp(self.driver,2)
#
# # "params": {
# # "module_type": 1149,
# # "referrer_link": [
# #
# # ],
# # "card_type": "gadget",
# # "transaction_type": "operating",
# # "card_content_type": "自定义专题页面",
# # "url": "gengmei://common_webview?url=https%3A//backend.igengmei.com/phantom/visual_special/2103%3Fusepage%3Dwk",
# # "card_id": 1149,
# # "module_id": 228,
# # "grid": "a",
# # "page_name": "welfare_home",
# # "card_name": "",
# # "position": 0,
# # "business_id": ""
# # },
# # "type": "on_click_card",
# result = mitm_query(action="on_click_card",card_type="gadget", card_content_type="自定义专题页面", page_name="welfare_home")
# AssertLen.maidiannumber(result)
#
#
#
# def test_07_shopping_kill(self):
# '限时秒杀美购列表点击'
# # 关闭弹窗点击
# find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel)
# # 商城按钮点击
# ele = find_element.element(self.driver, home_Page.Shooping_mall_click)
# ele.click()
# # 点击限时秒杀美购列表
# ele = find_element.element(self.driver, shoppinghome_Page.shopping_kill)
# ele.click()
# backtoapp.backapp(self.driver, 2)
#
# # "params": {
# # "cpc_referer": "63",
# # "referrer_id": "",
# # "referrer_link": [
# #
# # ],
# # "absolute_position": 0,
# # "card_type": "card",
# # "transaction_type": "operation",
# # "card_content_type": "service",
# # "card_id": 5796088,
# # "is_cpc": 1,
# # "referrer": "home",
# # "page_name": "welfare_home",
# # "position": 0,
# # "business_id": "",
# # "in_page_pos": "seckill",
# # "relative_position": 0
# # },
# # "type": "on_click_card",
# result = mitm_query(action="on_click_card", card_type="card", card_content_type="service", referrer="home", page_name="welfare_home")
# AssertLen.maidiannumber(result)
#
#
#
#
#
...@@ -11,9 +11,12 @@ def maidiannumber(result): ...@@ -11,9 +11,12 @@ def maidiannumber(result):
print("埋点数据正常") print("埋点数据正常")
def devices_id(id): def devices_id(id):
id = int(id) print(id)
if id == 868410041790363: print(type(id))
if id == "868410041790363":
print("设备号校验正常 预期设备号:868410041790363 实际设备号: %s" % id) print("设备号校验正常 预期设备号:868410041790363 实际设备号: %s" % id)
elif id == "androidid_9761b0ff31fe5e1b":
print("设备号校验正常 预期设备号:androidid_9761b0ff31fe5e1b 实际设备号: %s" % id)
else: else:
raise Exception('设备号与预期不符,预期设备号为:868410041790363 实际设备号为: %s' % id) raise Exception('设备号与预期不符,预期设备号为:868410041790363 实际设备号为: %s' % id)
......
...@@ -18,10 +18,13 @@ class Gmaddon: ...@@ -18,10 +18,13 @@ class Gmaddon:
# 进来直接灰度 # 进来直接灰度
# 抓的包里面的 http里面的所有的params # 抓的包里面的 http里面的所有的params
fields = flow.request.query.fields fields = flow.request.query.fields
# if flow.request.host.startswith('backend'):
# flow.request.host = 'backend.igengmei.com'
# 修改deviceID 放到 fields里面 # 修改deviceID 放到 fields里面
new_fields = tuple((x, y if x != "device_id" else '51') for x, y in fields) # new_fields = tuple((x, y if x != "device_id" else '51') for x, y in fields)
# 又把修改后的参数 赋值给了的params # # 又把修改后的参数 赋值给了的params
flow.request.query.fields = new_fields # flow.request.query.fields = new_fields
if flow.request.host in self.host_list: if flow.request.host in self.host_list:
# 放在redis里面 下面是固定写法 后面.decode() 是解码 # 放在redis里面 下面是固定写法 后面.decode() 是解码
......
...@@ -40,7 +40,10 @@ def mitm_query(**kwargs): ...@@ -40,7 +40,10 @@ def mitm_query(**kwargs):
action = kwargs.pop('action') action = kwargs.pop('action')
# 通过type 进行第一轮筛选 # 通过type 进行第一轮筛选
data = list(filter(lambda x: x.get('type') == action, data)) def act(x):
return x.get('type') == action
data = list(filter(act, data))
pprint(data) pprint(data)
# 通过健值对的方式 将params里面的数据全部取了出来。 # 通过健值对的方式 将params里面的数据全部取了出来。
for k, v in kwargs.items(): for k, v in kwargs.items():
......
...@@ -171,8 +171,9 @@ if __name__ == '__main__': ...@@ -171,8 +171,9 @@ if __name__ == '__main__':
# error = runner.error_count # error = runner.error_count
# failure = runner.failure_count # failure = runner.failure_count
runner = TestRunner(discover, report_dir="report") runner = TestRunner(discover, report_dir="report")
res = runner.rerun_run(count=3, interval=2) res = runner.rerun_run(count=3)
# 参数 说明 失败重跑的次数
# res = runner.rerun_run(count=3)
report_path = os.path.join(os.path.realpath(""), "report") report_path = os.path.join(os.path.realpath(""), "report")
# 这是为了获取report里面文件列表 # 这是为了获取report里面文件列表
lists = os.listdir(report_path) lists = os.listdir(report_path)
...@@ -194,3 +195,34 @@ if __name__ == '__main__': ...@@ -194,3 +195,34 @@ if __name__ == '__main__':
# -------------------------------------------------------------------------------------------------------------------- # --------------------------------------------------------------------------------------------------------------------
# 4最后一步发送报告 # 4最后一步发送报告
send_mail(sender, psw, receiver, smtp_server, report_file, port) send_mail(sender, psw, receiver, smtp_server, report_file, port)
# discover = unittest.defaultTestLoader.discover("case", pattern="case*.py", top_level_dir=None)
# runner = TestRunner(discover, report_dir="report")
# res = runner.rerun_run(count=3)
# report_path = os.path.join(os.path.realpath(""), "report")
# lists = os.listdir(report_path)
# lists.sort(key=lambda fn: os.path.getmtime(os.path.join(report_path, fn)))
# print(u'最新测试生成的报告: ' + lists[-1])
# # 找到最新生成的报告文件
# report_file = os.path.join(report_path, lists[-1])
# sender = "liubingyin@igengmei.com" # sender = "l709188456@163.com"
# # 邮箱密码
# psw = "cgBP3fw2ZNgp3L5r" # psw = "3328378"
# # 163服务器的servers
# # smtp_server = "smtp.163.com"
# # 公司地址的服务器server
# smtp_server = "smtp.exmail.qq.com"
# port = 465
# # 发给谁的邮箱
# receiver = ["liubingyin@igengmei.com"]
# # --------------------------------------------------------------------------------------------------------------------
# # 4最后一步发送报告
# send_mail(sender, psw, receiver, smtp_server, report_file, port)
\ No newline at end of file
...@@ -4,3 +4,6 @@ def backapp(driver, timewait): ...@@ -4,3 +4,6 @@ def backapp(driver, timewait):
time.sleep(3) time.sleep(3)
driver.background_app(timewait) driver.background_app(timewait)
...@@ -6,3 +6,9 @@ else: ...@@ -6,3 +6,9 @@ else:
print("-1") print("-1")
from appiumConfigure import find_element
from appium.webdriver.common.touch_action import TouchAction
def swip_method(driver,eleshang,elexia,):
ele_shang = find_element.element(driver, eleshang)
ele_xia = find_element.element(driver, elexia)
# 滑动
TouchAction(driver).press(ele_xia).wait(1000).move_to(ele_shang).release().perform()
# def swip_method_new(driver, new_list):
# for i in new_list:
# for k,v in i.items():
# ele_shang = find_element.element(driver, k)
# ele_xia = find_element.element(driver, v)
# # 滑动
# TouchAction(driver).press(ele_xia).wait(1000).move_to(ele_shang).release().perform()
This diff is collapsed.
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
# import event
from appiumConfigure.config import appiumConfig
from appiumConfigure import find_element
from page import login_Page, home_Page
import time
class Case(appiumConfig):
def test_01_username_and_password_login(self):
'登录页面'
# 点击首页关闭弹窗
find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel)
#点击 我 按钮
ele = find_element.element(self.driver, home_Page.me)
ele.click()
# 点击账号登录
ele = find_element.element(self.driver, login_Page.password_login)
ele.click()
# 点击账号框
ele = find_element.element(self.driver, login_Page.click_username)
ele.click()
# 输入账号
ele = find_element.element(self.driver, login_Page.sendkeys_username)
ele.send_keys(login_Page.username)
# 输入密码
ele = find_element.element(self.driver, login_Page.sendkeys_password)
ele.send_keys(login_Page.password)
#点击立即登录按钮
ele = find_element.element(self.driver, login_Page.login_button)
ele.click()
...@@ -11,7 +11,7 @@ from Charles import AssertLen ...@@ -11,7 +11,7 @@ from Charles import AssertLen
import time import time
class Case(appiumConfig): class Case(appiumConfig):
def test_01(self): def test_01_ai_channel(self):
'模拟双眼皮 - 拍照 - 报告页' '模拟双眼皮 - 拍照 - 报告页'
# 关闭弹窗点击 # 关闭弹窗点击
find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel) find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel)
...@@ -53,7 +53,7 @@ class Case(appiumConfig): ...@@ -53,7 +53,7 @@ class Case(appiumConfig):
def test_02(self): def test_02_ai_channel(self):
'双眼皮 - 面孔起源 - 男 - 拍照 - 报告页' '双眼皮 - 面孔起源 - 男 - 拍照 - 报告页'
# 关闭弹窗点击 # 关闭弹窗点击
find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel) find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel)
...@@ -102,7 +102,7 @@ class Case(appiumConfig): ...@@ -102,7 +102,7 @@ class Case(appiumConfig):
def test_03(self): def test_03_ai_channel(self):
'双眼皮-测颜值-拍照-报告页' '双眼皮-测颜值-拍照-报告页'
# 关闭弹窗点击 # 关闭弹窗点击
find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel) find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel)
...@@ -152,7 +152,7 @@ class Case(appiumConfig): ...@@ -152,7 +152,7 @@ class Case(appiumConfig):
def test_04(self): def test_04_ai_channel(self):
'双眼皮-测肤质-拍照-报告页' '双眼皮-测肤质-拍照-报告页'
# 关闭弹窗点击 # 关闭弹窗点击
find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel) find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel)
...@@ -196,7 +196,7 @@ class Case(appiumConfig): ...@@ -196,7 +196,7 @@ class Case(appiumConfig):
AssertLen.maidiannumber(result) AssertLen.maidiannumber(result)
def test_05(self): def test_05_ai_channel(self):
'双眼皮-测肤质-模拟整形-拍照-报告页' '双眼皮-测肤质-模拟整形-拍照-报告页'
# 关闭弹窗点击 # 关闭弹窗点击
find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel) find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel)
...@@ -241,7 +241,7 @@ class Case(appiumConfig): ...@@ -241,7 +241,7 @@ class Case(appiumConfig):
AssertLen.maidiannumber(result) AssertLen.maidiannumber(result)
def test_06(self): def test_06_ai_channel(self):
'双眼皮-测肤质-ai变脸-拍照-报告页' '双眼皮-测肤质-ai变脸-拍照-报告页'
# 关闭弹窗点击 # 关闭弹窗点击
find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel) find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel)
...@@ -285,9 +285,6 @@ class Case(appiumConfig): ...@@ -285,9 +285,6 @@ class Case(appiumConfig):
AssertLen.maidiannumber(result) AssertLen.maidiannumber(result)
# def test_07(self):
# '双眼皮-测肤质-ai变脸-下一个-拍照-报告页'
......
...@@ -11,7 +11,7 @@ from Charles import AssertLen ...@@ -11,7 +11,7 @@ from Charles import AssertLen
import time import time
class Case(appiumConfig): class Case(appiumConfig):
def test01_double_eye_take_photo_record_button(self): def test01_ai_double_eye(self):
'模拟双眼皮拍照按钮点击' '模拟双眼皮拍照按钮点击'
#关闭弹窗点击 #关闭弹窗点击
...@@ -44,7 +44,7 @@ class Case(appiumConfig): ...@@ -44,7 +44,7 @@ class Case(appiumConfig):
AssertLen.maidiannumber(result) AssertLen.maidiannumber(result)
def test02_(self): def test02_ai_double_eye(self):
'模拟双眼皮相册按钮点击' '模拟双眼皮相册按钮点击'
# 关闭弹窗点击 # 关闭弹窗点击
find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel) find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel)
......
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
# import event
from appiumConfigure.config import appiumConfig
from appiumConfigure import find_element
from page import home_Page,search_Page,ai_Page
from Charles.mitm import mitm_query
from appiumConfigure import backtoapp
from Charles import AssertLen
import time
class Case(appiumConfig):
def setup(self):
# 点击关闭弹窗
find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel)
# 点击扫脸按钮
scan = find_element.element(self.driver, home_Page.scan)
scan.click()
# 点击扫脸引导弹窗 -- 出现不稳定 采用容错机制
find_element.ElementNotAssert(self.driver, ai_Page.aiScan)
# 点击模拟整形
ele = find_element.element(self.driver, ai_Page.zhengxing_tab)
ele.click()
# 点击3d变脸
ele = find_element.element(self.driver, ai_Page.three_D_bianlian)
ele.click()
# 点击模拟发型
ele = find_element.element(self.driver, ai_Page.hair_tab)
ele.click()
def test_01_ai_hair(self):
'模拟发型tab点击'
self.setup()
backtoapp.backapp(self.driver,2)
# "params": {
# "page_name": "face_scan",
# "business_id": "",
# "referrer": "home",
# "position": 7,
# "referrer_link": [
#
# ],
# "referrer_id": "",
# "tab_name": "模拟发型"
# },
# "type": "on_click_tab",
result = mitm_query(action="on_click_tab", page_name="face_scan", referrer="home", tab_name="模拟发型")
AssertLen.maidiannumber(result)
def test_02_ai_hair(self):
'模拟发型弹窗关闭按钮点击'
self.setup()
# 模拟发型弹窗关闭按钮
ele = find_element.element(self.driver, ai_Page.hair_close)
ele.click()
# "params": {
# "button_name": "close",
# "business_id": "",
# "referrer": "",
# "page_name": "face_scan",
# "popup_name": "ask_open_album",
# "referrer_link": [
#
# ],
# "referrer_id": "",
# "tab_name": "模拟发型"
# },
# "type":"on_click_button",
result = mitm_query(action="on_click_button", button_name="close", page_name="face_scan", popup_name="ask_open_album")
AssertLen.maidiannumber(result)
def test_03_ai_hair(self):
'模拟发型弹窗打开相册按钮'
self.setup()
# 点击打开相册按钮
ele = find_element.element(self.driver,ai_Page.hair_open_picture)
ele.click()
backtoapp.backapp(self.driver,2)
# "params": {
# "button_name": "open_album",
# "business_id": "",
# "referrer": "",
# "page_name": "face_scan",
# "popup_name": "ask_open_album",
# "referrer_link": [
#
# ],
# "referrer_id": "",
# "tab_name": "模拟发型"
# },
# "type": "on_click_button",
result = mitm_query(action="on_click_button", button_name="open_album", page_name="face_scan", popup_name="ask_open_album")
AssertLen.maidiannumber(result)
def test_04_ai_hair(self):
'模拟发型拍照按钮点击'
self.setup()
# 模拟发型弹窗关闭按钮
find_element.ElementNotAssert(self.driver, ai_Page.hair_close)
# 拍照按钮点击
ele = find_element.element(self.driver,ai_Page.photo_record_button_hair)
ele.click()
backtoapp.backapp(self.driver,2)
# "params": {
# "page_name": "face_scan",
# "business_id": "",
# "referrer": "home",
# "button_name": "take_pic",
# "referrer_link": [
# "home"
# ],
# "referrer_id": "",
# "tab_name": "模拟发型"
# },
# "type": "on_click_button",
result = mitm_query(action="on_click_button", page_name="face_scan", referrer="home", button_name="take_pic", tab_name="模拟发型")
AssertLen.maidiannumber(result)
...@@ -11,7 +11,7 @@ from Charles import AssertLen ...@@ -11,7 +11,7 @@ from Charles import AssertLen
import time import time
class Case(appiumConfig): class Case(appiumConfig):
def test_01_jump_button(self): def test_01_ai_scan(self):
'跳过按钮埋点' '跳过按钮埋点'
#点击关闭弹窗 #点击关闭弹窗
...@@ -54,7 +54,7 @@ class Case(appiumConfig): ...@@ -54,7 +54,7 @@ class Case(appiumConfig):
AssertLen.maidiannumber(result) AssertLen.maidiannumber(result)
def test_02_picture_button(self): def test_02_ai_scan(self):
'相册按钮埋点' '相册按钮埋点'
#点击关闭弹窗 #点击关闭弹窗
...@@ -94,7 +94,7 @@ class Case(appiumConfig): ...@@ -94,7 +94,7 @@ class Case(appiumConfig):
def test_03_last_button(self): def test_03_ai_scan(self):
'上次报告按钮埋点' '上次报告按钮埋点'
# 点击关闭弹窗 # 点击关闭弹窗
...@@ -131,7 +131,7 @@ class Case(appiumConfig): ...@@ -131,7 +131,7 @@ class Case(appiumConfig):
def test_04_take_photo_record_button(self): def test_04_ai_scan(self):
'拍照按钮埋点' '拍照按钮埋点'
# 点击关闭弹窗 # 点击关闭弹窗
......
...@@ -11,7 +11,7 @@ from page import home_Page, ai_Page ...@@ -11,7 +11,7 @@ from page import home_Page, ai_Page
class Case(appiumConfig): class Case(appiumConfig):
def test_01(self): def test_01_ai_school(self):
'面孔tab点击' '面孔tab点击'
...@@ -43,7 +43,7 @@ class Case(appiumConfig): ...@@ -43,7 +43,7 @@ class Case(appiumConfig):
AssertLen.maidiannumber(result) AssertLen.maidiannumber(result)
def test_02(self): def test_02_ai_school(self):
'男生按钮选择框点击' '男生按钮选择框点击'
# 点击关闭弹窗 # 点击关闭弹窗
...@@ -80,7 +80,7 @@ class Case(appiumConfig): ...@@ -80,7 +80,7 @@ class Case(appiumConfig):
AssertLen.maidiannumber(result) AssertLen.maidiannumber(result)
def test_03(self): def test_03_ai_school(self):
'女生按钮选择框点击' '女生按钮选择框点击'
# 点击关闭弹窗 # 点击关闭弹窗
...@@ -113,7 +113,7 @@ class Case(appiumConfig): ...@@ -113,7 +113,7 @@ class Case(appiumConfig):
AssertLen.maidiannumber(result) AssertLen.maidiannumber(result)
def test_04(self): def test_04_ai_school(self):
'相册按钮点击' '相册按钮点击'
# 点击关闭弹窗 # 点击关闭弹窗
...@@ -161,8 +161,8 @@ class Case(appiumConfig): ...@@ -161,8 +161,8 @@ class Case(appiumConfig):
print(res) print(res)
def test_05(self): def test_05_ai_school(self):
# 点击跳过按钮 '点击跳过按钮'
# 点击关闭弹窗 # 点击关闭弹窗
find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel) find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel)
...@@ -209,8 +209,8 @@ class Case(appiumConfig): ...@@ -209,8 +209,8 @@ class Case(appiumConfig):
AssertLen.maidiannumber(result) AssertLen.maidiannumber(result)
def test_06(self): def test_06_ai_school(self):
# 点击上次报告按钮埋点 '点击上次报告按钮埋点'
# 点击关闭弹窗 # 点击关闭弹窗
find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel) find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel)
...@@ -245,7 +245,7 @@ class Case(appiumConfig): ...@@ -245,7 +245,7 @@ class Case(appiumConfig):
AssertLen.maidiannumber(result) AssertLen.maidiannumber(result)
def test_07(self): def test_07_ai_school(self):
'面孔起源拍照按钮点击' '面孔起源拍照按钮点击'
# 点击关闭弹窗 # 点击关闭弹窗
......
...@@ -11,7 +11,7 @@ from page import home_Page, ai_Page ...@@ -11,7 +11,7 @@ from page import home_Page, ai_Page
class Case(appiumConfig): class Case(appiumConfig):
def test_01(self): def test_01_ai_skin(self):
'测肤tab点击埋点' '测肤tab点击埋点'
# 点击关闭弹窗 # 点击关闭弹窗
...@@ -38,7 +38,7 @@ class Case(appiumConfig): ...@@ -38,7 +38,7 @@ class Case(appiumConfig):
AssertLen.maidiannumber(result) AssertLen.maidiannumber(result)
def test_02(self): def test_02_ai_skin(self):
'点击相册按钮' '点击相册按钮'
# 点击关闭弹窗 # 点击关闭弹窗
...@@ -77,7 +77,7 @@ class Case(appiumConfig): ...@@ -77,7 +77,7 @@ class Case(appiumConfig):
AssertLen.maidiannumber(result) AssertLen.maidiannumber(result)
def test_03(self): def test_03_ai_skin(self):
'点击上次报告按钮' '点击上次报告按钮'
# 点击关闭弹窗 # 点击关闭弹窗
...@@ -114,7 +114,7 @@ class Case(appiumConfig): ...@@ -114,7 +114,7 @@ class Case(appiumConfig):
AssertLen.maidiannumber(result) AssertLen.maidiannumber(result)
def test_04(self): def test_04_ai_skin(self):
'点击拍照按钮' '点击拍照按钮'
# 点击关闭弹窗 # 点击关闭弹窗
......
...@@ -11,7 +11,7 @@ from page import home_Page, ai_Page ...@@ -11,7 +11,7 @@ from page import home_Page, ai_Page
class Case(appiumConfig): class Case(appiumConfig):
def test_01_zhengxing_tab_click(self): def test_01_ai_zhengxing(self):
'模拟整形tab埋点点击' '模拟整形tab埋点点击'
# 点击关闭弹窗 # 点击关闭弹窗
find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel) find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel)
...@@ -43,7 +43,7 @@ class Case(appiumConfig): ...@@ -43,7 +43,7 @@ class Case(appiumConfig):
AssertLen.maidiannumber(result) AssertLen.maidiannumber(result)
def test_02_zhengxing_picturebutton_click(self): def test_02_ai_zhengxing(self):
'模拟整形相册按钮点击' '模拟整形相册按钮点击'
# 点击关闭弹窗 # 点击关闭弹窗
find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel) find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
# import event
from appiumConfigure.config import appiumConfig
from appiumConfigure import find_element,swip
from page import home_Page,search_Page,ai_Page,timecard_Page,me_page,doctorhome_Page
from Charles.mitm import mitm_query
from appiumConfigure import backtoapp
from Charles import AssertLen
import time
from selenium.webdriver.common.action_chains import ActionChains
from appium.webdriver.common.touch_action import TouchAction
from selenium.webdriver.support.wait import WebDriverWait
from appium.webdriver.mobilecommand import MobileCommand
class Case(appiumConfig):
def setUp(self):
super().setUp()
# 关闭弹窗点击
find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel)
time.sleep(5)
# 点击我的按钮
y = self.driver.get_window_size()['height']
x = self.driver.get_window_size()['width']
print(x, y)
self.driver.tap([[int(x-10), int(y-10)]])
ele = find_element.element(self.driver,me_page.follow)
ele.click()
time.sleep(1)
self.driver.tap([[500,500]])
def test_01_doctor_home(self):
'医生主页pv'
backtoapp.backapp(self.driver,2)
# "params": {
# "referrer_tab_name": "",
# "referrer_id": "",
# "in": "1625641471",
# "is_first": "1",
# "referrer_link": [
# "home",
# "personal_home",
# "my_focus"
# ],
# "in_time_millis": 1625641471814,
# "out": "1625641479",
# "referrer": "my_focus",
# "is_push": 0,
# "page_name": "expert_detail",
# "out_time_millis": 1625641479221,
# "fake": 0,
# "business_id": "458fa922fde945cb901c1547f6d91ed1",
# "extra_param": "{\"is_video\":\"1\"}"
# },
# "type": "page_view",
result = mitm_query(action="page_view", referrer="my_focus", page_name="expert_detail")
AssertLen.maidiannumber(result)
def test_02_doctor_home(self):
'返回按钮点击埋点'
# ele = find_element.element(self.driver,doctorhome_Page.cannel)
# ele.click()
self.driver.tap([[50,200]])
# "params": {
# "referrer": "my_focus",
# "referrer_id": "",
# "button_name": "exit",
# "page_name": "expert_detail",
# "referrer_link": [
# "home",
# "personal_home",
# "my_focus"
# ],
# "business_id": "458fa922fde945cb901c1547f6d91ed1"
# },
# "type": "on_click_button",
result = mitm_query(action="on_click_button", referrer="my_focus", button_name="exit")
AssertLen.maidiannumber(result)
def test_03_doctor_home(self):
'点击分享按钮'
ele = find_element.element(self.driver,doctorhome_Page.doctor_share)
ele.click()
backtoapp.backapp(self.driver,2)
# "params": {
# "referrer": "my_focus",
# "referrer_id": "",
# "page_name": "expert_detail",
# "referrer_link": [
# "home",
# "personal_home",
# "my_focus"
# ],
# "business_id": "458fa922fde945cb901c1547f6d91ed1",
# "url": "https://m.igengmei.com/expert/458fa922fde945cb901c1547f6d91ed1?is_share=1"
# },
# "type": "page_click_share",
result = mitm_query(action="page_click_share", referrer="my_focus", page_name="expert_detail")
AssertLen.maidiannumber(result)
def test_04_doctor_home(self):
'点击位置获取按钮'
self.driver.tap([[800,700]])
backtoapp.backapp(self.driver,2)
# "params": {
# "referrer": "my_focus",
# "referrer_id": "",
# "button_name": "organization_locate",
# "page_name": "expert_detail",
# "tab_name": "综合",
# "referrer_link": [
# "home",
# "personal_home",
# "my_focus"
# ],
# "business_id": "458879d7095c4f90a60b64a430cb3544"
# },
# "type": "on_click_button",
result = mitm_query(action="on_click_button", referrer="my_focus", button_name="organization_locate",page_name="expert_detail")
AssertLen.maidiannumber(result)
def test_05_doctor_home(self):
'点击拨打电话按钮'
self.driver.tap([[900, 700]])
backtoapp.backapp(self.driver, 2)
# "params": {
# "referrer": "my_focus",
# "referrer_id": "",
# "button_name": "电话咨询",
# "page_name": "expert_detail",
# "referrer_link": [
# "home",
# "personal_home",
# "my_focus"
# ],
# "business_id": "458879d7095c4f90a60b64a430cb3544"
# },
# "type": "on_click_button",
result = mitm_query(action="on_click_button", referrer="my_focus", button_name="电话咨询", page_name="expert_detail")
AssertLen.maidiannumber(result)
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
# import event
from appiumConfigure.config import appiumConfig
from appiumConfigure import find_element,swip
from page import home_Page,search_Page,ai_Page,timecard_Page,me_page
from Charles.mitm import mitm_query
from appiumConfigure import backtoapp
from Charles import AssertLen
import time
from selenium.webdriver.common.action_chains import ActionChains
from appium.webdriver.common.touch_action import TouchAction
from selenium.webdriver.support.wait import WebDriverWait
from appium.webdriver.mobilecommand import MobileCommand
class Case(appiumConfig):
def setUp(self):
super().setUp()
# 关闭弹窗点击
find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel)
#点击医生榜
ele = find_element.element(self.driver, home_Page.doctor_List)
ele.click()
def test_02_doctor_list(self):
'医生榜详情页pv + 医生banner点击'
# 点击医生banner
self.driver.tap([[500,700]])
backtoapp.backapp(self.driver,2)
# "params": {
# "referrer_tab_name": "",
# "referrer_id": "",
# "in": "1625218190",
# "is_first": "1",
# "referrer_link": [
# ""
# ],
# "out": "1625218193",
# "referrer": "",
# "is_push": 0,
# "page_name": "doctor_list",
# "out_time_millis": 1625218193499,
# "fake": 0,
# "business_id": ""
# },
# "type": "page_view",
result= mitm_query(action="page_view", page_name="doctor_list")
AssertLen.maidiannumber(result)
# "params": {
# "referrer": "",
# "referrer_id": "",
# "page_name": "doctor_list",
# "card_name": "王娟",
# "referrer_link": [
# ""
# ],
# "position": 0,
# "transaction_type": " -1",
# "card_type": "card",
# "card_content_type": "doctor",
# "card_id": "7c36ff2dd7ca440eae36282870e070fc"
# },
# "type": "on_click_card",
result = mitm_query(action="on_click_card", page_name="doctor_list", card_name="王娟", card_type="card", card_content_type="doctor")
AssertLen.maidiannumber(result)
def test_03_doctor_list(self):
'医生榜单-美购按钮点击'
self.driver.tap([[200,1100]])
backtoapp.backapp(self.driver,2)
# "params": {
# "referrer": "",
# "referrer_id": "",
# "page_name": "doctor_list",
# "referrer_link": [
# ""
# ],
# "position": 0,
# "transaction_type": " -1",
# "card_type": "card",
# "card_content_type": "service",
# "card_id": 5867811,
# "extra_param": {
# "doctor_id": "a8ce575fb8d84698aae145f047d92d59"
# }
# },
# "type": "on_click_card",
result = mitm_query(action="on_click_card", page_name="doctor_list", position="0", card_content_type="service")
AssertLen.maidiannumber(result)
def test_04_doctor_list(self):
'查看更多按钮点击'
TouchAction(self.driver).press(x=800,y=1100).wait(1000).move_to(x=200,y=1100).release().perform()
time.sleep(3)
This diff is collapsed.
This diff is collapsed.
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
# import event
from appiumConfigure.config import appiumConfig
from appiumConfigure import find_element
from page import home_Page,search_Page,ai_Page,timecard_Page,me_page,news_Page
from Charles.mitm import mitm_query
from appiumConfigure import backtoapp
from Charles import AssertLen
import time
from selenium.webdriver.common.action_chains import ActionChains
from appium.webdriver.common.touch_action import TouchAction
from selenium.webdriver.support.wait import WebDriverWait
from appium.webdriver.mobilecommand import MobileCommand
class Case(appiumConfig):
def setUp(self):
super().setUp()
# 关闭弹窗点击
find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel)
time.sleep(5)
# 点击消息按钮
y = self.driver.get_window_size()['height']
x = self.driver.get_window_size()['width']
print(x, y)
self.driver.tap([[int(x-300), int(y-10)]])
def test_01_news(self):
'点击首页-消息按钮'
backtoapp.backapp(self.driver,2)
# "params": {
# "referrer": "personal_home",
# "sec_tab_name": "",
# "tab_type": "out_tab",
# "referrer_id": "2892",
# "page_name": "message_home",
# "tab_name": "message",
# "referrer_link": [
# "home"
# ],
# "position": "2",
# "business_id": ""
# },
# "type": "on_click_tab",
result = mitm_query(action="on_click_tab", referrer="home", page_name="message_home", tab_name="message")
AssertLen.maidiannumber(result)
def test_02_news(self):
'点击标记已读按钮'
ele = find_element.element(self.driver,news_Page.Read)
ele.click()
backtoapp.backapp(self.driver,2)
# "params": {
# "referrer_link": [
# "home"
# ]
# },
# "type": "message_home_click_delete",
result = mitm_query(action="message_home_click_delete")
AssertLen.maidiannumber(result)
def test_03_news(self):
'点击赞/收藏按钮'
ele = find_element.element(self.driver,news_Page.fabulous_Collection)
ele.click()
backtoapp.backapp(self.driver, 2)
# "params": {
# "tab": "votecollect",
# "referrer_link": [
#
# ]
# },
# "type": "message_home_click_tab",
result = mitm_query(action="message_home_click_tab", tab="votecollect")
AssertLen.maidiannumber(result)
def test_04_news(self):
'回复按钮点击'
ele = find_element.element(self.driver,news_Page.reply)
ele.click()
backtoapp.backapp(self.driver,2)
# "params": {
# "tab": "comment",
# "referrer_link": [
#
# ]
# },
# "type": "message_home_click_tab",
result = mitm_query(action="message_home_click_tab", tab="comment")
AssertLen.maidiannumber(result)
def test_05_news(self):
'通知按钮点击'
ele = find_element.element(self.driver,news_Page.notice)
ele.click()
backtoapp.backapp(self.driver,2)
# "params": {
# "tab": "notification",
# "referrer_link": [
#
# ]
# },
# "type": "message_home_click_tab",
result = mitm_query(action="message_home_click_tab", tab="notification")
AssertLen.maidiannumber(result)
def test_06_news(self):
'点击关注按钮'
ele = find_element.element(self.driver,news_Page.follow)
ele.click()
backtoapp.backapp(self.driver, 2)
# "params": {
# "tab": "follow",
# "referrer_link": [
#
# ]
# },
# "type": "message_home_click_tab",
result = mitm_query(action="message_home_click_tab",tab="follow")
AssertLen.maidiannumber(result)
def test_07_new(self):
'点击feed流信息'
self.driver.tap([[500,720]])
backtoapp.backapp(self.driver,2)
# "params": {
# "account_id": "fb38be6e52b34b6d8efe7a30d2c93022",
# "referrer_link": [
#
# ],
# "position": 1,
# "msg_id": 16344564
# },
# "type": "message_home_private_msg_click_item",
result =mitm_query(action="message_home_private_msg_click_item")
AssertLen.maidiannumber(result)
import os
import sys
sys.path.append(os.path.dirname(os.path.dirname(__file__)))
# import event
from appiumConfigure.config import appiumConfig
from appiumConfigure import find_element
from page import home_Page,search_Page,ai_Page,timecard_Page,me_page
from Charles.mitm import mitm_query
from appiumConfigure import backtoapp
from Charles import AssertLen
import time
from selenium.webdriver.common.action_chains import ActionChains
from appium.webdriver.common.touch_action import TouchAction
from selenium.webdriver.support.wait import WebDriverWait
from appium.webdriver.mobilecommand import MobileCommand
class Case(appiumConfig):
def setUp(self):
super().setUp()
# 关闭弹窗点击
find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel)
#点击机构榜
ele = find_element.element(self.driver, home_Page.mechanism_List)
ele.click()
def test_01_organization_list(self):
'机构榜单详情页pv'
# "params": {
# "referrer_tab_name": "",
# "referrer_id": "",
# "in": "1625214664",
# "is_first": "1",
# "referrer_link": [
# ""
# ],
# "out": "1625214667",
# "referrer": "",
# "is_push": 0,
# "page_name": "mechanism_list",
# "out_time_millis": 1625214667704,
# "fake": 0,
# "business_id": ""
# },
# "type": "page_view",
result = mitm_query(action="page_view", page_name="mechanism_list")
AssertLen.maidiannumber(result)
def test_02_organization_list(self):
'点击医院banner,跳转医院主页'
self.driver.tap([[500,800]])
backtoapp.backapp(self.driver,2)
# "params": {
# "referrer": "",
# "referrer_id": "",
# "page_name": "mechanism_list",
# "card_name": "上海薇琳医疗美容医院",
# "referrer_link": [
# ""
# ],
# "position": 0,
# "transaction_type": " -1",
# "card_type": "card",
# "card_content_type": "hospital",
# "card_id": "shanghaiweilinyiliaomeirongyiyuan"
# },
# "type": "on_click_card",
result = mitm_query(action="on_click_card", page_name="mechanism_list", card_content_type="hospital")
AssertLen.maidiannumber(result)
def test_03_organization_list(self):
'点击美购列表 美购'
self.driver.tap([[200,1100]])
backtoapp.backapp(self.driver,2)
# 点击美购埋点
# "params": {
# "referrer": "",
# "referrer_id": "",
# "page_name": "mechanism_list",
# "referrer_link": [
# ""
# ],
# "position": 0,
# "transaction_type": " -1",
# "card_type": "card",
# "card_content_type": "service",
# "card_id": 5665494,
# "extra_param": {
# "mechanism_id": "shanghaiweilinyiliaomeirongyiyuan"
# }
# },
# "type": "on_click_card",
result = mitm_query(action="on_click_card", page_name="mechanism_list", card_content_type="service",card_type="service")
AssertLen.maidiannumber(result)
This diff is collapsed.
...@@ -12,7 +12,7 @@ import time ...@@ -12,7 +12,7 @@ import time
import json import json
class Case(appiumConfig): class Case(appiumConfig):
def test_01(self): def test_01_search_button(self):
'搜索按钮点击' '搜索按钮点击'
# 关闭弹窗点击 # 关闭弹窗点击
...@@ -38,11 +38,12 @@ class Case(appiumConfig): ...@@ -38,11 +38,12 @@ class Case(appiumConfig):
AssertLen.maidiannumber(result) AssertLen.maidiannumber(result)
def test_02(self): def test_02_search_button(self):
'综合搜索下美购 埋点点击事件' '综合搜索下美购 埋点点击事件'
# 关闭弹窗点击 # 关闭弹窗点击
find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel) find_element.ElementNotAssert(self.driver, home_Page.dialog_home_img_cancel)
time.sleep(2)
# 搜索按钮点击 # 搜索按钮点击
ele = find_element.element(self.driver, home_Page.search_click_button) ele = find_element.element(self.driver, home_Page.search_click_button)
ele.click() ele.click()
...@@ -81,7 +82,7 @@ class Case(appiumConfig): ...@@ -81,7 +82,7 @@ class Case(appiumConfig):
def test_03(self): def test_03_search_button(self):
'日记tab切换点击' '日记tab切换点击'
# 关闭弹窗点击 # 关闭弹窗点击
...@@ -111,7 +112,7 @@ class Case(appiumConfig): ...@@ -111,7 +112,7 @@ class Case(appiumConfig):
cpc_referer = result[0].get("params").get("cpc_referer") cpc_referer = result[0].get("params").get("cpc_referer")
find_element.notnull((query,cpc_referer)) find_element.notnull((query,cpc_referer))
def test_04(self): def test_04_search_button(self):
'日记tab下 日记卡片点击' '日记tab下 日记卡片点击'
# 关闭弹窗点击 # 关闭弹窗点击
...@@ -160,7 +161,7 @@ class Case(appiumConfig): ...@@ -160,7 +161,7 @@ class Case(appiumConfig):
AssertLen.maidiannumber(result) AssertLen.maidiannumber(result)
def test_05(self): def test_05_search_button(self):
'点击百科卡片' '点击百科卡片'
# 关闭弹窗点击 # 关闭弹窗点击
...@@ -192,7 +193,7 @@ class Case(appiumConfig): ...@@ -192,7 +193,7 @@ class Case(appiumConfig):
AssertLen.maidiannumber(result) AssertLen.maidiannumber(result)
def test_06(self): def test_06_search_button(self):
'百科下百科列表点击卡片埋点' '百科下百科列表点击卡片埋点'
# 关闭弹窗点击 # 关闭弹窗点击
...@@ -227,7 +228,7 @@ class Case(appiumConfig): ...@@ -227,7 +228,7 @@ class Case(appiumConfig):
mitm_query(action="on_click_card", card_type="card", page_name="search_result_wiki", referrer="search_result_more", tab_name="百科" ) mitm_query(action="on_click_card", card_type="card", page_name="search_result_wiki", referrer="search_result_more", tab_name="百科" )
def test_07(self): def test_07_search_button(self):
'点击问答tab 点击埋点' '点击问答tab 点击埋点'
# 关闭弹窗点击 # 关闭弹窗点击
...@@ -255,7 +256,7 @@ class Case(appiumConfig): ...@@ -255,7 +256,7 @@ class Case(appiumConfig):
AssertLen.maidiannumber(result) AssertLen.maidiannumber(result)
def test_08(self): def test_08_search_button(self):
'问答下问答列表点击卡片埋点' '问答下问答列表点击卡片埋点'
# 关闭弹窗点击 # 关闭弹窗点击
...@@ -294,7 +295,7 @@ class Case(appiumConfig): ...@@ -294,7 +295,7 @@ class Case(appiumConfig):
AssertLen.maidiannumber(result) AssertLen.maidiannumber(result)
def test_09(self): def test_09_search_button(self):
'点击 我要提问按钮 点击埋点' '点击 我要提问按钮 点击埋点'
# 关闭弹窗点击 # 关闭弹窗点击
...@@ -326,7 +327,7 @@ class Case(appiumConfig): ...@@ -326,7 +327,7 @@ class Case(appiumConfig):
AssertLen.maidiannumber(result) AssertLen.maidiannumber(result)
def test_10(self): def test_10_search_button(self):
'问答详情页pv事件' '问答详情页pv事件'
# 关闭弹窗点击 # 关闭弹窗点击
...@@ -368,7 +369,7 @@ class Case(appiumConfig): ...@@ -368,7 +369,7 @@ class Case(appiumConfig):
result = mitm_query(action="page_view",referrer="search_result_question_answer",page_name="question_answer_detail", referrer_tab_name="问答") result = mitm_query(action="page_view",referrer="search_result_question_answer",page_name="question_answer_detail", referrer_tab_name="问答")
AssertLen.maidiannumber(result) AssertLen.maidiannumber(result)
def test_11(self): def test_11_search_button(self):
'综合tab下 进入美购详情页pv事件' '综合tab下 进入美购详情页pv事件'
# 关闭弹窗点击 # 关闭弹窗点击
...@@ -412,7 +413,7 @@ class Case(appiumConfig): ...@@ -412,7 +413,7 @@ class Case(appiumConfig):
find_element.AssertExpect("common", service_type) find_element.AssertExpect("common", service_type)
AssertLen.maidiannumber(result) AssertLen.maidiannumber(result)
def test_12(self): def test_12_search_button(self):
'日记详情页pv事件' '日记详情页pv事件'
# 关闭弹窗点击 # 关闭弹窗点击
...@@ -456,7 +457,7 @@ class Case(appiumConfig): ...@@ -456,7 +457,7 @@ class Case(appiumConfig):
find_element.notnull((in_time_millis,)) find_element.notnull((in_time_millis,))
AssertLen.maidiannumber(result) AssertLen.maidiannumber(result)
def test_13(self): def test_13_search_button(self):
'百科详情页pv事件' '百科详情页pv事件'
# 关闭弹窗点击 # 关闭弹窗点击
......
...@@ -11,7 +11,7 @@ from Charles import AssertLen ...@@ -11,7 +11,7 @@ from Charles import AssertLen
class Case(appiumConfig): class Case(appiumConfig):
def test_01(self): def test_01_search_cancel_button(self):
'取消按钮点击' '取消按钮点击'
# 关闭弹窗点击 # 关闭弹窗点击
......
...@@ -11,7 +11,7 @@ from Charles import AssertLen ...@@ -11,7 +11,7 @@ from Charles import AssertLen
class Case(appiumConfig): class Case(appiumConfig):
def test_01(self): def test_01_search_sendkey_click(self):
'首页搜索输入框点击' '首页搜索输入框点击'
# 关闭弹窗点击 # 关闭弹窗点击
...@@ -30,7 +30,7 @@ class Case(appiumConfig): ...@@ -30,7 +30,7 @@ class Case(appiumConfig):
AssertLen.maidiannumber(result) AssertLen.maidiannumber(result)
def test_02(self): def test_02_search_sendkey_click(self):
'热门搜索点击' '热门搜索点击'
# 关闭弹窗点击 # 关闭弹窗点击
...@@ -79,7 +79,7 @@ class Case(appiumConfig): ...@@ -79,7 +79,7 @@ class Case(appiumConfig):
find_element.AssertExpect(hot_search_text, card_name) find_element.AssertExpect(hot_search_text, card_name)
def test_03(self): def test_03_search_sendkey_click(self):
'热门榜第一位点击' '热门榜第一位点击'
# 关闭弹窗点击 # 关闭弹窗点击
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
No preview for this file type
This diff is collapsed.
from selenium.webdriver.common.by import By
cannel = [(By.ID,'com.wanmeizhensuo.zhensuo:id/iv_back_btn',5),(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.RelativeLayout[1]/android.widget.LinearLayout/android.widget.ImageView[1]',5)]
search = [(By.ID,'com.wanmeizhensuo.zhensuo:id/tv_search_btn',5),(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.RelativeLayout[1]/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.TextView',5)]
collection = [(By.ID,'com.wanmeizhensuo.zhensuo:id/iv_search_collect',5),(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.RelativeLayout[1]/android.widget.LinearLayout/android.widget.ImageView[2]',5)]
share = [(By.ID,'com.wanmeizhensuo.zhensuo:id/iv_search_share',5),(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.RelativeLayout[1]/android.widget.LinearLayout/android.widget.ImageView[3]',5)]
content = [(By.ID,'com.wanmeizhensuo.zhensuo:id/tv_reply_content',5),(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.RelativeLayout[2]/android.widget.LinearLayout/android.widget.TextView',5)]
\ No newline at end of file
from selenium.webdriver.common.by import By
community_city = [(By.ID,'com.wanmeizhensuo.zhensuo:id/titleBarHome_tv_city',5),(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.view.ViewGroup/android.widget.RelativeLayout/android.view.ViewGroup/android.widget.LinearLayout/android.widget.FrameLayout[1]/android.view.ViewGroup/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.TextView',5)]
community_search = [(By.ID,'com.wanmeizhensuo.zhensuo:id/title_bar_rl_search',5),(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.view.ViewGroup/android.widget.RelativeLayout/android.view.ViewGroup/android.widget.LinearLayout/android.widget.FrameLayout[1]/android.view.ViewGroup/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.RelativeLayout',5)]
community_post = [(By.ID,'com.wanmeizhensuo.zhensuo:id/iv_titlrbar_right_menu_expanded',5),(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.view.ViewGroup/android.widget.RelativeLayout/android.view.ViewGroup/android.widget.LinearLayout/android.widget.FrameLayout[1]/android.view.ViewGroup/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.RelativeLayout/android.widget.ImageView',5)]
community_yanjiusuo = [(By.ID,'com.wanmeizhensuo.zhensuo:id/iv_invitation_experience',5), (By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.view.ViewGroup/android.widget.RelativeLayout/android.view.ViewGroup/android.widget.LinearLayout/android.widget.FrameLayout[1]/android.widget.RelativeLayout/android.widget.RelativeLayout/android.widget.LinearLayout/androidx.recyclerview.widget.RecyclerView/android.widget.RelativeLayout[1]/android.widget.ImageView[2]',5)]
community_qiandao = [(By.ID,'com.wanmeizhensuo.zhensuo:id/tv_sign_detail',5),(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.view.ViewGroup/android.widget.RelativeLayout/android.view.ViewGroup/android.widget.LinearLayout/android.widget.FrameLayout[1]/android.widget.RelativeLayout/android.widget.RelativeLayout/android.widget.LinearLayout/androidx.recyclerview.widget.RecyclerView/android.widget.RelativeLayout[2]/android.widget.RelativeLayout/android.widget.RelativeLayout/android.widget.TextView',5)]
community_weizheng_tab = [(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.view.ViewGroup/android.widget.RelativeLayout/android.view.ViewGroup/android.widget.LinearLayout/android.widget.FrameLayout[2]/android.widget.FrameLayout/android.widget.HorizontalScrollView/android.widget.FrameLayout/android.widget.LinearLayout[2]/android.widget.FrameLayout[2]',5)]
community_card_click = [(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.view.ViewGroup/android.widget.RelativeLayout/android.view.ViewGroup/androidx.viewpager.widget.ViewPager/android.widget.RelativeLayout/android.view.ViewGroup/androidx.recyclerview.widget.RecyclerView/android.view.ViewGroup[1]/android.view.ViewGroup/android.widget.ImageView',5)]
community_jingxuan_tab = [(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.view.ViewGroup/android.widget.RelativeLayout/android.view.ViewGroup/android.widget.LinearLayout/android.widget.FrameLayout[2]/android.widget.FrameLayout/android.widget.HorizontalScrollView/android.widget.FrameLayout/android.widget.LinearLayout[2]/android.widget.FrameLayout[1]/android.widget.RelativeLayout/android.widget.TextView',5)]
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -27,3 +27,6 @@ questionAndquestion_tab = [(By.XPATH, '/hierarchy/android.widget.FrameLayout/and ...@@ -27,3 +27,6 @@ questionAndquestion_tab = [(By.XPATH, '/hierarchy/android.widget.FrameLayout/and
questionAndquestion_card = [(By.ID, 'com.wanmeizhensuo.zhensuo:id/tvAnswerContent', 5),(By.XPATH, '/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/androidx.viewpager.widget.ViewPager/android.widget.RelativeLayout/android.view.ViewGroup/android.view.ViewGroup/androidx.recyclerview.widget.RecyclerView/android.widget.RelativeLayout[1]/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.TextView', 5)] questionAndquestion_card = [(By.ID, 'com.wanmeizhensuo.zhensuo:id/tvAnswerContent', 5),(By.XPATH, '/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/androidx.viewpager.widget.ViewPager/android.widget.RelativeLayout/android.view.ViewGroup/android.view.ViewGroup/androidx.recyclerview.widget.RecyclerView/android.widget.RelativeLayout[1]/android.widget.RelativeLayout/android.widget.LinearLayout/android.widget.TextView', 5)]
Iwanttoaskaquestion = [(By.ID, "com.wanmeizhensuo.zhensuo:id/iv_create_question", 5),(By.XPATH, "/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/androidx.viewpager.widget.ViewPager/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.ImageView", 5)] Iwanttoaskaquestion = [(By.ID, "com.wanmeizhensuo.zhensuo:id/iv_create_question", 5),(By.XPATH, "/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/androidx.viewpager.widget.ViewPager/android.widget.RelativeLayout/android.widget.FrameLayout/android.widget.RelativeLayout/android.widget.ImageView", 5)]
# 综合tab下 美购卡片的点击
seach_shopping_click = [(By.XPATH,'/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.widget.LinearLayout/androidx.viewpager.widget.ViewPager/android.widget.RelativeLayout/android.view.ViewGroup/android.view.ViewGroup/androidx.recyclerview.widget.RecyclerView/android.widget.LinearLayout/androidx.recyclerview.widget.RecyclerView/android.widget.RelativeLayout[1]/android.widget.LinearLayout',5)]
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment