def test_1_oneDragon(self): # -------------------------首页信息查询(带token和userNo)------------------------------ urlStr = consts.getEnviron(self.ENV) + consts.APPL_SUMMARY_QUERY paramIn = Gatlin.packApplSummaryQueryParam() paramIn['userNo'] = self.context['userNo'] # 取上下文的userNo,下同 paramIn['token'] = self.context['token'] Gatlin.printParam(json.dumps(paramIn)) self.ret = json.loads(Gatlin.myJsonPost(urlStr, paramIn).text)
def test_6_registerOnly(self): # -------------------------手机号注册,返回token------------------------------ urlStr = consts.getEnviron(self.ENV) + consts.REGISTER res = myJsonPost(urlStr, packRegisterParam()) self.ret = res.text retJson = json.loads(self.ret) token = retJson['data']['token'] print("Fetch Register Token", token)
def test_2_oneDragon(self): # -------------------------首页信息查询(带token和userNo)------------------------------ urlStr = consts.getEnviron(self.ENV) + consts.REFUND_RECORD_QUERY paramIn = packRefundRecordQueryParam() paramIn['userNo'] = self.context['userNo'] # 取上下文的userNo,下同 paramIn['token'] = self.context['token'] Gatlin.printParam(paramIn) self.ret = json.loads(Gatlin.myJsonPost(urlStr, paramIn).text)
def call_out(self): GLOBAL_ENV = self.context['environ'] if "mock" in GLOBAL_ENV and GLOBAL_ENV["mock"]: # mock开关打开 return ENV = self.context['environ']['env'] METHOD = self.context['environ']['nodeName'] url_str = consts.getEnviron(ENV) + consts.getMethod(METHOD) res = Gatlin.myJsonPost(url_str, self.context['request']) self.context['response'] = json.loads(res.text)
def test_8_oneDragon(self): # -------------------------一条龙------------------------------ urlStr = consts.getEnviron(self.ENV) + consts.LOGIN res = myJsonPost(urlStr, packLoginParam()) self.ret = res.text printReturn(self.ret) retJson = json.loads(self.ret) token = retJson['data']['token'] # 更新token userNo = retJson['data']['userNo'] # 获得userNo self.context['token'] = token # 放入上下文 self.context['userNo'] = userNo # -------------------------首页信息查询(带token和userNo)------------------------------ urlStr = consts.getEnviron(self.ENV) + consts.APPL_SUMMARY_QUERY param = packApplSummaryQueryParam() param['userNo'] = self.context['userNo'] # 取上下文的token,下同 param['token'] = self.context['token'] res = myJsonPost(urlStr, param) self.ret = res.text
def test_7_loginOnly(self): # -------------------------手机号登录,返回token------------------------------ urlStr = consts.getEnviron(self.ENV) + consts.LOGIN res = myJsonPost(urlStr, packLoginParam()) self.ret = res.text retJson = json.loads(self.ret) token = retJson['data']['token'] self.context['token'] = token # token放入上下文 print("Fetch LOGIN Token", token)
def test_3_oneDragon(self): # -------------------------补件信息查询(带token和userNo)------------------------------ urlStr = consts.getEnviron(self.ENV) + consts.SUPPLEMENT_LIST_QUERY paramIn = packSupplementlistQWueryParam() paramIn['userNo'] = self.context['userNo'] # 取上下文的userNo,下同 paramIn['token'] = self.context['token'] paramIn['custNo'] = self.context['custNo'] Gatlin.printParam(paramIn) self.ret = json.loads(Gatlin.myJsonPost(urlStr, paramIn).text)
def myInit(self): print('STARTING...') self.ENV = self.paramIn['environ'] security.init(self.ENV) # 初始化加密的公私钥 self.context = {} # 初始化上下文 loginPrepare = packLoginParam(self.paramIn) urlStr = consts.getEnviron(self.ENV) + consts.LOGIN res = Gatlin.myJsonPost(urlStr, loginPrepare) retJson = json.loads(res.text) token = retJson['data']['token'] userNo = retJson['data']['userNo'] # 获得userNo print("Fetch LOGIN Token", token) self.context['token'] = token # token放入上下文 self.context['userNo'] = userNo # userNo放入上下文 self.curMethod = "biz1"
def myInit(self): print('STARTING...') self.ENV = self.paramIn['env'] security.init(self.ENV) # 初始化加密的公私钥 self.context = {} # 初始化上下文 regPrepare = packRegisterParam(self.paramIn) print(regPrepare) urlStr = consts.getEnviron(self.ENV) + consts.REGISTER res = Gatlin.myJsonPost(urlStr, regPrepare) retJson = json.loads(res.text) print(retJson) token = retJson['data']['token'] userNo = retJson['data']['userNo'] # 获得userNo print("Fetch REGISTER Token", token) self.context['token'] = token # token放入上下文 self.context['userNo'] = userNo # userNo放入上下文 self.curMethod = "biz4"
def setUpClass(self): print('STARTING...') self.ENV = "PH_DEV" # ~~~~~~~~~~~~~~~~~~~~~~这里改环境!!!~~~~~~~~~~~~~~~~~~~~~~ security.init(self.ENV) # 初始化加密的公私钥 self.context = {} # 初始化上下文 loginPrepare = packLoginParam( '+6308062400111', b'123456') # ~~~~~~~~~~~~~~~~~~~~~~这里改用户!!!~~~~~~~~~~~~~~~~~~~~~~ urlStr = consts.getEnviron(self.ENV) + consts.LOGIN res = Gatlin.myJsonPost(urlStr, loginPrepare) retJson = json.loads(res.text) Gatlin.get_pretty_print(retJson) token = retJson['data']['token'] userNo = retJson['data']['userNo'] # 获得userNo mobileNo = retJson['data']['mobileNo'] # 获得mobileNo custNo = retJson['data']['custNo'] # 获得mobileNo print("Fetch LOGIN Token", token) self.context['token'] = token # token放入上下文 self.context['userNo'] = userNo # userNo放入上下文 self.context['mobileNo'] = mobileNo # userNo放入上下文 self.context['custNo'] = custNo # userNo放入上下文
def test_5_applSummaryQuery(self): # -------------------------首页信息查询------------------------------ urlStr = consts.getEnviron(self.ENV) + consts.APPL_SUMMARY_QUERY res = myJsonPost(urlStr, packApplSummaryQueryParam()) self.ret = res.text
def test_4_webSendSms(self): # -------------------------WEB发送验证码---------------------------- urlStr = consts.getEnviron(self.ENV) + consts.MCMSG_QUERY res = myJsonPost(urlStr, packSmsSendParam()) self.ret = res.text
def test_3_mcMsgQuery(self): # -------------------------消息中心列表查询--------------------------- urlStr = consts.getEnviron(self.ENV) + consts.MCMSG_QUERY res = myJsonPost(urlStr, packMcMsgQueryParam()) self.ret = res.text
def test_2_mcMsgCount(self): # -------------------------消息中心消息数----------------------------- urlStr = consts.getEnviron(self.ENV) + consts.MCMSG_COUNTNEW res = myJsonPost(urlStr, packMcMsgCountNewParam()) self.ret = res.text
def test_1_preQuery(self): # -------------------------登录前预校验------------------------------ urlStr = consts.getEnviron(self.ENV) + consts.PREQUERY res = myJsonPost(urlStr, packPreQueryParam()) self.ret = res.text
def refundRecordQuery(self): refundPrepare = packRefundRecordQueryParam(self.paramIn) urlStr = consts.getEnviron(self.ENV) + consts.REFUND_RECORD_QUERY self.ret = Gatlin.myJsonPost(urlStr, refundPrepare).text