Browse Source

用户订阅相关信息-免费用户,推送数据浏览状态修改

jialuyao 3 weeks ago
parent
commit
1948d2436a

+ 1 - 1
cases/pc/登录功能/订阅/push_data_browsing_free.py

@@ -19,7 +19,7 @@ class c1:
         STEP(1,'第一步调用函数')    #会出现在测试报告中
         r = apimgr.push_data_browsing_free()
         res = r.json()
-        INFO(res)
+        #INFO(res)
         actural  = res['error_code']
         actural1 = res['data']
         STEP(2,'第二步设置检查点')

+ 27 - 0
cases/pc/登录功能/订阅/subscribe_information_free.py

@@ -0,0 +1,27 @@
+from hytest import *
+from lib.webapi import apimgr
+class c1:
+    #测试用例名称
+    name='用户订阅相关信息-免费用户'
+
+    def setup(self):
+        INFO('切换用户身份到质量部测试切换企业下')
+        apimgr.Identity_list(4)
+        apimgr.Identity_switch()
+
+    def teardown(self):
+        INFO('将用户切回到闫培珠新版商机管理企业')
+        apimgr.Identity_list(1)
+        apimgr.Identity_switch()
+    #测试步骤
+    def teststeps(self):
+        INFO('测试步骤')
+        STEP(1,'第一步调用函数')    #会出现在测试报告中
+        r = apimgr.subscribe_information_free()
+        res = r.json()
+        INFO(res)
+        actural  = res['error_code']
+        actural1 = res['data']['userId']
+        STEP(2,'第二步设置检查点')
+        #设置检查点
+        CHECK_POINT('检查用户订阅相关信息-免费用户接口是否正常',actural ==0 and actural1 =="ABCYAEEczIvGSg4EnpeApw%3D")

+ 20 - 0
lib/webapi.py

@@ -1997,6 +1997,26 @@ class APIMgr():
         response = self.s.post(f"{cfg.target_host}/jyapi/jybx/subscribe/fType/setRead", headers=headers, params=params)
         return response
 
+    """推送数据浏览状态修改-免费用户"""
+
+    def subscribe_information_free(self):
+        try:
+            base_headers = GSTORE['headers']
+        except KeyError:
+            base_headers = {}
+        extra_headers = {
+            "Content-Type": "application/json",
+            "userid": "ABCYAEEczIv6Sg4EnpeApm%3D",
+            "appId": ""
+        }
+        headers = {**base_headers, **extra_headers}
+        response = self.s.post(
+            url=f"{cfg.target_host_app}/jyapi/jybx/subscribe/fType/someInfo",
+            headers=headers
+        )
+        return response
+
+
 apimgr = APIMgr()