*** Settings *** Documentation 查看代卖订单(数据对比) Library RequestsLibrary Library Collections Library DateTime Library RedisLibrary Library urllib3 *** Variables *** ${header} {'content-type':'application/json','X-APP-ID':'470236309865238528'} ${url} http://api-client-ztb-test.qniao.cn *** Test Cases *** userlogin [Setup] #验证码登录 #${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Create Session ZTBT http://api-client-uec-test.qniao.cn ${header} ${data} Create Dictionary account=15014242835 captcha=888888 accountType=2 ${respones} POST On Session ZTBT /uec/authorize/by-captcha json=${data} log ${respones.status_code} log ${respones.json()} ${token} Get From Dictionary ${respones.json()["data"]} token #log ${respones.json()["data"]["token"]} Set Global Variable ${token} [Teardown] login-token #${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Create Session ZTBT ${url} ${header} ${token1} Create Dictionary loginToken=${token} ${reps} Post On Session ZTBT recycle-user-center/authorize/get/product-line-token/by/login-token json=${token1} ${gettoken} Get From Dictionary ${reps.json()["data"]} token #获取token ${userId} Get From Dictionary ${reps.json()["data"]} userId #获取用户id log ${reps.json()["data"]["token"]} Set Global Variable ${gettoken} Set Global Variable ${userId} get_proxy-order-list #获取代卖订单列表 ${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=QNT ${gettoken} Create Session ZTBT http://api-client-ztb-test.qniao.cn ${header} ${reps} Get On Session ZTBT recycle-service/proxy-sell/get/proxy-order-list params=status=&pageNum=1&pageSize=15 ${orderId} Get From Dictionary ${reps.json()["data"]["records"][0]} orderId #获取代卖订单编号 Set Global Variable ${orderId} get_proxy-order_details #获取代卖订单详情 ${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=QNT ${gettoken} Create Session ZTBT http://api-client-ztb-test.qniao.cn ${header} ${reps} Get On Session ZTBT recycle-service/proxy-sell/get/proxy-order/${orderId} ${data} Get From Dictionary ${reps.json()} data ${data_value} Set Variable #Run Keyword If '${orderId}' in ${data} Log To Console ${data} Should Be Equal ${data} ${data_value}