Beispiel #1
0
 def test_06_业主提款审核(self):
     Pylog.info("TestCase---------------test_06_业主提款审核")
     bind_data = globalvars.get_value("bind_data")
     results = self.payment.draw_list(memberName=self.membername)
     results = json.loads(results)["data"]["rows"]
     self.assertEqual(3, len(results))
     for row in results:
         self.assertEqual(bind_data["bankCard"], row["cardNo"])
         self.assertEqual(bind_data["realName"], row["realName"])
         self.payment.draw_audit(row["cid"], 5)
         if results.index(row) == 0:
             self.payment.draw_audit(row["cid"], 3)
         elif results.index(row) == 2:
             self.payment.draw_audit(row["cid"], 4)
Beispiel #2
0
 def orderExp_statusAll(self, status):
     '''
     :param status: 1停用, 0启用
     :return: 状态
     '''
     try:
         clist = self.orderExp_list()
         clist = json.loads(clist)["data"]["rows"]
         for cid in clist:
             self.orderExp_status(cid["lotteryId"], status)
         return "SUCCESS"
     except Exception:
         Pylog.error("【投注限制全部停启用错误】:" + Pylog.exinfo())
         return "投注限制全部停启用错误"
Beispiel #3
0
 def update_status(self, userId=125, status=1):
     '''停启用账号
         status:
             1:启用
             0:停用
     '''
     url = "http://" + self.host + self.config.api["owner"]["update_status"]
     datas = {"userId": userId, "status": status}
     resp = requests.post(url=url,
                          headers=self.headers,
                          params=datas,
                          timeout=15)
     Pylog.debug("【停启用账号-request】" + str(datas))
     Pylog.debug("【停启用账号-resp】" + str(resp.text))
     return str(resp.text)
Beispiel #4
0
 def test_12_04投注赛车系列(self):
     lists = self.loId_list["pk10"]
     lotteryId = random.choice(lists)
     Pylog.info(
         "TestCase---------------test_12_04投注赛车系列(lotteryID:{})".format(
             str(lotteryId)))
     results = self.memberbet.pre_bet(lotteryId)
     self.assertEqual("SUCCESS", results)
     lists.remove(lotteryId)
     lotteryId_2 = random.choice(lists)
     Pylog.info(
         "TestCase---------------test_12_04投注赛车系列(lotteryID:{})".format(
             str(lotteryId_2)))
     results = self.memberbet.pre_bet(lotteryId_2)
     self.assertEqual("SUCCESS", results)
Beispiel #5
0
 def receipt_deleteAll(self):
     '''快捷支付全部删除'''
     try:
         url = "http://" + self.host + "/arespayment/apis/plat/receipt/delete"
         clist = self.receipt_list()
         clist = json.loads(clist)["data"]
         for cid in clist:
             if cid["rsNameId"] == 0:
                 requests.get(url=url,
                              headers=self.headers,
                              params={"cid": cid["id"]})
         return "SUCCESS"
     except Exception:
         Pylog.error("【快捷支付全部删除错误】:" + Pylog.exinfo())
         return "快捷支付全部删除错误"
Beispiel #6
0
 def test_23_彩种排序验证(self):
     Pylog.info("TestCase---------------test_23_彩种排序验证")
     #获取彩种排序
     tmp = self.memberaction.apid_lotterys()
     json_dict = json.loads(tmp)
     #获取“展示名称”
     name = json_dict['data'][0]['name']
     # 获取“权重”
     orderCount = json_dict['data'][0]['orderCount']
     # 获取“彩种图标”
     imgUrl = json_dict['data'][0]['imgUrl']
     #断言
     self.assertEqual(name, globalvars.get_value("aliasName"))
     self.assertEqual(orderCount, globalvars.get_value("weight"))
     self.assertEqual(imgUrl, globalvars.get_value("imgUrl"))
Beispiel #7
0
 def walletpay_deleteAll(self):
     '''钱包支付删除全部'''
     try:
         results1 = self.walletpay_list(accountType=1)
         results1 = json.loads(results1)["data"]["rows"]
         results2 = self.walletpay_list(accountType=2)
         results2 = json.loads(results2)["data"]["rows"]
         results = results1 + results2
         for i in results:
             self.walletpay_status(i["id"], 0)
             self.walletpay_delete(cid=i["id"])
         return "SUCCESS"
     except Exception:
         Pylog.error("【钱包支付删除全部错误】:" + Pylog.exinfo())
         return "钱包支付删除全部错误"
