diff --git a/0-Database.robot b/0-Database.robot old mode 100644 new mode 100755 diff --git a/1-Client(Test)/1-APPlogin(Test).robot b/1-Client(Test)/1-APPlogin(Test).robot old mode 100644 new mode 100755 diff --git a/1-Client(Test)/1-APPlogin(master).robot b/1-Client(Test)/1-APPlogin(master).robot new file mode 100644 index 0000000..34e23ba --- /dev/null +++ b/1-Client(Test)/1-APPlogin(master).robot @@ -0,0 +1,64 @@ +*** Settings *** +Suite Setup +Library RequestsLibrary +Library Collections +Library urllib3 +Library DatabaseLibrary + +*** Variables *** +${header} {'content-type':'application/json','X-APP-ID':'470236309865238528'} +${url} http://api-client-ztb.qniao.cn + +*** Test Cases *** +Get_verification-code + #获取验证码 + Disable Warnings + ${headers} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 + Create Session ZTBT https://api-client-uec.qniao.cn ${headers} + ${value} Set Variable {"verifiableAccount":"13168550964","verifiableAccountType":1,"purpose":1} + ${reps} Post On Session ZTBT uec/get/auth-captcha ${value.encode('utf-8')} + log ${reps.json()} + sleep 5 + +Connect to database + #正式环境数据库获取验证码 + Connect To Database Using Custom Params pymysql database='user_enterprise_center', host='rm-wz9it4fs5tk7n4tm1zo.mysql.rds.aliyuncs.com', user='uec_root', password='@qniaouecroot88', port=3306 #连接uec数据库 + ${Verification Code1} Query SELECT code FROM user_enterprise_center.qn_captcha WHERE verifiable_account LIKE '%13168550964%' ORDER BY id DESC LIMIT 0,1 + ${text_code} Set Variable ${Verification Code1[0][0]} + Set Global Variable ${text_code} + Disconnect From Database + +userlogin + [Setup] + #验证码登录 + Create Session ZTBT https://api-client-uec.qniao.cn ${header} + #${data} Create Dictionary account=13168550964 captcha=${text_code} accountType=2 + ${data} Set Variable {"accountType":2,"password":null,"account":"13168550964","captcha":"${text_code}"} + ${respones} POST On Session ZTBT uec/authorize/by-captcha ${data.encode('utf-8')} + 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} + +getuserinfo + #获取用户信息 + ${header} Create Dictionary content-type=application/json X-APP-ID=470236309865238528 Authorization=${gettoken} + Create Session baseinfo ${url} ${header} + ${reps} Get On Session baseinfo recycle-service/user/get/base-info + ${realName} Get From Dictionary ${reps.json()["data"]} realName #获取实名 + ${userId} Get From Dictionary ${reps.json()["data"]} userId #获取用户id + Set Global Variable ${realName} + Set Global Variable ${userId} diff --git a/1-Client(Test)/2.1-CreateRegularorder.robot b/1-Client(Test)/2.1-CreateRegularorder.robot old mode 100644 new mode 100755 diff --git a/1-Client(Test)/2.2createActiveorder-1.robot b/1-Client(Test)/2.2createActiveorder-1.robot old mode 100644 new mode 100755 diff --git a/1-Client(Test)/2.3createActiveorder-2.robot b/1-Client(Test)/2.3createActiveorder-2.robot old mode 100644 new mode 100755 diff --git a/1-Client(Test)/3-Withdrawal_application.robot b/1-Client(Test)/3-Withdrawal_application.robot old mode 100644 new mode 100755 diff --git a/1-Client(Test)/3.1-Automatic withdrawal.robot b/1-Client(Test)/3.1-Automatic withdrawal.robot old mode 100644 new mode 100755 diff --git a/1-Client(Test)/4-Real name authentication.robot b/1-Client(Test)/4-Real name authentication.robot old mode 100644 new mode 100755 diff --git a/1-Client(Test)/5-Add_bank_card.robot b/1-Client(Test)/5-Add_bank_card.robot old mode 100644 new mode 100755 diff --git a/1-Client(Test)/6-Enterprise_certification.robot b/1-Client(Test)/6-Enterprise_certification.robot old mode 100644 new mode 100755 diff --git a/1-Client(Test)/7-Consignment_order.robot b/1-Client(Test)/7-Consignment_order.robot old mode 100644 new mode 100755 diff --git a/1-Client(Test)/__init__.robot b/1-Client(Test)/__init__.robot old mode 100644 new mode 100755 diff --git a/1-Client(Test)/factory.robot b/1-Client(Test)/factory.robot new file mode 100644 index 0000000..b84d49a --- /dev/null +++ b/1-Client(Test)/factory.robot @@ -0,0 +1,28 @@ +*** Settings *** +Library RequestsLibrary +Library Collections + +*** Variables *** +${header} {'Content-Type': 'application/json','X-APP-ID':'503258978847953924'} + +*** Test Cases *** +login + ${header} Create Dictionary Content-Type=application/json X-APP-ID=503258978847953924 + Create Session ZTBF http://api-client-uec-test.qniao.cn ${header} + ${data} Create Dictionary account=13517986787 captcha=888888 accountType=2 + log ${data} + #${data} Set Variable {"account":"13517986787","accountType":2,"captcha":"888888","signType":1,"sign":"c2d5ef09b96575e04503461af4bc7044","signStr":"{\"account\":\"13517986787\",\"accountType\":2,\"captcha\":\"888888\",\"signType\":1}"} + ${respones} POST On Session ZTBF /uec/authorize/by-captcha json=${data} + ${gettoken} Get From Dictionary ${respones.json()["data"]} token + Set Global Variable ${gettoken} + +login-token + ${header} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847953924 Authorization=QNT ${gettoken} + Create Session ZTB http://api-client-ztb-test.qniao.cn ${header} + ${data} Set Variable {"loginToken":"${gettoken}"} + ${respones} POST On Session ZTB recycle-user-center/authorize/get/product-line-token/by/login-token ${data} + +员工管理 + ${header} Create Dictionary X-APP-ID=503258978847953924 X-FACTORY-ID=615992051053498368 Authorization=QNT ${gettoken} + Create Session ZTBF http://api-client-ztb-test.qniao.cn ${header} + ${reps} Get On Session ZTBF recycle-user-center/get/self-department-role-list diff --git a/1-Client(Test)/log.html b/1-Client(Test)/log.html new file mode 100755 index 0000000..a767195 --- /dev/null +++ b/1-Client(Test)/log.html @@ -0,0 +1,2192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Opening Robot Framework log failed

