Browse Source
Merge pull request 'test' (#17) from test into master
Merge pull request 'test' (#17) from test into master
Reviewed-on: http://git.qniao.cn/automated-test-scripts/yyt-trading-rf-api/pulls/17master
12 changed files with 313 additions and 33 deletions
Unified View
Diff Options
-
2001_login_get_info/login_supplier_focus.robot
-
3002_user_register/supplier_user_register.robot
-
34004_enterprise_open_account_supplier/supplier_paper_open_account.robot
-
2005_enterprise_apply_credit/apply_credit_qniao_customer.robot
-
38006_get_credit/customer_credit_password.robot
-
20007_paper_variety_management/paper_brand.robot
-
3007_paper_variety_management/paper_category.robot
-
6007_paper_variety_management/paper_manufacturer.robot
-
83009_product_manage/product_add_and_list.robot
-
72010_limited_specialoffer/limited_specialoffer_product.robot
-
52011_paper_list_and_details/customer_get_paper_list_and_detail.robot
-
31test_data_clear.robot
@ -0,0 +1,38 @@ |
|||||
|
*** Settings *** |
||||
|
Library RequestsLibrary |
||||
|
Library Collections |
||||
|
Library urllib3 |
||||
|
|
||||
|
*** Variables *** |
||||
|
&{cloudfactory_customer_header} Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847965388 Authorization=${getlogintoken_customer} |
||||
|
${yytclient} https://api-client-yyt-test.qniao.cn |
||||
|
|
||||
|
*** Test Cases *** |
||||
|
customer_get_credit_password_status |
||||
|
Create Session yytclient ${yytclient} headers=${cloudfactory_customer_header} |
||||
|
${response} Get On Session yytclient /cloud-print-user-center/credit/payment-password/getstatus |
||||
|
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 false ${response.json()["data"]["setPassword"]} #设置密码状态 true已设置 false未设置 |
||||
|
|
||||
|
customer_save_credit_password |
||||
|
Create Session yytclient ${yytclient} headers=${cloudfactory_customer_header} |
||||
|
${customer_credit_password} Set Variable 123456 |
||||
|
${save_creditpassword_type} Set Variable 0 #操作状态 0增加密码 1修改密码 |
||||
|
${body} Set Variable {"oldPassword":"","newPassword":"${customer_credit_password}","repeatPassword":"${customer_credit_password}","status":${save_creditpassword_type}} |
||||
|
${response} Get On Session yytclient /cloud-print-user-center/credit/payment-password/save ${body.encode("utf8")} |
||||
|
Set Suite Variable ${customer_credit_password} |
||||
|
log ${response.json()} |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
|
|
||||
|
customer_update_credit_password |
||||
|
Create Session yytclient ${yytclient} headers=${cloudfactory_customer_header} |
||||
|
${customer_credit_password_new} Set Variable 123456 |
||||
|
${save_creditpassword_type} Set Variable 1 #操作状态 0增加密码 1修改密码 |
||||
|
${body} Set Variable {"oldPassword":"${customer_credit_password}","newPassword":"${customer_credit_password_new}","repeatPassword":"${customer_credit_password_new}","status":${save_creditpassword_type}} |
||||
|
${response} POST On Session yytclient /cloud-print-user-center/credit/payment-password/save ${body.encode("utf8")} |
||||
|
log ${response.json()} |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
@ -0,0 +1,83 @@ |
|||||
|
*** Settings *** |
||||
|
Library RequestsLibrary |
||||
|
Library Collections |
||||
|
Library urllib3 |
||||
|
|
||||
|
*** Variables *** |
||||
|
&{cloudfactory_supplierfocus_header} Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847956666 Authorization=${getlogintoken_supplier_focus} |
||||
|
${yytclient} https://api-client-yyt-test.qniao.cn |
||||
|
|
||||
|
*** Test Cases *** |
||||
|
supplierfocus_product_check_exist |
||||
|
Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} |
||||
|
${param} Set Variable categoryBrandId=${paper_brand_id}&salesEnterpriseId=${supplier_enterprise_id} |
||||
|
${response} Get On Session yytclient /trading-center/product/check-exist params=${param} |
||||
|
Log ${response.status_code} |
||||
|
log ${response.json()} |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
|
sleep 1 |
||||
|
|
||||
|
supplierfocus_save_product |
||||
|
Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} |
||||
|
${body} Set Variable {"categoryId":null,"brandName":"${paper_brand_name}","name":"${paper_name}","itemNo":"无","description":"报价全部为现金含税价,支持先用后付,欢迎来电查询!近期价格波动较大,请下单前先咨询价格。","shippingNote":"分切纸不足重量的,另加调机费;低于送货重量或超出送货范围的,运费另计。","sellingProposition":"月结30天价格,不加服务费!","setUnit":"吨","skuList":[{"id":null,"2":678,"purchasePrice":5678}],"categoryBrandId":"${paper_brand_id}","categoryName":"${paper_category_name}","paperMill":"${paper_manufacturer_shortName}","salesEnterpriseId":${supplier_paper_id},"supplierName":"${supplier_paper_name}"} |
||||
|
${response} POST On Session yytclient /trading-center/save/product ${body.encode("utf8")} |
||||
|
Log ${response.status_code} |
||||
|
log ${response.json()} |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
|
${product_id} Get From Dictionary ${response.json()["data"]} id |
||||
|
Set Global Variable ${product_id} |
||||
|
sleep 1 |
||||
|
|
||||
|
supplierfocus_get_product_list |
||||
|
Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} |
||||
|
${response} Get On Session yytclient /trading-center/get/seller/query-product-list |
||||
|
Log ${response.status_code} |
||||
|
log ${response.json()} |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
|
${product_id1} Get From Dictionary ${response.json()["data"]["records"][1]} id |
||||
|
Set Global Variable ${product_id1} |
||||
|
|
||||
|
supplierfocus_get_product_list_search |
||||
|
Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} |
||||
|
${product_status} Set Variable 30112 #商品状态 30110未上架 30111上架中 30112已下架 |
||||
|
${param} Set Variable salesEnterpriseId=${supplier_paper_id}&status=${product_status}&name=${paper_name} |
||||
|
${response} Get On Session yytclient /trading-center/get/seller/query-product-list params-${param} |
||||
|
Log ${response.status_code} |
||||
|
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 ${paper_name} ${response.json()["data"]["records"][0]["name"]} |
||||
|
Should Be Equal As Strings ${product_id} ${response.json()["data"]["records"][0]["id"]} |
||||
|
|
||||
|
supplierfocus_edit_product_status_up |
||||
|
Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} |
||||
|
${product_status} Set Variable 1 #上下架状态 1上架 2下架 |
||||
|
${body} Set Variable {"status":${product_status},"id":"${product_id}"} |
||||
|
${response} POST On Session yytclient /trading-center/edit/product/status/${product_id} ${body.encode("utf8")} |
||||
|
Log ${response.status_code} |
||||
|
log ${response.json()} |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
|
|
||||
|
supplierfocus_edit_product_status_down |
||||
|
Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} |
||||
|
${product_status} Set Variable 2 #上下架状态 1上架 2下架 |
||||
|
${body} Set Variable {"status":${product_status},"id":"${product_id}"} |
||||
|
${response} POST On Session yytclient /trading-center/edit/product/status/${product_id} ${body.encode("utf8")} |
||||
|
Log ${response.status_code} |
||||
|
log ${response.json()} |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
|
|
||||
|
supplierfocus_batch_product_status_up |
||||
|
Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} |
||||
|
${product_status} Set Variable 30111 #批量上下架状态 30110未上架 30111上架中 30112已下架 |
||||
|
${body} Set Variable {"status":${product_status},"idList":["${product_id}","${product_id1}"]} |
||||
|
${response} POST On Session yytclient /trading-center/update/product-status/batch ${body.encode("utf8")} |
||||
|
Log ${response.status_code} |
||||
|
log ${response.json()} |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
@ -0,0 +1,72 @@ |
|||||
|
*** Settings *** |
||||
|
Library DatabaseLibrary |
||||
|
Library RequestsLibrary |
||||
|
Library Collections |
||||
|
Library urllib3 |
||||
|
|
||||
|
*** Variables *** |
||||
|
&{operation_backend_header} Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847952999 Authorization=${gettoken_operate} |
||||
|
${yytops} https://api-ops-yyt-test.qniao.cn |
||||
|
&{cloudfactory_customer_header} Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847965388 Authorization=${getlogintoken_customer} |
||||
|
${yytclient} https://api-client-yyt-test.qniao.cn |
||||
|
|
||||
|
*** Test Cases *** |
||||
|
operate_get_noton_sale_product_list |
||||
|
Create Session yytops ${yytops} headers=${operation_backend_header} |
||||
|
${param} Set Variable isOnSale=0 #是否特价 0否 1是 |
||||
|
${response} Get On Session yytops /trading-center/admin/get/on-sale-category-brand-list params=${param} |
||||
|
Log ${response.status_code} |
||||
|
log ${response.json()} |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
|
|
||||
|
operate_on_sale_product_list_earch |
||||
|
Create Session yytops ${yytops} headers=${operation_backend_header} |
||||
|
${param} Set Variable isOnSale=0&name=${paper_brand_name}&paperName=${paper_name} |
||||
|
${response} Get On Session yytops /trading-center/admin/get/on-sale-category-brand-list params=${param} |
||||
|
Log ${response.status_code} |
||||
|
log ${response.json()} |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
|
${on_sale_product_paper_id} Get From Dictionary ${response.json()["data"]["records"][0]} id |
||||
|
Set Global Variable ${on_sale_product_paper_id} |
||||
|
|
||||
|
operate_add_on_sale_product |
||||
|
Create Session yytops ${yytops} headers=${operation_backend_header} |
||||
|
${product_isOnSale} Set Variable 1 #是否特价 0否 1是 |
||||
|
${body} Set Variable {"categoryBrandIds":["${on_sale_product_paper_id}"],"isOnSale":${product_isOnSale}} |
||||
|
${response} POST On Session yytops trading-center/admin/add-or-remove/on-sale-category-brands ${body.encode("utf8")} |
||||
|
Log ${response.status_code} |
||||
|
log ${response.json()} |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
|
|
||||
|
operate_get_on_sale_product_list |
||||
|
Create Session yytops ${yytops} headers=${operation_backend_header} |
||||
|
${param} Set Variable isOnSale=1 #是否特价 0否 1是 |
||||
|
${response} Get On Session yytops /trading-center/admin/get/on-sale-category-brand-list params=${param} |
||||
|
Log ${response.status_code} |
||||
|
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 ${on_sale_product_paper_id} ${response.json()["data"]["records"][0]["id"]} |
||||
|
|
||||
|
customer_get_on_sale_product_list |
||||
|
Create Session yytclient ${yytclient} headers=${cloudfactory_customer_header} |
||||
|
${param} Set Variable isOnSale=1 #是否特价 0否 1是 |
||||
|
${response} Get On Session yytclient /trading-center/wechatapplet/get/paper-brand/brand-list params=${param} |
||||
|
Log ${response.status_code} |
||||
|
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 ${on_sale_product_paper_id} ${response.json()["data"]["records"][0]["id"]} |
||||
|
|
||||
|
operate_remove_on_sale_product |
||||
|
Create Session yytops ${yytops} headers=${operation_backend_header} |
||||
|
${product_isOnSale} Set Variable 0 #是否特价 0否 1是 |
||||
|
${body} Set Variable {"categoryBrandIds":["${on_sale_product_paper_id}"],"isOnSale":${product_isOnSale}} |
||||
|
${response} POST On Session yytops trading-center/admin/add-or-remove/on-sale-category-brands ${body.encode("utf8")} |
||||
|
Log ${response.status_code} |
||||
|
log ${response.json()} |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
@ -0,0 +1,52 @@ |
|||||
|
*** Settings *** |
||||
|
Library RequestsLibrary |
||||
|
Library Collections |
||||
|
Library urllib3 |
||||
|
|
||||
|
*** Variables *** |
||||
|
&{cloudfactory_customer_header} Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847965388 Authorization=${getlogintoken_customer} |
||||
|
${yytclient} https://api-client-yyt-test.qniao.cn |
||||
|
|
||||
|
*** Test Cases *** |
||||
|
customer_get_paper_list |
||||
|
Create Session yytclient ${yytclient} headers=${cloudfactory_customer_header} |
||||
|
${response} Get On Session yytclient /trading-center/wechatapplet/get/paper-brand/brand-list |
||||
|
log ${response.json()} |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
|
|
||||
|
customer_get_paper_list_search |
||||
|
Create Session yytclient ${yytclient} headers=${cloudfactory_customer_header} |
||||
|
${param} Set Variable searchValue=${paper_name} |
||||
|
${response} Get On Session yytclient /trading-center/wechatapplet/get/home/search-paper-product params=${param} |
||||
|
log ${response.json()} |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
|
${paper_id} Get From Dictionary ${response.json()["data"]["records"][0]} id |
||||
|
Set Suite Variable ${paper_id} |
||||
|
|
||||
|
customer_get_paper_detail |
||||
|
Create Session yytclient ${yytclient} headers=${cloudfactory_customer_header} |
||||
|
${response} Get On Session yytclient /trading-center/wechatapplet/get/category-brand/detail/${paper_id} |
||||
|
log ${response.json()} |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
|
${paper_weight_id} Get From Dictionary ${response.json()["data"]["weightList"][0]} id |
||||
|
Set Global Variable ${paper_weight_id} |
||||
|
|
||||
|
customer_add_paper_list_focus |
||||
|
Create Session yytclient ${yytclient} headers=${cloudfactory_customer_header} |
||||
|
${paper_focus_type} Set Variable 0 #纸品关注 0添加 1取消 |
||||
|
${body} Set Variable {"categoryId":"${paper_id}","status":${paper_focus_type}} |
||||
|
${response} POST On Session yytclient trading-center/wechatapplet/add/paper-brand/focus ${body.encode("utf8")} |
||||
|
log ${response.json()} |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
|
|
||||
|
customer_get_paper_list_focus |
||||
|
Create Session yytclient ${yytclient} headers=${cloudfactory_customer_header} |
||||
|
${param} Set Variable categoryI=0 #categoryId为0查询个人关注,默认不传查询推荐,传参则为查纸品分类列表 |
||||
|
${response} Get On Session yytclient /trading-center/wechatapplet/get/paper-brand/brand-list params=${param} |
||||
|
log ${response.json()} |
||||
|
Should Be Equal As Numbers 200 ${response.status_code} |
||||
|
Should Be Equal As Strings successful ${response.json()["message"]} |
||||
Write
Preview
Loading…
Cancel
Save