def userOrderListByStatus(self, status=""): jsonheart = transUopHttpHears(self.memberId, self.openid) self.userOrderUrl = self.userOrderUrl % status print("jsonheart=%s,personalCenterUrl=%s" % (jsonheart, self.userOrderUrl)) orderlistrspjson = requests.get(url=self.userOrderUrl, headers=jsonheart, verify=False) return orderlistrspjson
def userSignupActivities(self): jsonheart = transUopHttpHears(self.memberId, self.openid) userSignupActivitiesjson = transUserBigWheelHttpJson( self.memberId, self.activitiesId) userBigWheelResultJson = requests.post(self.userBigWheelurl, json=userSignupActivitiesjson, headers=jsonheart) return userBigWheelResultJson
def userSignupActivities(self): jsonheart = transUopHttpHears(self.memberId, self.openid) activityrspjson = requests.get(url=self.defaultAddress, headers=jsonheart) useraddressid = parseMemberDefalutAddJSON(activityrspjson) userSignupActivitiesjson = transUserSignupActivitiesHttpJson( self.memberId, self.activitiesId, useraddressid) userSignUpResultJson = requests.post(self.userSignupActivitiesurl, json=userSignupActivitiesjson, headers=jsonheart) return userSignUpResultJson
def userBigWheelAward(self, orderId): ''' orderId : 大转盘抽奖动作中奖后返回的json数据中的orderId ''' jsonheart = transUopHttpHears(self.memberId, self.openid) useraddrspjson = requests.get(url=self.defaultAddress, headers=jsonheart) useraddressid = parseMemberDefalutAddJSON(useraddrspjson) awardJson = transUserAwardHttpJson(orderId, useraddressid) awardResultjson = requests.post(url=awaredurl, json=awardJson, headers=jsonheart) return awardResultjson
def homepageget(self): inputdata = self.getInputData() #请求头数据 jsonheart = transUopHttpHears(inputdata['memberId'],inputdata['openid']) #请求首页 homeresponse = requests.get(url=self.homeurl,headers = jsonheart) #验证格式正确行 self.assertTrue(checkHomepageFormat(homeresponse), "") #验证返回 rspcode = getHomeRspCode(homeresponse) self.assertEqual(getHomeRspCode(homeresponse) ,"200", "code not 200 and code= %s" % rspcode) self.assertTrue(checkHomepageFormat(homeresponse), "json格式不正确") self.assertTrue(1<2, self.getInputData())
def getActivitiesByID(self): jsonheart = transUopHttpHears(self.memberId, self.openid) activityrspjson = requests.get(url=self.userBigWheelurl, headers=jsonheart) return activityrspjson
def personalCenter(self): jsonheart = transUopHttpHears(self.memberId,self.openid) print("jsonheart=%s,personalCenterUrl=%s" % (jsonheart,self.personalCenterUrl)) activityrspjson = requests.get(url=self.personalCenterUrl,headers = jsonheart,verify=False) return activityrspjson
def getUserDefaltAddressJson(self): jsonheart = transUopHttpHears(self.memberId, self.openid) useraddrspjson = requests.get(url=self.defaultAddress, headers=jsonheart) return useraddrspjson
def getActivitiesById(self): jsonheart = transUopHttpHears(self.memberId, self.openid) activityrspjson = requests.get(url=self.defaultAddress, headers=jsonheart) return activityrspjson