Beispiel #8
0
 def test_37_公告设定验证(self):
     Pylog.info("TestCase---------------test_37_公告设定验证")
     #获取公告
     tmp = self.memberaction.cms_notice()
     json_dict = json.loads(tmp)
     #获取“公告标题”
     title = json_dict['data'][0]['title']
     # 获取“公告权重”
     weight = json_dict['data'][0]['weight']
     # 获取“公告内容”
     content = json_dict['data'][0]['content']
     #断言
     self.assertEqual(title, globalvars.get_value("noticeTitle"))
     self.assertEqual(weight, globalvars.get_value("noticeWeight"))
     self.assertEqual(content, globalvars.get_value("noticeContent"))
Beispiel #9
0
 def loglogin_list(self):
     '''同ip账号查询'''
     url = "http://" + self.host + self.auth.config.api["owner"][
         "loglogin_list"]
     datas = {
         "ip": '121.58.234.210',
         "loginType": 1,
         "page": 1,
         "rows": 15,
         "userName": '******'
     }
     resp = requests.get(url=url, params=datas, headers=self.headers)
     Pylog.debug("【同ip账号查询-request】" + str(datas))
     Pylog.info("【同ip账号查询-resp】" + str(resp.text))
     return str(resp.text)
Beispiel #10
0
 def thirdpay_status(self, cid, status=0):
     '''第三方支付停启用
         status:
             0:停用
             1:启用
     '''
     try:
         url = "http://" + self.host + self.config.api["owner"][
             "thirdpay_status"]
         datas = {"id": cid, "status": status}
         resp = requests.get(url=url, headers=self.headers, params=datas)
         Pylog.debug("【第三方支付停启用-resp】" + str(resp.text))
         return str(resp.text)
     except Exception:
         Pylog.error("【第三方支付停启用错误】:" + Pylog.exinfo())
         return "第三方支付停启用错误"
Beispiel #11
0
 def whiteips_updateStatus(self, id=52, status=1):
     '''白名单停启用
         status:
             1:启用
             2:停用
     '''
     url = "http://" + self.host + self.config.api["owner"][
         "whiteips_updateStatus"]
     datas = {"id": id, "status": status}
     resp = requests.post(url=url,
                          headers=self.headers,
                          params=datas,
                          timeout=15)
     Pylog.debug("【白名单停启用-request】" + str(datas))
     Pylog.debug("【白名单停启用-resp】" + str(resp.text))
     return str(resp.text)
Beispiel #12
0
 def soundConfig_save(self, cid=1, status=1):
     '''语音提示停启用
         status:
             0:停用
             1:启用
     '''
     url = "http://" + self.host + self.config.api["owner"][
         "soundConfig_save"]
     datas = {"cid": cid, "status": status}
     resp = requests.post(url=url,
                          headers=self.headers,
                          data=json.dumps(datas),
                          timeout=15)
     Pylog.debug("【语音提示停启用-request】" + str(datas))
     Pylog.debug("【语音提示停启用-resp】" + str(resp.text))
     return str(resp.text)
Beispiel #13
0
 def walletpay_list(self, accountType=1):
     '''钱包支付列表'''
     try:
         url = "http://" + self.host + "/arespayment/apis/plat/walletpay/list"
         params = {
             "accountType": accountType,
             "page": 1,
             "pageSize": 15,
             "pageNo": 1
         }
         resp = requests.get(url=url, headers=self.headers, params=params)
         Pylog.debug("【钱包支付列表-resp】" + str(resp.text))
         return resp.text
     except Exception:
         Pylog.error("【获取钱包支付列表错误】:" + Pylog.exinfo())
         return "获取钱包支付列表错误"
Beispiel #14
0
 def test_03_业主层级绑定出入款优惠设定(self):
     Pylog.info("TestCase---------------test_03_业主层级绑定出入款优惠设定")
     # 查询会员层级
     results = self.uaa.member_info(self.membername)
     self.assertIn(self.membername, results)
     levelName = json.loads(results)["data"]["levelName"]
     levelId = json.loads(results)["data"]["levelId"]
     globalvars.set_value("member_level", {
         "id": levelId,
         "value": levelName
     })
     # 更改层级绑定出入款优惠设定
     results = self.uaa.level_bind_acced(
         levelName, "auto出入款优惠vct",
         globalvars.get_value("accessDiscount_id"))
     self.assertIn("SUCCESS", results)
