# 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)
#
#
#
#
#