+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/1-Client(Test)/output.xml b/1-Client(Test)/output.xml new file mode 100755 index 0000000..f0ff275 --- /dev/null +++ b/1-Client(Test)/output.xml @@ -0,0 +1,335 @@ + + + + + +ZTBT +${url} +${headers} +Create Session: create a HTTP session to a server +Variable '${headers}' not found. + + + +${repsponse} +ZTBT +recycle-service/proxy-sell-activity/list +params=pageNum=1&pageSize=15 +Sends a GET request on a previously created HTTP Session. + + + +${records} +${repsponse.json()["data"]} +records +Returns a value from the given ``dictionary`` based on the given ``key``. + + + +${item} +@{records} + +${item} + +${activityName} +${item} +activityName +Returns a value from the given ``dictionary`` based on the given ``key``. + + + +${paperCategoryList} +${item} +paperCategoryList +Returns a value from the given ``dictionary`` based on the given ``key``. + + + +${paperMillId} +${item} +paperMillId +Returns a value from the given ``dictionary`` based on the given ``key``. + + + +${activityId} +${item} +activityId +Returns a value from the given ``dictionary`` based on the given ``key``. + + + +'${activityName}'=='无账期活动一次' +Stops executing the enclosing for loop if the ``condition`` is true. + + + + + + + +${Category_value} +random.choice(${paperCategoryList}) +random +Evaluates the given expression in Python and returns the result. + + + +\nvalue: ${Category_value} +Logs the given message to the console. + + + +${categoryId} +${Category_value} +categoryId +Returns a value from the given ``dictionary`` based on the given ``key``. + + + +${categoryName} +${Category_value} +categoryName +Returns a value from the given ``dictionary`` based on the given ``key``. + + + +${unitPrice} +${Category_value} +unitPrice +Returns a value from the given ``dictionary`` based on the given ``key``. + + + +${paperMillId} +Makes a variable available globally in all tests and suites. + + + +${activityId} +Makes a variable available globally in all tests and suites. + + + +${categoryId} +Makes a variable available globally in all tests and suites. + + + +${categoryName} +Makes a variable available globally in all tests and suites. + + + +${unitPrice} +Makes a variable available globally in all tests and suites. + + +Variable '${headers}' not found. + + + +get-carinfo +${url} +${headers} +Create Session: create a HTTP session to a server +Variable '${headers}' not found. + + + +${reps} +get-carinfo +recycle-service/proxy-sell/get/his-car-info +Sends a GET request on a previously created HTTP Session. + + + +${reps.json()} +Logs the given message with the given level. + + + +${carNumber} +${reps.json()["data"]} +records +Returns a value from the given ``dictionary`` based on the given ``key``. + + + +${plateNumber_value} +random.sample(${carNumber},1) +random +Evaluates the given expression in Python and returns the result. + + + +\nvalue:${plateNumber_value} +Logs the given message to the console. + + + +${plateNumber1} +${plateNumber_value[0]} +plateNumber +Returns a value from the given ``dictionary`` based on the given ``key``. + + + +${plateNumber1} +Makes a variable available globally in all tests and suites. + + +Variable '${headers}' not found. + + + +ZTBT +${url} +${headers} +Create Session: create a HTTP session to a server +Variable '${headers}' not found. + + + +${reps} +ZTBT +recycle-service/get/paper-mill-paper-category-price-details/${paperMillId} +Sends a GET request on a previously created HTTP Session. + + + +${reps.json()} +Logs the given message with the given level. + + +Variable '${headers}' not found. + + + +ZTBT +${url} +${headers} +Create Session: create a HTTP session to a server +Variable '${headers}' not found. + + + +${reps} +ZTBT +recycle-service/proxy-sell/get/relation +Sends a GET request on a previously created HTTP Session. + + + +${bizUserId} +${reps.json()["data"]} +bizUserId +Returns a value from the given ``dictionary`` based on the given ``key``. + + + +${cusormerId} +${reps.json()["data"]} +cusormerId +Returns a value from the given ``dictionary`` based on the given ``key``. + + + +${customerName} +${reps.json()["data"]} +customerName +Returns a value from the given ``dictionary`` based on the given ``key``. + + + +${bizUserId} +Makes a variable available globally in all tests and suites. + + + +${cusormerId} +Makes a variable available globally in all tests and suites. + + + +${customerName} +Makes a variable available globally in all tests and suites. + + +Variable '${headers}' not found. + + + +ZTBT +${url} +${headers} +Create Session: create a HTTP session to a server +Variable '${headers}' not found. + + + +${datatime} +result_format=%Y-%m-%d +Returns current local or UTC time with an optional increment. + + + +${order_data} +{ \ \ \ \ "paperCategoryId":"${categoryId}", \ \ \ \ "unitPrice":"${unitPrice}", \ \ \ \ "totalEstimatedWeight":30000, \ \ \ \ "activityId":"${activityId}", \ \ \ \ "customerName":"${customerName}", \ \ \ \ "deliveryTime":"${datatime}", \ \ \ \ "carInfos":[ \ \ \ \ \ \ \ \ { \ \ \ \ \ \ \ \ \ \ \ \ "plateNumber":"${plateNumber1}" \ \ \ \ \ \ \ \ } \ \ \ \ ] } +Returns the given values which can then be assigned to a variables. + + + +${reps} +ZTBT +recycle-service/proxy-sell/create/order +${order_data.encode('utf-8')} +Sends a POST request on a previously created HTTP Session. + + + +${reps.json()} +Logs the given message with the given level. + + + +${orderId} +${reps.json()["data"]} +orderId +Returns a value from the given ``dictionary`` based on the given ``key``. + + + +${reps.json()["message"]} +successful +Fails if objects are unequal after converting them to strings. + + + +${orderId} +Makes a variable available globally in all tests and suites. + + + +${datatime} +Makes a variable available globally in all tests and suites. + + +Variable '${headers}' not found. + + + + + +All Tests + + + + +2.2createActiveorder-1 + + + +Error in file '/root/ztb-trading-rf-api/ztb-trading-rf-api/1-Client(Test)/2.2createActiveorder-1.robot' on line 8: Setting variable '${headers}' failed: Variable '${gettoken}' not found. + + diff --git a/1-Client(Test)/report.html b/1-Client(Test)/report.html new file mode 100755 index 0000000..cf9d1a3 --- /dev/null +++ b/1-Client(Test)/report.html @@ -0,0 +1,2461 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Opening Robot Framework report failed