Beispiel #15
0
 def level_list(self, levelName=None):
     '''层级搜索'''
     try:
         url = "http://" + self.host + "/uaa/apis/plat/memberLevel/list"
         resp = requests.get(url=url,
                             headers=self.headers,
                             params={
                                 "name": levelName,
                                 "page": 1,
                                 "rows": 15
                             })
         Pylog.debug("【层级搜索-resp】" + str(resp.text))
         return resp.text
     except Exception:
         Pylog.error("【层级搜索错误】:" + Pylog.exinfo())
         return "层级搜索错误"
Beispiel #16
0
 def chargeanddraw_statList(self, searchType=5):
     '''出入款账目汇总_人工入款和会员出款扣款查询
         searchType:
             5:人工入款
             6:会员出款扣款
             8:人工提出
             10:给予优惠
     '''
     url = "http://" + self.host + self.api["owner"]["chargeanddraw_statList"]
     datas = {"endTime": 1522511999000, "page": 1, "rows": 15, "startTime": 1519833600000, "searchType": searchType}
     resp = requests.get(url=url, params=datas, headers=self.headers)
     if searchType == 5:
         Pylog.info("【出入款账目汇总_人工入款查询-resp】" + str(resp.text))
     elif searchType == 6:
         Pylog.info("【出入款账目汇总_会员出款扣款查询-resp】" + str(resp.text))
     return str(resp.text)
Beispiel #17
0
 def order_historylist(self):
     '''历史方案'''
     url = "http://" + self.host + self.api["owner"]["order_historylist"]
     datas = self.config.model("owner", "orderlist.json")
     datas["condition"]["betStartTime"] = utils.datetime_timestamp(
         '2018-02-05 00:00:00') * 1000
     datas["condition"]["betEndTime"] = utils.datetime_timestamp(
         '2018-02-05 23:59:59') * 1000
     datas["condition"] = json.dumps(datas["condition"])
     resp = requests.get(url=url,
                         headers=self.headers,
                         params=datas,
                         timeout=15)
     Pylog.debug("【历史方案-request】" + str(datas))
     Pylog.info("【历史方案-resp】" + str(resp.text))
     return str(resp.text)
Beispiel #18
0
 def offline_audit(self, id, state):
     '''公司入款审核相关操作
         state:
             5:锁定
             4: 通过
             3:拒绝
     '''
     try:
         url = "http://" + self.host + self.api["owner"]["offline_audit"]
         datas = {"id": id, "state": state}
         resp = requests.get(url=url, params=datas, headers=self.headers)
         Pylog.debug("【公司入款审核resp】" + str(resp.text))
         return str(resp.text)
     except Exception:
         Pylog.error("【公司入款审核错误】:" + Pylog.exinfo())
         return "公司入款审核错误"
Beispiel #19
0
 def test_01_业主彩种排序设定(self):
     Pylog.info("TestCase---------------test_01_业主彩种排序设定")
     # 查询彩种排序信息
     tmp = self.paramConfig.lotteryWeight_list()
     self.assertIsNotNone(tmp)
     json_dict = json.loads(tmp)
     param = json_dict['data']['rows'][0]
     # 保存查询到的信息
     globalvars.set_value("aliasName",
                          json_dict['data']['rows'][0]['aliasName'])
     globalvars.set_value("weight", json_dict['data']['rows'][0]['weight'])
     globalvars.set_value("imgUrl", json_dict['data']['rows'][0]['imgUrl'])
     # 设置“展示名称”、“权重”、“彩种图标”
     results = self.paramConfig.lotteryWeight_save(param)
     # 断言
     self.assertIn("SUCCESS", results)
Beispiel #20
0
 def registDiscount_save(self,
                         name='autotest111',
                         discountedPrice=100,
                         auditMultiple=1):
     '''注册优惠设定'''
     url = "http://" + self.host + self.api["owner"]["registDiscount_save"]
     datas = {
         "name": name,
         "discountedPrice": discountedPrice,
         "auditMultiple": auditMultiple
     }
     resp = requests.post(url=url,
                          headers=self.headers,
                          data=json.dumps(datas))
     Pylog.debug("【注册优惠设定-request】" + str(datas))
     Pylog.debug("【注册优惠设定-resp】" + str(resp.text))
     return str(resp.text)
Beispiel #21
0
 def test_34_微信钱包设定验证(self):
     Pylog.info("TestCase---------------test_34_微信钱包设定验证")
     #获取支付宝钱包
     tmp = self.memberaction.cms_copyright(type=3, code='AT03')
     json_dict = json.loads(tmp)
     #如果是停用状态的话data为空
     if globalvars.get_value("AT03status") == 0:
         self.assertIsNone(json_dict['data'])
     #如果是启用状态的话取data里面的标题和内容进行判断
     else:
         #获取“支付宝钱包”标题
         title = json_dict['data'][0]['title']
         #获取“支付宝钱包”内容
         content = json_dict['data'][0]['content']
         #断言
         self.assertEqual(title, globalvars.get_value("AT03title"))
         self.assertEqual(content, globalvars.get_value("AT03content"))
