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.
80 lines
5.4 KiB
80 lines
5.4 KiB
*** 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_save_paper_brand
|
|
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 Suite Variable ${paper_categoryid}
|
|
Set Suite Variable ${paper_Manufacturerid}
|
|
Set Suite Variable ${paper_brand_name}
|
|
Set Suite Variable ${paper_name}
|
|
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.status_code}
|
|
log ${response.json()}
|
|
Should Be Equal As Numbers 200 ${response.status_code}
|
|
Should Be Equal As Strings successful ${response.json()["message"]}
|
|
sleep 2
|
|
|
|
supplierfocus_get_paper_brand_list
|
|
Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header}
|
|
${response} Get On Session yytclient /trading-center/get/product/brand-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"]}
|
|
Should Be Equal As Strings ${paper_categoryid} ${response.json()["data"]["records"][0]["categoryId"]}
|
|
Should Be Equal As Strings ${paper_Manufacturerid} ${response.json()["data"]["records"][0]["paperManufacturerId"]}
|
|
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"]}
|
|
Should Be Equal As Numbers 1 ${response.json()["data"]["records"][0]["status"]} #纸品状态 0上架 1下架
|
|
${paper_brand_id} Get From Dictionary ${response.json()["data"]["records"][0]} id
|
|
Set Suite Variable ${paper_brand_id}
|
|
|
|
supplierfocus_search_paper_brand
|
|
Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header}
|
|
${param} Set Variable status=1&searchValue=${paper_brand_name}
|
|
${response} Get On Session yytclient /trading-center/get/product/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 ${paper_categoryid} ${response.json()["data"]["records"][0]["categoryId"]}
|
|
Should Be Equal As Strings ${paper_Manufacturerid} ${response.json()["data"]["records"][0]["paperManufacturerId"]}
|
|
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"]}
|
|
Should Be Equal As Strings ${paper_brand_id} ${response.json()["data"]["records"][0]["id"]}
|
|
|
|
supplierfocus_edit_paper_brand
|
|
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.status_code}
|
|
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
|
|
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.status_code}
|
|
log ${response.json()}
|
|
Should Be Equal As Numbers 200 ${response.status_code}
|
|
Should Be Equal As Strings successful ${response.json()["message"]}
|