+ +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/2-Background_system(Test)/1-WebLogin/weblogin.robot b/2-Background_system(Test)/1-WebLogin/weblogin.robot old mode 100644 new mode 100755 diff --git a/2-Background_system(Test)/1.1-New_PaperMill/New_paper_mill.robot b/2-Background_system(Test)/1.1-New_PaperMill/New_paper_mill.robot old mode 100644 new mode 100755 diff --git a/2-Background_system(Test)/1.2-enterprise_management/__init__.robot b/2-Background_system(Test)/1.2-enterprise_management/__init__.robot old mode 100644 new mode 100755 diff --git a/2-Background_system(Test)/1.2-enterprise_management/__init__.txt b/2-Background_system(Test)/1.2-enterprise_management/__init__.txt old mode 100644 new mode 100755 diff --git a/2-Background_system(Test)/1.2-enterprise_management/enterprise-management.robot b/2-Background_system(Test)/1.2-enterprise_management/enterprise-management.robot old mode 100644 new mode 100755 diff --git a/2-Background_system(Test)/1.3-operation management/contract.robot b/2-Background_system(Test)/1.3-operation management/contract.robot old mode 100644 new mode 100755 diff --git a/2-Background_system(Test)/1.4-Consignment activities/Consignment_activities.robot b/2-Background_system(Test)/1.4-Consignment activities/Consignment_activities.robot old mode 100644 new mode 100755 diff --git a/2-Background_system(Test)/2.1-Consignment management/1-appointment.robot b/2-Background_system(Test)/2.1-Consignment management/1-appointment.robot old mode 100644 new mode 100755 diff --git a/2-Background_system(Test)/2.1-Consignment management/2.1-RegularUpload-weightnote.robot b/2-Background_system(Test)/2.1-Consignment management/2.1-RegularUpload-weightnote.robot old mode 100644 new mode 100755 diff --git a/2-Background_system(Test)/2.1-Consignment management/2.2-RegularUpload-weightnote-1.robot b/2-Background_system(Test)/2.1-Consignment management/2.2-RegularUpload-weightnote-1.robot old mode 100644 new mode 100755 diff --git a/2-Background_system(Test)/2.1-Consignment management/2.3-ActiveUpload-deliverynote.robot b/2-Background_system(Test)/2.1-Consignment management/2.3-ActiveUpload-deliverynote.robot old mode 100644 new mode 100755 diff --git a/2-Background_system(Test)/2.1-Consignment management/3.1-Operation_audit.robot b/2-Background_system(Test)/2.1-Consignment management/3.1-Operation_audit.robot old mode 100644 new mode 100755 diff --git a/2-Background_system(Test)/2.1-Consignment management/3.2-Operation_audit.robot b/2-Background_system(Test)/2.1-Consignment management/3.2-Operation_audit.robot old mode 100644 new mode 100755 diff --git a/2-Background_system(Test)/2.1-Consignment management/3.3-Operation_audit.robot b/2-Background_system(Test)/2.1-Consignment management/3.3-Operation_audit.robot old mode 100644 new mode 100755 diff --git a/2-Background_system(Test)/3-Withdrawal_application/4-Financial_audit.robot b/2-Background_system(Test)/3-Withdrawal_application/4-Financial_audit.robot old mode 100644 new mode 100755 diff --git a/2-Background_system(Test)/3-Withdrawal_application/5-Sales_receivables.robot b/2-Background_system(Test)/3-Withdrawal_application/5-Sales_receivables.robot old mode 100644 new mode 100755 diff --git a/2-Background_system(Test)/3-Withdrawal_application/Withdrawal application/1-Automatic_receipt.robot b/2-Background_system(Test)/3-Withdrawal_application/Withdrawal application/1-Automatic_receipt.robot old mode 100644 new mode 100755 diff --git a/2-Background_system(Test)/3-Withdrawal_application/Withdrawal application/2-Manual_receipt.robot b/2-Background_system(Test)/3-Withdrawal_application/Withdrawal application/2-Manual_receipt.robot old mode 100644 new mode 100755 diff --git a/2-Background_system(Test)/4-Consignment_management/2.3-ActiveUpload-weightnote.robot b/2-Background_system(Test)/4-Consignment_management/2.3-ActiveUpload-weightnote.robot old mode 100644 new mode 100755 diff --git a/2-Background_system(Test)/4-Consignment_management/3.3--Operation_audit.robot b/2-Background_system(Test)/4-Consignment_management/3.3--Operation_audit.robot old mode 100644 new mode 100755 diff --git a/2-Background_system(Test)/4-Consignment_management/4.3-Financial_audit.robot b/2-Background_system(Test)/4-Consignment_management/4.3-Financial_audit.robot old mode 100644 new mode 100755 diff --git a/2-Background_system(Test)/4-Consignment_management/5.3-sales_receivable.robot b/2-Background_system(Test)/4-Consignment_management/5.3-sales_receivable.robot old mode 100644 new mode 100755 diff --git a/2-Background_system(Test)/4-Consignment_management/__init__.robot b/2-Background_system(Test)/4-Consignment_management/__init__.robot old mode 100644 new mode 100755 diff --git a/2-Background_system(Test)/5-Data comparison/5-Consignment_order.robot b/2-Background_system(Test)/5-Data comparison/5-Consignment_order.robot old mode 100644 new mode 100755 diff --git a/2-Background_system(Test)/5-Data comparison/__init__.txt b/2-Background_system(Test)/5-Data comparison/__init__.txt old mode 100644 new mode 100755 diff --git a/__init__.robot b/__init__.robot old mode 100644 new mode 100755 diff --git a/log.html b/log.html old mode 100644 new mode 100755 diff --git a/output.xml b/output.xml old mode 100644 new mode 100755 diff --git a/report.html b/report.html old mode 100644 new mode 100755 diff --git a/样例/001.robot b/样例/001.robot old mode 100644 new mode 100755