def test_重置取款密码(self): Pylog.info("【账号管理-快速检测-重置取款密码】") resp = self.uaa.plat_update(memberId=self.baseData.memberId, tradePassword=1234) dictResp = json.loads(resp) err = dictResp['err'] self.assertEqual("SUCCESS", err)
def test_重置登录密码(self): Pylog.info("【账号管理-快速检测-重置登录密码】") resp = self.uaa.member_password(memberId=self.baseData.memberId, newPassword=123456) dictResp = json.loads(resp) err = dictResp['err'] self.assertEqual("SUCCESS", err)
def verify_1(self, data): game = config.get_config("verifygame", "game") urlfile = config.get_config("verifygame", "urlfile") Pylog.info(data) datas = {"id": data} self.httpRequest.headers = { "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", "Authorization": "MAuth-870fc3d727723a7410d2c0fa15154072cdb9300e9a54f89e09b9a27d32f852a44fd07348ae46208298303f281bcdc9a9079fa0b79310115038b4071b44edbe42-MAuth", "X-APP-ID": "20" } url = "http://" + config.get_config("normal", "url") + "/v1/config/kd/game/start" self.reps = self.httpRequest.post(url=url, data=datas) Pylog.debug("Request Body:" + str(self.reps.request.body)) Pylog.debug("Response:" + self.reps.text) csvfile = open(urlfile + '/' + game + '.csv', 'a', encoding='utf8', newline='') writer = csv.writer(csvfile) #正则表达式 gameurl = re.findall("action='(.*)'> </form>", self.reps.text, re.S) writer.writerow([data, gameurl[0]]) csvfile.close()
def statics_game_per_day(self, endPdate=1519833599000, startPdate=1517414400000, lotteryIds=2, source=2): '''单日游戏报表搜索 source: 2:H5 ''' url = "http://" + self.host + self.auth.config.api["owner"][ "statics_game_per_day"] datas = { "endPdate": endPdate, "page": 1, "rows": 15, "startPdate": startPdate, "lotteryIds": lotteryIds, "source": source, "count": 15, "sideType": 2 } resp = requests.get(url=url, headers=self.headers, params=datas) Pylog.debug("【单日游戏报表搜索-request】" + str(datas)) Pylog.info("【单日游戏报表搜索-resp】" + str(resp.text)) return str(resp.text)
def agentPeriod_getSelectList(self, agentName='default', pcode=81): '''获取代理退佣期号''' url = "http://" + self.host + self.auth.config.api["owner"][ "agentPeriod_getSelectList"] resp = requests.get(url=url, headers=self.headers) Pylog.info("【获取代理退佣期号-resp】" + str(resp.text)) return str(resp.text)
def test_人工提出(self): Pylog.info("【资金管理-人工存提-人工提出】") resp = self.payment.system_draw(memberName=self.baseData.username, memberId=self.baseData.memberId) dictResp = json.loads(resp) data = dictResp['data'] self.assertTrue(data)
def test_查看会员注单统计(self): Pylog.info("【运营分析-会员注单统计-查看会员注单统计】") resp = self.statistics.levelStatistics_member_list(levelIds=None, lotteryIds=None) dictResp = json.loads(resp) totalSize = dictResp['data']['totalSize'] self.assertGreater(totalSize, 0)
def test_白名单停启用(self): Pylog.info("【参数配置-网站设定-白名单设定-白名单停启用】") resp = self.paramConfig.whiteips_updateStatus( id=self.baseData.whiteipID, status=self.baseData.whiteipStatus) dictResp = json.loads(resp) err = dictResp['err'] self.assertEqual("SUCCESS", err)
def test_收款配置停启用(self): Pylog.info("【参数配置-收款方式-收款配置-收款配置停启用】") resp = self.paramConfig.receipt_editstatus( id=self.baseData.receiptID, status=self.baseData.receiptStatus) dictResp = json.loads(resp) err = dictResp['err'] self.assertEqual("SUCCESS", err)
def test_代理退佣统计搜索(self): Pylog.info("【统计查询-代理退佣统计-代理退佣统计搜索】") resp = self.statics.r_com_stat_list( pcode=self.baseData.agentPeriodPcode) dictResp = json.loads(resp) totalSize = dictResp['data']['totalSize'] self.assertGreater(totalSize, 0)
def test_002_冻结解冻账号(self): Pylog.info("【账号管理-快速检测-冻结解冻账号】") resp = self.uaa.member_statusChange(memberID=self.baseData.memberId, status=self.baseData.memberStatus) dictResp = json.loads(resp) data = dictResp['data'] self.assertGreater(data, 0)
def test_玩法盈亏明细(self): Pylog.info("【统计查询-游戏统计报表-玩法盈亏明细】") resp = self.statics.gainlost_details(pCode=self.baseData.gainlostPcode, pDate=None, lotteryId=2) dictResp = json.loads(resp) totalSize = dictResp['data']['totalSize'] self.assertGreater(totalSize, 0)
def test_更改层级(self): Pylog.info("【账号管理-快速检测-更改层级】") resp = self.uaa.member_levelChange( memberID=self.baseData.memberId, memberLevelId=self.baseData.finalMemberLevelID) dictResp = json.loads(resp) data = dictResp['data'] self.assertGreater(data, 0)
def test_出入款账目汇总_公司入款详情查询(self): Pylog.info("【资金管理-出入款账目汇总-出入款账目汇总_公司入款详情查询】") resp = self.payment.offline_detail(endTime=None, startTime=None, cardNo=self.baseData.cardNo) dictResp = json.loads(resp) totalSize = dictResp['data']['totalSize'] self.assertGreater(totalSize, 0)
def r_com_stat_list(self, agentName='default', pcode=81): '''代理退佣统计搜索''' url = "http://" + self.host + self.auth.config.api["owner"][ "r_com_stat_list"] datas = {"agentName": agentName, "page": 1, "pcode": pcode, "rows": 15} resp = requests.get(url=url, headers=self.headers, params=datas) Pylog.debug("【代理退佣统计搜索-request】" + str(datas)) Pylog.info("【代理退佣统计搜索-resp】" + str(resp.text)) return str(resp.text)
def test_查看会员优惠详情(self): Pylog.info("【运营分析-会员优惠统计-查看会员优惠详情】") resp = self.statistics.member_list(endTime=1519833599000, startTime=1517414400000, actionType=None, memberName=None) dictResp = json.loads(resp) totalSize = dictResp['data']['totalSize'] self.assertGreater(totalSize, 0)
def test_出入款账目汇总_会员出款详情查询(self): Pylog.info("【资金管理-出入款账目汇总-出入款账目汇总_会员出款详情查询】") resp = self.payment.draw_detail( endTime=None, startTime=None, memberName=self.baseData.memberNameForDraw) dictResp = json.loads(resp) totalSize = dictResp['data']['totalSize'] self.assertGreater(totalSize, 0)
def test_修改角色(self): Pylog.info("【参数配置-网站设定-权限管理-修改角色】") resp = self.paramConfig.role_update( roleName=self.baseData.roleName, description=self.baseData.roleDescription, resIds=self.baseData.resIds, roleId=self.baseData.roleId) dictResp = json.loads(resp) err = dictResp['err'] self.assertEqual("SUCCESS", err)
def test_出入款账目汇总_线上入款详情查询(self): Pylog.info("【资金管理-出入款账目汇总-出入款账目汇总_线上入款详情查询】") resp = self.payment.online_detail( endTime=None, startTime=None, merchantNo=self.baseData.merchantNo, merchantName=self.baseData.merchantName) dictResp = json.loads(resp) totalSize = dictResp['data']['totalSize'] self.assertGreater(totalSize, 0)
def test_修改会员信息(self): Pylog.info("【账号管理-快速检测-修改会员信息】") resp = self.uaa.member_chgInfo(memberId=self.baseData.memberId, email=self.baseData.email, wechat=self.baseData.wechat, qq=self.baseData.qq, realName=self.baseData.realName) dictResp = json.loads(resp) data = dictResp['data'] self.assertGreater(data, 0)
def test_修改会员银行信息(self): Pylog.info("【账号管理-快速检测-修改会员银行信息】") resp = self.uaa.bank_update(memberId=self.baseData.memberId, bankCard=self.baseData.bankCard, bankAddress=self.baseData.bankAddress, realName=self.baseData.realName, bankName=self.baseData.bankName) dictResp = json.loads(resp) err = dictResp['err'] self.assertEqual("SUCCESS", err)
def normal(self, jsondata): Pylog.info("".join(jsondata.keys()) + ": 开始测试") for k, v in jsondata.items(): url = "http://" + config.get_config("normal", "url") + v["url"] method = v["method"] data = v["data"] self.reps = self.httpRequest.post( url=url, data=data) if method == "POST" else self.httpRequest.get( url=url, data=data) Pylog.debug("Request Body:" + str(self.reps.request.body)) Pylog.debug("Response:" + self.reps.text)
def verify_2(self, data): Pylog.info(list(data.keys())[0]) game_id = list(data.keys())[0] game_url = data[game_id] self.httpRequest.headers = { "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", "Authorization": "MAuth-870fc3d727723a7410d2c0fa15154072cdb9300e9a54f89e09b9a27d32f852a44fd07348ae46208298303f281bcdc9a9079fa0b79310115038b4071b44edbe42-MAuth", "X-APP-ID": "20" } self.reps = self.httpRequest.get(url=game_url) Pylog.debug("Request Body:" + str(self.reps.request.body))
def test_代理新增_搜索_停启用_密码重置_修改信息(self): Pylog.info("【账号管理-代理列表-代理新增_搜索_停启用_密码重置_修改信息】") resp = self.ownerAction.agent( agentAccount=self.baseData.name, memberLevelId=self.baseData.memberLevelId, retirementId=self.baseData.retirementId, administrativeId=self.baseData.administrativeId, feePlanId=self.baseData.feePlanId, registerDiscountId=self.baseData.registerDiscountId) dictResp = json.loads(resp) data = dictResp['data'] self.assertGreater(data, 0)
def get_connect(self, db): try: Pylog.info("开始连接数据库...") conn = pymysql.connect(host=self.host, port=self.port, user=self.user, passwd=self.pwd, db=db) cur = conn.cursor() return [cur, conn] except Exception as err: Pylog.error('mysql连接错误:' + str(err))
def test_白名单修改(self): Pylog.info("【参数配置-网站设定-白名单设定-白名单修改】") resp = self.paramConfig.whiteips_edit( id=self.baseData.whiteipID, domain=self.baseData.whiteipDomain, ip=self.baseData.whiteipIP) dictResp = json.loads(resp) try: err = dictResp['err'] except KeyError: err = "FAIL" self.assertEqual("SUCCESS", err)
def test_公司入款账号停启用(self): Pylog.info("【参数配置-收款方式-公司入款账号设定-公司入款账号停启用】") if self.baseData.incomeIdStatus == 0: resp = self.paramConfig.income_status(id=self.baseData.incomeID, status=1) elif self.baseData.incomeIdStatus == 1: resp = self.paramConfig.income_status(id=self.baseData.incomeID, status=0) resp = self.paramConfig.income_status( id=self.baseData.incomeID, status=self.baseData.incomeIdStatus) dictResp = json.loads(resp) err = dictResp['err'] self.assertEqual("SUCCESS", err)
def backwater_stats(self, endTime=1519833599000, startTime=1517414400000): '''会员返水统计搜索''' url = "http://" + self.host + self.auth.config.api["owner"][ "backwater_stats"] datas = { "page": 1, "rows": 15, "endTime": endTime, "startTime": startTime } resp = requests.get(url=url, headers=self.headers, params=datas) Pylog.debug("【会员返水统计搜索-request】" + str(datas)) Pylog.info("【会员返水统计搜索-resp】" + str(resp.text)) return str(resp.text)
def gainlost_details(self, pCode=20180201002, pDate=20180201, lotteryId=2): '''玩法盈亏明细''' url = "http://" + self.host + self.auth.config.api["owner"][ "gainlost_details"] datas = { "page": 1, "rows": 15, "lotteryId": lotteryId, "pCode": pCode, "pDate": pDate } resp = requests.get(url=url, headers=self.headers, params=datas) Pylog.debug("【玩法盈亏明细-request】" + str(datas)) Pylog.info("【玩法盈亏明细-resp】" + str(resp.text)) return str(resp.text)
def test_搜索会员返水列表(self): Pylog.info("【资金管理-会员返水管理-搜索会员返水列表】") resp = self.payment.mem_cash_back_details() dictResp = json.loads(resp) totalSize1 = dictResp['data']['totalSize'] # 获取今日方案记录 resp = self.order.order_todaylist() dictResp = json.loads(resp) totalSize2 = dictResp['data']['totalSize'] if totalSize2 == 0: self.assertEqual(totalSize1, 0) else: self.assertGreater(totalSize1, 0)