Beispiel #22
0
 def test_30_充值教程设定验证(self):
     Pylog.info("TestCase---------------test_30_充值教程设定验证")
     #获取充值教程
     tmp = self.memberaction.cms_copyright(type=1, code='BT05')
     json_dict = json.loads(tmp)
     #如果是停用状态的话data为空
     if globalvars.get_value("BT05status") == 0:
         self.assertIsNone(json_dict['data'])
     #如果是启用状态的话取data里面的标题和内容进行判断
     else:
         #获取“充值教程”标题
         title = json_dict['data'][0]['title']
         #获取“充值教程”内容
         content = json_dict['data'][0]['content']
         #断言
         self.assertEqual(title, globalvars.get_value("BT05title"))
         self.assertEqual(content, globalvars.get_value("BT05content"))
Beispiel #23
0
 def test_12_业主微信钱包设定(self):
     Pylog.info("TestCase---------------test_12_业主微信钱包设定")
     # 查询微信钱包
     tmp = self.content.copyright_list(type=3)
     self.assertIsNotNone(tmp)
     json_dict = json.loads(tmp)
     param = json_dict['data']['rows'][2]
     param['title'] = "自动化测试"
     param['content'] = "自动化测试"
     # 保存查询到的微信钱包
     globalvars.set_value("AT03title", param['title'])
     globalvars.set_value("AT03content", param['content'])
     globalvars.set_value("AT03status", param['status'])
     # 设置微信钱包
     results = self.content.copyright_save(param)
     # 断言
     self.assertIn("SUCCESS", results)
Beispiel #24
0
 def test_08_业主充值教程设定(self):
     Pylog.info("TestCase---------------test_08_业主充值教程设定")
     # 查询充值教程
     tmp = self.content.copyright_list(type=1)
     self.assertIsNotNone(tmp)
     json_dict = json.loads(tmp)
     param = json_dict['data']['rows'][4]
     param['title'] = "自动化测试"
     param['content'] = "自动化测试"
     # 保存查询到的充值教程
     globalvars.set_value("BT05title", param['title'])
     globalvars.set_value("BT05content", param['content'])
     globalvars.set_value("BT05status", param['status'])
     # 设置充值教程
     results = self.content.copyright_save(param)
     # 断言
     self.assertIn("SUCCESS", results)
Beispiel #25
0
 def thirdpay_list(self, merchantName=None, status=-1):
     '''第三方支付搜索'''
     try:
         url = "http://" + self.host + self.config.api["owner"][
             "thirdpay_list"]
         datas = {
             "count": 15,
             "page": 1,
             "status": status,
             "merchantName": merchantName
         }
         resp = requests.get(url=url, headers=self.headers, params=datas)
         Pylog.debug("【第三方支付搜索-resp】" + str(resp.text))
         return str(resp.text)
     except Exception:
         Pylog.error("【第三方支付搜索错误】:" + Pylog.exinfo())
         return "第三方支付搜索错误"
Beispiel #26
0
    def test_07_人工存提记录(self):
        Pylog.info("TestCase---------------test_07_人工存提记录")
        resultschg = self.payment.chargeanddraw_record(self.membername, "人工存入")
        resultsdraw = self.payment.chargeanddraw_record(
            self.membername, "人工提出")
        totalAmountchg = json.loads(resultschg)["summary"]["totalAmount"]
        totalAmountdraw = json.loads(resultsdraw)["summary"]["totalAmount"]
        self.assertEqual(31000, totalAmountchg)
        self.assertEqual(20000, totalAmountdraw)
        self.assertIn("auto备注人工存款1", resultschg)
        self.assertIn("auto备注人工存款2", resultschg)
        self.assertIn("auto备注活动优惠", resultschg)
        self.assertIn("auto备注其他入款", resultschg)

        self.assertIn("auto备注手动申请出款", resultsdraw)
        self.assertIn("auto备注其他出款", resultsdraw)
        self.assertIn("常态稽核、优惠稽", resultsdraw)
