*** 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"]}