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,shopping_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)
        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)]])
        #点击收藏按钮
        self.driver.tap([[900,520]])
        # 点击美购
        ele = find_element.element(self.driver,me_page.collection_list)
        ele.click()
        # 点击商品详情页标题，以关闭弹窗
        find_element.ElementNotAssert(self.driver,shopping_Page.shopping_title)
        # 再次点击确保没有悬浮问题列表影响
        find_element.ElementNotAssert(self.driver, shopping_Page.shopping_title)


    def test_01_shopping(self):
        backtoapp.backapp(self.driver,2)
        '美购详情页pv'
        # "params": {
        #             "message_id": "",
        #             "referrer_link": [
        #                 "home",
        #                 "search_result_more"
        #             ],
        #             "in": "1623740711",
        #             "out_time_millis": "1623740744323",
        #             "referrer": "search_result_more",
        #             "fake": 0,
        #             "page_name": "welfare_detail",
        #             "referrer_id": "",
        #             "business_id": "5752521",
        #             "out": "1623740744",
        #             "referrer_tab_name": "综合",
        #             "in_time_millis": "1623740711110",
        #             "extra_param": "{
        #         \"is_flagship_store\" : false,
        #         \"service_type\" : \"common\",
        #         \"service_item_id\" : \"645957\"
        #         }",
        #         "is_first": 1,
        #         "is_push": 0
        #
        #       },

        #       "type": "page_view",
        result = mitm_query(action="page_view", page_name="welfare_detail")
        AssertLen.maidiannumber(result)

    def test_02_shopping(self):
        '美购详情页返回按钮点击'
        ele = find_element.element(self.driver,shopping_Page.shopping_cannel)
        ele.click()
        backtoapp.backapp(self.driver, 2)

        # "params": {
        #     "page_name": "welfare_detail",
        #     "referrer_id": "",
        #     "referrer_link": [
        #         "home",
        #         "search_result_more"
        #     ],
        #     "referrer": "search_result_more",
        #     "business_id": "5739732",
        #     "button_name": "返回"
        # },
        #
        # "type": "on_click_button",

        result = mitm_query(action="on_click_button", page_name="welfare_detail", button_name="返回")
        AssertLen.maidiannumber(result)



    def test_03_shopping(self):
        '收藏按钮点击'

        # 点击收藏按钮 收藏
        ele = find_element.element(self.driver,shopping_Page.shopping_collection)
        ele.click()

        # 点击收藏按钮 取消收藏
        ele = find_element.element(self.driver, shopping_Page.shopping_collection)
        ele.click()

        backtoapp.backapp(self.driver,2)

        # "params": {
        #     "page_name": "welfare_detail",
        #     "business_id": "5739732",
        #     "referrer": "search_result_more",
        #     "favor_type": "service",
        #     "motion": "do",
        #     "referrer_link": [
        #         "home",
        #         "search_result_more"
        #     ],
        #     "referrer_id": "",
        #     "service_item_id": "543770"
        # },
        #
        # "type": "on_click_favor",
        result = mitm_query(action="on_click_favor", page_name="welfare_detail", favor_type="service", motion="do")
        AssertLen.maidiannumber(result)

        # 取消收藏
        # "params": {
        #     "page_name": "welfare_detail",
        #     "business_id": "5739732",
        #     "referrer": "search_result_more",
        #     "favor_type": "service",
        #     "motion": "undo",
        #     "referrer_link": [
        #         "home",
        #         "search_result_more"
        #     ],
        #     "referrer_id": "",
        #     "service_item_id": "543770"
        # },
        # "type": "on_click_favor",
        result = mitm_query(action="on_click_favor", page_name="welfare_detail", favor_type="service", motion="undo")
        AssertLen.maidiannumber(result)


    def test_04_shopping(self):
        '商品详情页，购物车按钮点击埋点'
        ele = find_element.element(self.driver,shopping_Page.shooping_car)
        ele.click()
        backtoapp.backapp(self.driver,2)
        # "params": {
        #     "referrer_link": [
        #         "home",
        #         "search_result_more"
        #     ],
        #     "page_name": "welfare_detail"
        # },
        #
        #  "type": "on_click_navbar_cart",
        result = mitm_query(action="on_click_navbar_cart", page_name="welfare_detail")
        AssertLen.maidiannumber(result)


    def test_05_shopping(self):
        '分享按钮点击'
        ele = find_element.element(self.driver,shopping_Page.shopping_share)
        ele.click()
        backtoapp.backapp(self.driver, 2)

        # "params": {
        #     "page_name": "welfare_detail",
        #     "business_id": "5739732",
        #     "referrer": "search_result_more",
        #     "service_item_id": "543770",
        #     "referrer_tab_name": "综合",
        #     "referrer_link": [
        #         "home",
        #         "search_result_more"
        #     ],
        #     "referrer_id": "",
        #     "tab_name": "",
        #     "url": "https:\/\/m.igengmei.com\/promotion\/5739732?sku_id=543770&distribute_type=1&distribute_id=33967480&is_share=1"
        # },
        # "type": "page_click_share",
        result = mitm_query(action="page_click_share", page_name="welfare_detail")
        AssertLen.maidiannumber(result)

    def test_06_shopping(self):
        '放心购按钮点击'
        ele = find_element.element(self.driver,shopping_Page.shopping_fangxingou)
        ele.click()
        # "params": {
        #     "referrer_link": [
        #         "home",
        #         "search_result_more"
        #     ],
        #     "service_id": "5739732"
        # },
        # "type": "welfare_detail_click_service_features",
        result = mitm_query(action="welfare_detail_click_service_features")
        AssertLen.maidiannumber(result)

    def test_07_shopping(self):
        '预付款卷按钮点击'
        ele = find_element.element(self.driver,shopping_Page.shopping_yufukuan)
        ele.click()
        backtoapp.backapp(self.driver,2)
        # "params": {
        #     "referrer_link": [
        #         "home",
        #         "search_result_more"
        #     ],
        #     "coupon_type": "precoupon",
        #     "service_id": "5741664"
        # },
        # "type": "welfare_detail_click_coupon",
        result = mitm_query(action="welfare_detail_click_coupon", coupon_type="precoupon")
        AssertLen.maidiannumber(result)



    def test_08_shopping(self):
        '预付款卷页面pv'
        ele = find_element.element(self.driver,shopping_Page.shopping_yufukuan)
        ele.click()
        backtoapp.backapp(self.driver,2)
        # "params": {
        #     "page_name": "coupon_welfare_list",
        #     "referrer_link": [
        #         "home",
        #         "search_result_more",
        #         "welfare_detail"
        #     ],
        #     "business_id": 5739732
        # },
        # "type": "page_view",
        result = mitm_query(action="page_view", page_name="coupon_welfare_list")
        AssertLen.maidiannumber(result)


    def test_09_shopping(self):
        '点击美购详情页默认选择行按钮'

        # 滑动页面
        swip.swip_method(self.driver, shopping_Page.biaoti, shopping_Page.shopping_yufukuan)
        print("***")
        time.sleep(3)
        # 点击已选择按钮
        ele = find_element.element(self.driver,shopping_Page.yixuanze)
        ele.click()
        backtoapp.backapp(self.driver,2)
        # "params": {
        #     "business_id": "5739732",
        #     "referrer_link": [
        #         "home",
        #         "search_result_more"
        #     ],
        #     "button_name": "sku_choose",
        #     "business_type": "",
        #     "page_name": "welfare_detail"
        # },
        # "type": "on_click_button",
        result = mitm_query(action="on_click_button", button_name="sku_choose", page_name="welfare_detail")
        AssertLen.maidiannumber(result)

    def test_10_shopping(self):
        '选择窗口弹窗pv'
        # 滑动页面
        swip.swip_method(self.driver, shopping_Page.biaoti, shopping_Page.shopping_yufukuan)
        print("***")
        time.sleep(3)
        # 点击已选择按钮
        ele = find_element.element(self.driver, shopping_Page.yixuanze)
        ele.click()
        backtoapp.backapp(self.driver, 2)
        # "params": {
        #     "referrer": "",
        #     "referrer_id": "",
        #     "in": "1624438299",
        #     "page_name": "welfare_attribute",
        #     "out_time_millis": 1624438301447,
        #     "is_first": "0",
        #     "referrer_link": [
        #         "home",
        #         "home",
        #         "search_result_more",
        #         "welfare_detail",
        #         "welfare_detail"
        #     ],
        #     "fake": 0,
        #     "in_time_millis": 1624438299332,
        #     "business_id": "5833639",
        #     "extra_param": "{\"is_flagship_store\":false,\"service_type\":\"common\",\"service_item_id\":\"486664\"}",
        #     "out": "1624438301"
        # },
        # "type": "page_view",
        result = mitm_query(action="page_view", page_name="welfare_attribute")
        AssertLen.maidiannumber(result)


    def test_11_shopping(self):
        '私信咨询按钮点击埋点'
        self.driver.tap([[824,2091]])
        backtoapp.backapp(self.driver,2)
        # "params": {
        #     "referrer_id": "",
        #     "referrer_link": [
        #         "home",
        #         "search_result_more"
        #     ],
        #     "service_id": "5809063",
        #     "referrer": "search_result_more",
        #     "extra_param": "{
        # \"is_flagship_store\" : false,
        # \"service_type\" : \"common\",
        # \"service_item_id\" : \"650821\"
        # }"
        # },
        # "type": "welfare_detail_click_message",
        mitm_query(action="welfare_detail_click_message", referrer="search_result_more")


    def test_12_shopping(self):
        '点击加入购物车埋点'
        y = self.driver.get_window_size()['height']
        x = self.driver.get_window_size()['width']
        print(x,y)
        self.driver.tap([[int(x/4),int(y-300)]])
        backtoapp.backapp(self.driver, 2)
        # "params": {
        #     "referrer": "search_result_more",
        #     "referrer_id": "",
        #     "service_id": "5814215",
        #     "num": 1,
        #     "page_name": "welfare_detail",
        #     "referrer_link": [
        #         "home",
        #         "home",
        #         "search_home",
        #         "search_result_more"
        #     ],
        #     "service_item_id": "354059"
        # },
        # "type": "welfare_multiattribute_click_add",
        result = mitm_query(action="welfare_multiattribute_click_add", referrer="search_result_more", page_name="welfare_detail")
        AssertLen.maidiannumber(result)


    # def test_13_shopping(self):
    #     '卷后按钮点击'
    #     y = self.driver.get_window_size()['height']
    #     x = self.driver.get_window_size()['width']
    #     print(x, y)
    #     self.driver.tap([[int(x/2), int(y-300)]])
    #     backtoapp.backapp(self.driver, 2)
    #     #     "params": {
    #     #         "page_name": "welfare_detail",
    #     #         "status": 0,
    #     #         "referrer": "search_result_more",
    #     #         "service_id": "5814215",
    #     #         "extra_param": "{
    #     #     \"is_flagship_store\" : false,
    #     #     \"service_type\" : \"common\",
    #     #     \"service_item_id\" : \"354059\"
    #     #     }",
    #     #     "referrer_id": "",
    #     #     "referrer_link": [
    #     #         "home",
    #     #         "search_result_more"
    #     #     ],
    #     #     "num": 1
    #     #
    #     # }, "type":"welfare_multiattribute_click_buy",
    #     result = mitm_query(action="welfare_multiattribute_click_buy")
    #     AssertLen.maidiannumber(result)

    def test_14_shopping(self):
        '点击尾款卷按钮'
        swip.swip_method(self.driver, shopping_Page.biaoti, shopping_Page.shopping_yufukuan)
        ele = find_element.element(self.driver,shopping_Page.Balance)
        ele.click()
        backtoapp.backapp(self.driver,2)
        # "params": {
        #     "referrer_link": [
        #         "home",
        #         "personal_home",
        #         "home",
        #         "personal_home",
        #         "home",
        #         "personal_home",
        #         "my_favor_service"
        #     ],
        #     "coupon_type": "finalcoupon",
        #     "service_id": "5758653"
        # }, "type":"welfare_detail_click_coupon",
        mitm_query(action="welfare_detail_click_coupon", coupon_type="finalcoupon")


    def test_15_shopping(self):
        '尾款劵详情页pv'
        swip.swip_method(self.driver, shopping_Page.biaoti, shopping_Page.shopping_yufukuan)
        ele = find_element.element(self.driver, shopping_Page.Balance)
        ele.click()
        backtoapp.backapp(self.driver, 2)
        # "params": {
        #     "message_id": "",
        #     "referrer_link": [
        #         "home",
        #         "personal_home",
        #         "home",
        #         "personal_home",
        #         "home",
        #         "personal_home",
        #         "my_favor_service",
        #         "welfare_detail"
        #     ],
        #     "in": "1624950373",
        #     "out_time_millis": "1624950376231",
        #     "referrer": "welfare_detail",
        #     "fake": 0,
        #     "page_name": "coupon_welfare_list",
        #     "referrer_id": "5758653",
        #     "business_id": "",
        #     "out": "1624950376",
        #     "referrer_tab_name": "",
        #     "in_time_millis": "1624950373007",
        #     "extra_param": "",
        #     "is_first": 1,
        #     "is_push": 0
        # }, "type":"page_view",
        result = mitm_query(action="page_view",referrer="welfare_detail",page_name="coupon_welfare_list")
        AssertLen.maidiannumber(result)


    def test_16_shopping(self):
        '美购详情页-评论区 查看更多按钮'
        swip.swip_method(self.driver, shopping_Page.biaoti, shopping_Page.shopping_yufukuan)
        ele = find_element.element(self.driver, shopping_Page.see_more)
        ele.click()
        backtoapp.backapp(self.driver, 2)
        # "params": {
        #     "page_name": "welfare_detail",
        #     "business_id": "5758653",
        #     "referrer": "my_favor_service",
        #     "referrer_tab_name": "",
        #     "service_id": "5758653",
        #     "referrer_link": [
        #         "home",
        #         "personal_home",
        #         "home",
        #         "personal_home",
        #         "home",
        #         "personal_home",
        #         "my_favor_service"
        #     ],
        #     "referrer_id": "",
        #     "tab_name": "",
        #     "service_item_id": "650034"
        # },  "type":"welfare_detail_click_comment",
        result = mitm_query(action="welfare_detail_click_comment",page_name="welfare_detail",referrer="my_favor_service")
        AssertLen.maidiannumber(result)


    def swiptodiary(self):
        # 滑动至评论区
        swip.swip_method(self.driver, shopping_Page.biaoti, shopping_Page.shopping_yufukuan)
        time.sleep(1)
        swip.swip_method(self.driver, shopping_Page.shopping_yufukuan, shopping_Page.see_more)
        time.sleep(1)
        swip.swip_method(self.driver, shopping_Page.see_more, shopping_Page.see_more_down)

    def test_17_shopping(self):
        '点击评论区底部的查看更多按钮'
        swip.swip_method(self.driver, shopping_Page.biaoti, shopping_Page.shopping_yufukuan)
        time.sleep(1)
        swip.swip_method(self.driver, shopping_Page.shopping_yufukuan, shopping_Page.see_more)
        time.sleep(1)
        ele = find_element.element(self.driver,shopping_Page.see_more_down)
        ele.click()
        backtoapp.backapp(self.driver, 2)
        # "params": {
        #     "referrer": "my_favor_service",
        #     "referrer_id": "",
        #     "page_name": "welfare_detail",
        #     "service_id": "5758653",
        #     "referrer_link": [
        #         "home",
        #         "personal_home",
        #         "my_favor_service"
        #     ],
        #     "business_id": "5758653"
        # }, "type":"welfare_detail_click_comment",
        result = mitm_query(action="welfare_detail_click_comment", referrer="my_favor_service", page_name="welfare_detail")
        AssertLen.maidiannumber(result)



    def test_18_shopping(self):
        '点击美购详情页医院'
        self.swiptodiary()
        # 点击医院按钮
        ele = find_element.element(self.driver,shopping_Page.hospital)
        ele.click()
        backtoapp.backapp(self.driver, 2)
        # "params": {
        #     "cure_type": "organization",
        #     "is_flagship_store": false,
        #     "service_id": "5758653",
        #     "referrer_link": [
        #         "home",
        #         "personal_home",
        #         "my_favor_service"
        #     ]
        # }, "type":"welfare_detail_click_curearea",
        result = mitm_query(action="welfare_detail_click_curearea", cure_type="organization")
        AssertLen.maidiannumber(result)

    def test_19_shopping(self):
        '跳转医院详情页pv'
        self.swiptodiary()
        # 点击医院按钮
        ele = find_element.element(self.driver,shopping_Page.hospital)
        ele.click()
        backtoapp.backapp(self.driver, 2)
        # "params": {
        #     "message_id": "",
        #     "referrer_link": [
        #         "home",
        #         "personal_home",
        #         "my_favor_service",
        #         "welfare_detail"
        #     ],
        #     "in": "1625024305",
        #     "out_time_millis": "1625024310114",
        #     "referrer": "welfare_detail",
        #     "fake": 0,
        #     "page_name": "organization_detail",
        #     "referrer_id": "5758653",
        #     "business_id": "fb38be6e52b34b6d8efe7a30d2c93022",
        #     "out": "1625024310",
        #     "referrer_tab_name": "",
        #     "in_time_millis": "1625024305907",
        #     "extra_param": "",
        #     "is_first": 1,
        #     "is_push": 0
        # },  "type":"page_view",
        result = mitm_query(action="page_view", referrer="welfare_detail", page_name="organization_detail")
        AssertLen.maidiannumber(result)

    def test_20_shopping(self):
        '点击地图位置按钮'
        self.swiptodiary()
        # 点击导航按钮
        ele = find_element.element(self.driver, shopping_Page.Navigation)
        ele.click()
        backtoapp.backapp(self.driver, 2)
        # "params":{
        #     "referrer_link":[
        #         "home",
        #         "personal_home",
        #         "my_favor_service"
        #     ],
        #     "service_id":"5758653"
        # }, "type":"welfare_detail_click_address",
        result = mitm_query(action="welfare_detail_click_address")
        AssertLen.maidiannumber(result)

    def test_21_shopping(self):
        '点击电话咨询按钮'
        self.swiptodiary()
        ele = find_element.element(self.driver,shopping_Page.call_phone)
        ele.click()
        backtoapp.backapp(self.driver, 2)
        # "params": {
        #     "referrer_link": [
        #         "home",
        #         "personal_home",
        #         "my_favor_service"
        #     ],
        #     "connect_type": "phone",
        #     "service_id": "5758653"
        # }, "type":"welfare_detail_click_curearea_contact",
        result = mitm_query(action="welfare_detail_click_curearea_contact", connect_type="phone")
        AssertLen.maidiannumber(result)


    def test_22_shopping(self):
        '点击电话咨询按钮后的popview'
        self.swiptodiary()
        ele = find_element.element(self.driver, shopping_Page.call_phone)
        ele.click()
        backtoapp.backapp(self.driver, 2)
        # "params": {
        #     "business_id": "5758653",
        #     "referrer_id": "",
        #     "referrer_link": [
        #         "home",
        #         "personal_home",
        #         "my_favor_service"
        #     ],
        #     "referrer": "my_favor_service",
        #     "page_name": "welfare_detail",
        #     "popup_name": "call"
        # }, "type":"popup_view",
        result = mitm_query(action="popup_view",popup_name="call", page_name="welfare_detail")
        AssertLen.maidiannumber(result)


    def test_23_shopping(self):
        '点击电话咨询按钮后的popview的取消按钮'
        self.swiptodiary()
        ele = find_element.element(self.driver, shopping_Page.call_phone)
        ele.click()
        ele = find_element.element(self.driver,shopping_Page.call_phone_cannel)
        ele.click()
        backtoapp.backapp(self.driver,2)
        # "params": {
        #     "button_name": "cancel",
        #     "page_name": "welfare_detail",
        #     "referrer": "my_favor_service",
        #     "popup_name": "call",
        #     "business_id": "5758653",
        #     "referrer_link": [
        #         "home",
        #         "personal_home",
        #         "my_favor_service"
        #     ],
        #     "referrer_id": ""
        # },   "type":"on_click_button",
        result = mitm_query(action="on_click_button",button_name="cancel", page_name="welfare_detail", referrer="my_favor_service")
        AssertLen.maidiannumber(result)


    def test_24_shopping(self):
        '电话咨询按钮点击'
        self.swiptodiary()
        ele = find_element.element(self.driver,shopping_Page.Online_consultation)
        ele.click()
        backtoapp.backapp(self.driver,2)
        # "params": {
        #     "referrer_link": [
        #         "home",
        #         "personal_home",
        #         "my_favor_service"
        #     ],
        #     "connect_type": "onlineconsult",
        #     "service_id": "5758653"
        # },  "type":"welfare_detail_click_curearea_contact",
        result = mitm_query(action="welfare_detail_click_curearea_contact", connect_type="onlineconsult")
        AssertLen.maidiannumber(result)


    def test_25_shopping(self):
        '在线咨询详情页pv'
        self.swiptodiary()
        ele = find_element.element(self.driver,shopping_Page.Online_consultation)
        ele.click()
        backtoapp.backapp(self.driver,2)
        # "params": {
        #     "message_id": "",
        #     "referrer_link": [
        #         "home",
        #         "personal_home",
        #         "my_favor_service",
        #         "welfare_detail"
        #     ],
        #     "in": "1625040400",
        #     "out_time_millis": "1625040417924",
        #     "referrer": "welfare_detail",
        #     "fake": 0,
        #     "page_name": "conversation_detail",
        #     "referrer_id": "5758653",
        #     "business_id": "29409162_33967480",
        #     "out": "1625040417",
        #     "referrer_tab_name": "",
        #     "in_time_millis": "1625040400498",
        #     "extra_param": "",
        #     "is_first": 1,
        #     "is_push": 0
        # },   "type":"page_view",
        result = mitm_query(action="page_view", page_name="conversation_detail",referrer="welfare_detail")
        AssertLen.maidiannumber(result)


    def test_26_shopping(self):
        '美购详情页美购列表点击'
        self.swiptodiary()
        ele = find_element.element(self.driver,shopping_Page.shopping_list)
        ele.click()
        backtoapp.backapp(self.driver,2)
        # "params": {
        #     "match_type": true,
        #     "target_id": "5793613",
        #     "service_id": "5758653",
        #     "referrer_link": [
        #         "home",
        #         "personal_home",
        #         "my_favor_service"
        #     ]
        # }, "type":"welfare_detail_click_seller_service_item",
        result = mitm_query(action="welfare_detail_click_seller_service_item")
        AssertLen.maidiannumber(result)



    def test_27_shopping(self):
        '点击提问按钮'
        ele = find_element.element(self.driver,shopping_Page.ll_float_button)
        ele.click()
        # "params": {
        #     "business_id": "5793613",
        #     "page_name": "welfare_detail",
        #     "referrer_link": [
        #         "home",
        #         "personal_home",
        #         "my_favor_service",
        #         "welfare_detail"
        #     ],
        #     "button_name": "put_question",
        #     "referrer": "welfare_detail",
        #     "referrer_id": "5758653"
        # }, "type":"on_click_button",
        result = mitm_query(action="on_click_button", page_name="welfare_detail", button_name="put_question", referrer="my_favor_service")
        AssertLen.maidiannumber(result)


    def test_28_shopping(self):
        '点击提问按钮产生的popup_view'
        ele = find_element.element(self.driver, shopping_Page.ll_float_button)
        ele.click()
        # "params": {
        #     "popup_name": "question",
        #     "page_name": "welfare_detail",
        #     "referrer_link": [
        #         "home",
        #         "personal_home",
        #         "my_favor_service",
        #         "welfare_detail"
        #     ],
        #     "referrer": "welfare_detail",
        #     "business_id": "5793613",
        #     "referrer_id": "5758653"
        # },   "type":"popup_view",
        mitm_query(action="popup_view", popup_name="question", page_name="welfare_detail")



    def test_29_shopping(self):
        '全部评价pv事件'
        swip.swip_method(self.driver, shopping_Page.biaoti, shopping_Page.shopping_yufukuan)
        ele = find_element.element(self.driver, shopping_Page.see_more)
        ele.click()
        backtoapp.backapp(self.driver,2)
        # "params": {
        #     "message_id": "",
        #     "referrer_link": [
        #         "home",
        #         "personal_home",
        #         "my_favor_service",
        #         "welfare_detail"
        #     ],
        #     "in": "1630034024",
        #     "out_time_millis": "1630034027990",
        #     "referrer": "welfare_detail",
        #     "fake": 0,
        #     "page_name": "all_case_service_comment",
        #     "referrer_id": "5758653",
        #     "business_id": "",
        #     "out": "1630034027",
        #     "referrer_tab_name": "",
        #     "in_time_millis": "1630034024434",
        #     "extra_param": "",
        #     "is_first": 1,
        #     "is_push": 0
        # },
        # "type": "page_view",
        result = mitm_query(action="page_view", page_name="all_case_service_comment")
        AssertLen.maidiannumber(result)


    def test_30_shopping(self):
        '全部评论页购物车按钮点击埋点'
        ele = find_element.element(self.driver,shopping_Page.shooping_car1)
        ele.click()
        # "params": {
        #     "referrer_link": [
        #         "home",
        #         "personal_home",
        #         "my_favor_service",
        #         "welfare_detail"
        #     ],
        #     "page_name": "all_case_service_comment"
        # },
        # "type": "on_click_navbar_cart",
        result = mitm_query(action="on_click_navbar_cart", page_name="all_case_service_comment")
        AssertLen.maidiannumber(result)



