Beispiel #27
0
    def system_charge(self, memberName, chgtype):
        '''人工存入'''
        try:
            url = "http://" + self.host + self.api["owner"]["system_charge"]
            memberId = self.balance_get(memberName)
            memberId = json.loads(memberId)["data"]["memberId"]
            datas = {"memberName": memberName, "memberId": memberId, "actionType": 10, "chargeAmount": 10000,
                     "chargeRemark": "auto备注{}1".format(chgtype), "depDiscount": 1000,
                     "depRemark": "auto备注{}2".format(chgtype), "remDiscount": 0,
                     "remRemark": None, "discountAudit": "2", "ifNormalAudit": 1}
            if "活动优惠" == chgtype:
                datas = {"memberName": memberName, "memberId": memberId, "actionType": 13,
                         "chargeAmount": 10000, "chargeRemark": "auto备注{}".format(chgtype), "depDiscount": 0,
                         "depRemark": None, "remDiscount": 0, "remRemark": None,
                         "discountAudit": "2", "ifNormalAudit": 0}
            elif "其他入款" == chgtype:
                datas = {
                    "memberName": memberName, "memberId": memberId, "actionType": 17,
                    "chargeAmount": 10000, "chargeRemark": "auto备注其他入款",
                    "depDiscount": 0, "depRemark": None, "remDiscount": 0,
                    "remRemark": None, "discountAudit": None, "ifNormalAudit": 1}

            Pylog.debug("【人工存入-request】" + str(datas))
            resp = requests.post(url=url, data=json.dumps(datas), headers=self.headers)
            Pylog.debug("【人工存入-resp】" + str(resp.text))
            return resp.text
        except Exception:
            Pylog.error("【人工存入账号信息查询错误】:" + Pylog.exinfo())
            return "人工存入账号信息查询错误"
Beispiel #28
0
 def registerConfig_save(self, param):
     '''会员注册配置保存'''
     try:
         url = "http://" + self.host + self.api["owner"][
             "registerConfig_save"]
         for i in param:
             i["ifCheck"] = 0
             i["ifView"] = 1
             i["ifRequired"] = 1
         Pylog.debug("【会员注册配置保存-request】" + str(param))
         resp = requests.post(url=url,
                              headers=self.headers,
                              data=json.dumps(param),
                              timeout=15)
         Pylog.debug("【会员注册配置保存-resp】" + str(resp.text))
         for i in param:
             i.pop("version")
             i.pop("ifDel")
             i.pop("createUser")
             i.pop("createTime")
             i.pop("modifyUser")
             i.pop("modifyTime")
         globalvars.set_value("regconfig", param)
         return resp.text
     except Exception:
         Pylog.error("【会员注册配置保存错误】:" + Pylog.exinfo())
         return "会员注册配置保存错误"
Beispiel #29
0
 def income_create(self, level):
     '''新增公司入款方式'''
     try:
         url = "http://" + self.host + self.api["owner"]["income_create"]
         # levels = json.loads(self.memberLevel_getSelectList())["data"]
         random_income = str(time.time()).replace(".", "")
         datas = {
             "currency": "CNY",
             "cardOwnerName": "自动化收款人",
             "bankCode": "CCB",
             "bankName": "建设银行",
             "cardNo": random_income,
             "registerBankInfo": "自动化开户行",
             "stopAmount": 888800,
             "warnAmount": 88800,
             "transferRemark": None,
             "userLevels": [level]
         }
         Pylog.debug("【新增公司入款方式-request】" + str(datas))
         resp = requests.post(url=url,
                              data=json.dumps(datas),
                              headers=self.headers)
         Pylog.debug("【新增公司入款方式-resp】" + resp.text)
         return resp.text
     except Exception:
         Pylog.error("【新增公司入款错误】:" + Pylog.exinfo())
         return "新增公司入款错误"
Beispiel #30
0
 def test_36_轮播图设定验证(self):
     Pylog.info("TestCase---------------test_36_轮播图设定验证")
     #获取轮播图
     tmp = self.memberaction.cms_carousel()
     json_dict = json.loads(tmp)
     #获取“轮播图标题”
     title = json_dict['data']['title']
     # 获取“轮播图图片”
     titlePic = json_dict['data']['itemPO'][0]['titlePic']
     # 获取“轮播图链接”
     link = json_dict['data']['itemPO'][0]['link']
     # 获取“轮播图延迟时间”
     delayTime = str(json_dict['data']['delayTime'])
     #断言
     self.assertEqual(title, globalvars.get_value("carouselTitle"))
     self.assertEqual(titlePic, globalvars.get_value("carouselTitlePic"))
     self.assertEqual(link, globalvars.get_value("carouselLink"))
     self.assertEqual(delayTime, globalvars.get_value("carouselDelayTime"))