云印通原纸商城
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

70 lines
4.4 KiB

*** Settings ***
Library RequestsLibrary
Library Collections
Library urllib3
*** Test Cases ***
supplierfocus_save_paper_brand
Disable Warnings
Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header}
${paper_categoryid} Set Variable 638458876659896320
${paper_Manufacturerid} Set Variable 638458967357526016
${paper_brand_name} Set Variable aotutest_paper_brand_name
${paper_name} Set Variable aotutest_paper_name
${paper_characteristic} Set Variable This autotest_paper_characteristic
${paper_description} Set Variable This apaper_description
${paper_brand_img} Set Variable https://qncloudprintfiletest.oss-cn-shenzhen.aliyuncs.com/cloudprint/1632378545847.jpg
${body} Set Variable {"categoryId":"${paper_categoryid}","paperManufacturerId":"${paper_Manufacturerid}","name":"${paper_brand_name}","paperName":"${paper_name}","characteristic":"${paper_characteristic}","description":"${paper_description}","img":"${paper_brand_img}"}
Set Global Variable ${paper_brand_name}
Set Global Variable ${paper_name}
Set Global Variable ${paper_categoryid}
Set Global Variable ${paper_Manufacturerid}
Set Suite Variable ${paper_characteristic}
Set Suite Variable ${paper_description}
Set Suite Variable ${paper_brand_img}
${response} POST On Session yytclient /trading-center/save/product/brand ${body.encode("utf8")}
log ${response.json()}
Should Be Equal As Numbers 200 ${response.status_code}
Should Be Equal As Strings successful ${response.json()["message"]}
sleep 1
supplierfocus_get_paper_brand_list
Disable Warnings
Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header}
${response} Get On Session yytclient /trading-center/get/product/brand-list
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_brand_name} ${response.json()["data"]["records"][0]["name"]}
Should Be Equal As Strings ${paper_name} ${response.json()["data"]["records"][0]["paperName"]}
supplierfocus_search_paper_brand
Disable Warnings
Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header}
${param} Set Variable searchValue=${paper_brand_name}
${response} Get On Session yytclient /trading-center/get/product/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"]}
Should Be Equal As Strings ${paper_brand_name} ${response.json()["data"]["records"][0]["name"]}
Should Be Equal As Strings ${paper_name} ${response.json()["data"]["records"][0]["paperName"]}
${paper_brand_id} Get From Dictionary ${response.json()["data"]["records"][0]} id
Set Global Variable ${paper_brand_id}
supplierfocus_edit_paper_brand
Disable Warnings
Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header}
${body} Set Variable {"id":"${paper_brand_id}","categoryId":"${paper_categoryid}","paperManufacturerId":"${paper_Manufacturerid}","name":"${paper_brand_name}","paperName":"${paper_name}","characteristic":"${paper_characteristic}","description":"${paper_description}","img":"${paper_brand_img}"}
${response} POST On Session yytclient /trading-center/save/product/brand ${body.encode("utf8")}
log ${response.json()}
Should Be Equal As Numbers 200 ${response.status_code}
Should Be Equal As Strings successful ${response.json()["message"]}
supplierfocus_update_status_paper_brand
Disable Warnings
Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header}
${body} Set Variable {"idList":["${paper_brand_id}"],"status":0} #纸品状态 0上架 1下架
${response} POST On Session yytclient /trading-center/update/category-brands/status/batch ${body.encode("utf8")}
log ${response.json()}
Should Be Equal As Numbers 200 ${response.status_code}
Should Be Equal As Strings successful ${response.json()["message"]}