6 changed files with 263 additions and 6 deletions
-
4__init__.robot
-
60login_get_info/login_customer.robot
-
16login_get_info/login_operate.robot
-
33login_get_info/login_operate_psc.robot
-
77login_get_info/login_supplier.robot
-
79login_get_info/login_supplier_focus.robot
@ -0,0 +1,33 @@ |
|||||
|
*** Settings *** |
||||
|
Library RequestsLibrary |
||||
|
Library Collections |
||||
|
Library urllib3 |
||||
|
|
||||
|
*** Variables *** |
||||
|
&{operation_psc_header} Content-Type=application/x-www-form-urlencoded X-APP-ID=503258978847965324 |
||||
|
|
||||
|
*** Test Cases *** |
||||
|
operate_mail |
||||
|
Disable Warnings |
||||
|
Create Session pscops https://api-ops-psc-test.qniao.cn headers=${operation_psc_header} |
||||
|
&{data} Create Dictionary username=liangjinman@qniao.cn password=qn123456 |
||||
|
${resp} POST On Session pscops /payment-settlement-center/admin/login ${data} |
||||
|
Log ${resp.status_code} |
||||
|
Log ${resp.text} |
||||
|
Log ${resp.json()} |
||||
|
Should Be Equal As Numbers 200 ${resp.status_code} |
||||
|
Should Be Equal As Strings 登陆成功 ${resp.json()["message"]} |
||||
|
${gettoken_operate_psc} get from Dictionary ${resp.headers} Authorization |
||||
|
log ${gettoken_operate_psc} |
||||
|
Set Global Variable ${gettoken_operate_psc} |
||||
|
&{operationpsc_header} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847965324 Authorization=${gettoken_operate_psc} |
||||
|
Set Suite Variable ${operationpsc_header} |
||||
|
|
||||
|
get_operate_userinfo |
||||
|
Create Session pscops https://api-ops-psc-test.qniao.cn headers=${operationpsc_header} |
||||
|
${response} Get On Session pscops /payment-settlement-center/admin/employee/get/login-info |
||||
|
log ${response.json()} |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
|
Should Be Equal As Strings 498985714734731264 ${response.json()["data"]["adminId"]} |
||||
|
Should Be Equal As Strings 管理员 ${response.json()["data"]["positionList"][0]["name"]} |
||||
@ -0,0 +1,77 @@ |
|||||
|
*** Settings *** |
||||
|
Library RequestsLibrary |
||||
|
Library Collections |
||||
|
Library urllib3 |
||||
|
|
||||
|
*** Variables *** |
||||
|
&{cloud_factory_supplier_header} Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847956666 |
||||
|
|
||||
|
*** Test Cases *** |
||||
|
supplier_phone |
||||
|
#去除警告 |
||||
|
Disable Warnings |
||||
|
#创建会话 会话别名 baseurl headers |
||||
|
Create Session uecclient https://api-client-uec-test.qniao.cn headers=${cloud_factory_supplier_header} |
||||
|
#变量名称 设置用例变量 变量值 |
||||
|
${body} Set Variable {"accountType":2,"account":"13849849646","captcha":"888888"} |
||||
|
#变量接收响应结果 post请求 会话别名 uri 传参 |
||||
|
${response} POST On Session uecclient /uec/authorize/by-captcha ${body} |
||||
|
#日志 |
||||
|
Log ${response.status_code} |
||||
|
#日志 |
||||
|
Log ${response.text} |
||||
|
#日志 |
||||
|
Log ${response.json()} |
||||
|
#断言数字 预期结果 实际结果 |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
#断言字符串 预期结果 实际结果 |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
|
#变量接收token 获取字典内容 响应结果 token-key |
||||
|
${gettoken_supplier} Get From Dictionary ${response.json()["data"] } token |
||||
|
#日志 |
||||
|
log ${gettoken_supplier} |
||||
|
#设置token变量 未转业务线 |
||||
|
Set Suite Variable ${gettoken_supplier} |
||||
|
#变量接收供应商userid 获取字典内容 响应结果 serid-key |
||||
|
${userid_supplier} Get From Dictionary ${response.json()["data"] } userId |
||||
|
#日志 |
||||
|
log ${userid_supplier} |
||||
|
#设置token变量 |
||||
|
Set Suite Variable ${userid_supplier} |
||||
|
#设置带token的请求头 |
||||
|
&{cloudfactorysupplierheader} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847956666 Authorization=${gettoken_supplier} |
||||
|
#设置token变量 |
||||
|
Set Suite Variable ${cloudfactorysupplierheader} |
||||
|
|
||||
|
supplier_login_token |
||||
|
Disable Warnings |
||||
|
Create Session yytclient https://api-client-yyt-test.qniao.cn headers=${cloudfactorysupplierheader} |
||||
|
${body} Set Variable {"loginToken":"${gettoken_supplier}"} |
||||
|
${response} POST On Session yytclient /cloud-print-user-center/authorize/get/product-line-token/by/login-token ${body.encode("utf8")} |
||||
|
Log ${response.status_code} |
||||
|
Log ${response.text} |
||||
|
Log ${response.json()} |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
|
${getlogintoken_supplier} Get From Dictionary ${response.json()} data |
||||
|
log ${getlogintoken_supplier} |
||||
|
#全局token |
||||
|
Set Global Variable ${getlogintoken_supplier} |
||||
|
&{cloudfactory_supplierheader} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847956666 Authorization=${getlogintoken_supplier} |
||||
|
Set Suite Variable ${cloudfactory_supplierheader} |
||||
|
|
||||
|
get_supplier_userinfo |
||||
|
Create Session uecclient http://api-client-uec-test.qniao.cn headers=${cloudfactory_supplierheader} |
||||
|
${response} Get On Session uecclient /uec/get/user-info |
||||
|
log ${response.json()} |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
|
Should Be Equal As Integers ${userid_supplier} ${response.json()["data"]["userId"]} |
||||
|
|
||||
|
get_supplier_baseinfo |
||||
|
Create Session yytclient https://api-client-yyt-test.qniao.cn headers=${cloudfactory_supplierheader} |
||||
|
${response} Get On Session yytclient cloud-print-user-center/get/base-info |
||||
|
log ${response.json()} |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
|
Should Be Equal As Integers 0 ${response.json()["data"]["employeeStatus"]} |
||||
@ -0,0 +1,79 @@ |
|||||
|
*** Settings *** |
||||
|
Library RequestsLibrary |
||||
|
Library Collections |
||||
|
Library urllib3 |
||||
|
|
||||
|
*** Variables *** |
||||
|
&{cloud_factory_supplier_focus_header} Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847956666 |
||||
|
|
||||
|
*** Test Cases *** |
||||
|
supplier_focus_phone |
||||
|
#去除警告 |
||||
|
Disable Warnings |
||||
|
#创建会话 会话别名 baseurl headers |
||||
|
Create Session uecclient https://api-client-uec-test.qniao.cn headers=${cloud_factory_supplier_focus_header} |
||||
|
#变量名称 设置用例变量 变量值 |
||||
|
${body} Set Variable {"accountType":2,"account":"18219557422","captcha":"888888"} |
||||
|
#变量接收响应结果 post请求 会话别名 uri 传参 |
||||
|
${response} POST On Session uecclient /uec/authorize/by-captcha ${body} |
||||
|
#日志 |
||||
|
Log ${response.status_code} |
||||
|
#日志 |
||||
|
Log ${response.text} |
||||
|
#日志 |
||||
|
Log ${response.json()} |
||||
|
#断言数字 预期结果 实际结果 |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
#断言字符串 预期结果 实际结果 |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
|
#变量接收token 获取字典内容 响应结果 token-key |
||||
|
${gettoken_supplier_focus} Get From Dictionary ${response.json()["data"] } token |
||||
|
#日志 |
||||
|
log ${gettoken_supplier_focus} |
||||
|
#设置token变量 未转业务线 |
||||
|
Set Suite Variable ${gettoken_supplier_focus} |
||||
|
#变量接收集采商userid 获取字典内容 响应结果 serid-key |
||||
|
${userid_supplier_focus} Get From Dictionary ${response.json()["data"] } userId |
||||
|
#日志 |
||||
|
log ${userid_supplier_focus} |
||||
|
#设置token变量 |
||||
|
Set Suite Variable ${userid_supplier_focus} |
||||
|
#设置带token的请求头 |
||||
|
&{cloudfactorysupplierfocusheader} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847956666 Authorization=${gettoken_supplier_focus} |
||||
|
#设置token变量 |
||||
|
Set Suite Variable ${cloudfactorysupplierfocusheader} |
||||
|
|
||||
|
supplier_focus_login_token |
||||
|
Disable Warnings |
||||
|
Create Session yytclient https://api-client-yyt-test.qniao.cn headers=${cloudfactorysupplierfocusheader} |
||||
|
${body} Set Variable {"loginToken":"${gettoken_supplier_focus}"} |
||||
|
${response} POST On Session yytclient /cloud-print-user-center/authorize/get/product-line-token/by/login-token ${body.encode("utf8")} |
||||
|
Log ${response.status_code} |
||||
|
Log ${response.text} |
||||
|
Log ${response.json()} |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
|
${getlogintoken_supplier_focus} Get From Dictionary ${response.json()} data |
||||
|
log ${getlogintoken_supplier_focus} |
||||
|
#全局token |
||||
|
Set Global Variable ${getlogintoken_supplier_focus} |
||||
|
&{cloudfactory_supplierfocusheader} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847956666 Authorization=${getlogintoken_supplier_focus} |
||||
|
Set Suite Variable ${cloudfactory_supplierfocusheader} |
||||
|
|
||||
|
get_supplier_focus_userinfo |
||||
|
Create Session uecclient http://api-client-uec-test.qniao.cn headers=${cloudfactory_supplierfocusheader} |
||||
|
${response} Get On Session uecclient /uec/get/user-info |
||||
|
log ${response.json()} |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
|
Should Be Equal As Integers ${userid_supplier_focus} ${response.json()["data"]["userId"]} |
||||
|
Should Be Equal As Strings 538701347130839040 ${response.json()["data"]["enterpriseId"]} |
||||
|
Should Be Equal As Strings 厦门千纸互联科技有限公司 ${response.json()["data"]["enterpriseName"]} |
||||
|
|
||||
|
get_supplier_focus_baseinfo |
||||
|
Create Session yytclient https://api-client-yyt-test.qniao.cn headers=${cloudfactory_supplierfocusheader} |
||||
|
${response} Get On Session yytclient cloud-print-user-center/get/base-info |
||||
|
log ${response.json()} |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
|
Should Be Equal As Integers 0 ${response.json()["data"]["employeeStatus"]} |
||||
Write
Preview
Loading…
Cancel
Save