Browse Source

一键清空未读消息

123456 7 months ago
parent
commit
e7bd64cb49
2 changed files with 24 additions and 2 deletions
  1. 18 0
      cases/pc/登录功能/消息中心/clearunreadmsg.py
  2. 6 2
      lib/webapi.py

+ 18 - 0
cases/pc/登录功能/消息中心/clearunreadmsg.py

@@ -0,0 +1,18 @@
+import json
+from hytest import *
+from lib.webapi import apimgr
+
+class c1:
+    name = '一键清空未读消息'
+
+    def teststeps(self):
+        INFO('初始化方法')
+        STEP(1, '第一步调用函数')
+        res = apimgr.clear_unread_msg()
+        resp = res.json()
+        mes = resp["message"]
+        STEP(2, '第二步设置检查点')
+        # 设置检查点
+        CHECK_POINT('验证message是否为空', mes =="")
+
+

+ 6 - 2
lib/webapi.py

@@ -49,7 +49,7 @@ class APIMgr():
     s = requests.Session()
     GSTORE['s'] = s
     #pc登录接口
-    def mgr_login(self, phone='18211989987', password='123456',useproxies=False):
+    def mgr_login(self, phone='15700000444', password='123123',useproxies=False):
         headers=GSTORE['headers']
         s = GSTORE['s']
         if useproxies:
@@ -1070,7 +1070,11 @@ class APIMgr():
 
         response =self.s.post(f"{cfg.target_host}/jyapi/messageCenter/MessageList",headers=header,json=json)
         return response
-
+    #一键清空未读消息
+    def clear_unread_msg(self):
+        header = GSTORE['headers']
+        response = self.s.post(f"{cfg.target_host}/jyapi/messageCenter/ClearUnreadMsg",headers = header)
+        return response
 apimgr = APIMgr()