Browse Source

Merge pull request '新增获取授信额度、原纸行情、纸品管理:分类、纸厂、品牌!' (#9) from test into master

Reviewed-on: http://git.qniao.cn/automated-test-scripts/yyt-trading-rf-api/pulls/9
master
梁金满 4 years ago
parent
commit
380268b370
5 changed files with 0 additions and 299 deletions
  1. 77
      login_get_info/login_customer.robot
  2. 33
      login_get_info/login_operate.robot
  3. 33
      login_get_info/login_operate_psc.robot
  4. 77
      login_get_info/login_supplier.robot
  5. 79
      login_get_info/login_supplier_focus.robot

77
login_get_info/login_customer.robot

@ -1,77 +0,0 @@
*** Settings ***
Library RequestsLibrary
Library Collections
Library urllib3
*** Variables ***
&{cloud_factory_header} Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847965388
*** Test Cases ***
customer_phone
#去除警告
Disable Warnings
#创建会话 会话别名 baseurl headers
Create Session uecclient https://api-client-uec-test.qniao.cn headers=${cloud_factory_header}
#变量名称 设置用例变量 变量值
${body} Set Variable {"accountType":2,"account":"13800138003","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_customer} Get From Dictionary ${response.json()["data"] } token
#日志
log ${gettoken_customer}
#设置token变量 未转业务线
Set Suite Variable ${gettoken_customer}
#变量接收客户userid 获取字典内容 响应结果 serid-key
${userid_customer} Get From Dictionary ${response.json()["data"] } userId
#日志
log ${userid_customer}
#设置token变量
Set Suite Variable ${userid_customer}
#设置带token的请求头
&{cloudfactorycustomerheader} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847965388 Authorization=${gettoken_customer}
#设置token变量
Set Suite Variable ${cloudfactorycustomerheader}
customer_login_token
Disable Warnings
Create Session yytclient https://api-client-yyt-test.qniao.cn headers=${cloudfactorycustomerheader}
${body} Set Variable {"loginToken":"${gettoken_customer}"}
${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_customer} Get From Dictionary ${response.json()} data
log ${getlogintoken_customer}
#全局token
Set Global Variable ${getlogintoken_customer}
&{cloudfactory_customerheader} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847965388 Authorization=${getlogintoken_customer}
Set Suite Variable ${cloudfactory_customerheader}
get_customer_userinfo
Create Session uecclient http://api-client-uec-test.qniao.cn headers=${cloudfactory_customerheader}
${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_customer} ${response.json()["data"]["userId"]}
get_customer_baseinfo
Create Session yytclient https://api-client-yyt-test.qniao.cn headers=${cloudfactory_customerheader}
${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"]}

33
login_get_info/login_operate.robot

@ -1,33 +0,0 @@
*** Settings ***
Library RequestsLibrary
Library Collections
Library urllib3
*** Variables ***
&{operation_backend_header} Content-Type=application/x-www-form-urlencoded X-APP-ID=503258978847952999
*** Test Cases ***
operate_mail
Disable Warnings
Create Session yytops http://api-ops-yyt-test.qniao.cn headers=${operation_backend_header}
&{data} Create Dictionary username=liangjinman@qniao.cn password=qn123456
${resp} POST On Session yytops /cloud-factory-operation-backend/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} get from Dictionary ${resp.headers} Authorization
log ${gettoken_operate}
Set Global Variable ${gettoken_operate}
&{operationbackend_header} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847952999 Authorization=${gettoken_operate}
Set Suite Variable ${operationbackend_header}
get_operate_userinfo
Create Session yytops https://api-ops-yyt-test.qniao.cn headers=${operationbackend_header}
${response} Get On Session yytops /cloud-factory-operation-backend/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"]}

33
login_get_info/login_operate_psc.robot

@ -1,33 +0,0 @@
*** 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"]}

77
login_get_info/login_supplier.robot

@ -1,77 +0,0 @@
*** 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"]}

79
login_get_info/login_supplier_focus.robot

@ -1,79 +0,0 @@
*** 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"]}
Loading…
Cancel
Save