云印通原纸商城
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.
 
 

53 lines
3.0 KiB

*** Settings ***
Library DatabaseLibrary
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_category
Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header}
${paper_category_name} Set Variable autotest_paper_category_name
${body} Set Variable {"name":"${paper_category_name}"}
Set Suite Variable ${paper_category_name}
${response} POST On Session yytclient /trading-center/save/product/paper-category ${body.encode("utf8")}
Set Global Variable ${paper_category_name}
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_get_paper_category_list
Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header}
${response} Get On Session yytclient /trading-center/get/product/paper-category-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_category_name} ${response.json()["data"]["records"][0]["name"]}
${paper_category_id} Get From Dictionary ${response.json()["data"]["records"][0]} id
Set Global Variable ${paper_category_id}
${paper_category_status} Get From Dictionary ${response.json()["data"]["records"][0]} status
Set Suite Variable ${paper_category_status}
supplierfocus_edit_paper_category
Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header}
${body} Set Variable {"name":"${paper_category_name}","id":"${paper_category_id}","status":${paper_category_status}}
${response} POST On Session yytclient /trading-center/save/product/paper-category ${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_disable_paper_category
Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header}
${body} Set Variable {"name":"${paper_category_name}","id":"${paper_category_id}","status":1}
${response} POST On Session yytclient /trading-center/save/product/paper-category ${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"]}