From 2cb157981c2434756e8e50619baf4ad01a1920cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=87=91=E6=BB=A1?= Date: Wed, 13 Oct 2021 17:31:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../supplier_paper_open_account.robot | 3 +- 006_get_credit/customer_credit_password.robot | 38 ++++++++ .../paper_brand.robot | 10 +- .../paper_category.robot | 1 + .../paper_manufacturer.robot | 6 +- 009_product_manage/product_add_and_list.robot | 97 +++++++++++++++++++ .../limited_specialoffer_product.robot | 72 ++++++++++++++ .../customer_get_paper_list_and_detail.robot | 54 +++++++++++ test_data_clear.robot | 20 ++++ 9 files changed, 292 insertions(+), 9 deletions(-) create mode 100644 006_get_credit/customer_credit_password.robot create mode 100644 009_product_manage/product_add_and_list.robot create mode 100644 010_limited_specialoffer/limited_specialoffer_product.robot create mode 100644 011_paper_list_and_details/customer_get_paper_list_and_detail.robot diff --git a/004_enterprise_open_account_supplier/supplier_paper_open_account.robot b/004_enterprise_open_account_supplier/supplier_paper_open_account.robot index adbe50e..83020c7 100644 --- a/004_enterprise_open_account_supplier/supplier_paper_open_account.robot +++ b/004_enterprise_open_account_supplier/supplier_paper_open_account.robot @@ -75,6 +75,7 @@ operate_create_enterprise_with_supplier_paper ${supplier_paper_locationBank} Set Variable autotest_locationBank ${body} Set Variable {"supplierId":"${supplier_paper_id}","enterprise":{"name":"${supplier_paper_name}","locDetail":"${supplier_paper_locDetail}","type":${supplier_paper_type},"uniformSocialCreditCode":"${supplier_paper_uniformSocialCreditCode}","legalPersonIdCardNo":"${supplier_paper_legalPersonIdCardNo}","legalPersonName":"${supplier_paper_legalPersonName}","paperSettlementIntervalTypeId":"${supplier_paper_paperSettlementIntervalTypeId}","locProvinceId":${supplier_paper_locProvinceId},"locCityId":${supplier_paper_locCityId},"locDistrictId":${supplier_paper_locDistrictId},"locStreetId":${supplier_paper_locStreetId},"legalPersonIdCardFrontImg":"${supplier_paper_legalPersonIdCardFrontImg}","legalPersonIdCardBackImg":"${supplier_paper_legalPersonIdCardBackImg}","businessLicenseImg":"${supplier_paper_businessLicenseImg}"},"enterpriseContacts":{"name":"${supplier_paper_contactsname}","mobilePhone":"${supplier_paper_mobilePhone}","telephone":"${supplier_paper_telephone}","email":"${supplier_paper_email}","wechatAccount":"${supplier_paper_wechatAccount}","remark":"${supplier_paper_remark}"},"enterpriseCorporateAccount":{"bankAccountName":"${supplier_paper_bankAccountName}","bankAccount":"${supplier_paper_bankAccount}","bankName":"${supplier_paper_bankName}","accountOpeningBranch":"${supplier_paper_accountOpeningBranch}","locationBank":"${supplier_paper_locationBank}"}} ${response} POST On Session yytclient /cloud-print-user-center/create/enterprise/with/supplier ${body.encode("utf8")} + Set Global Variable ${supplier_paper_name} Log ${response.status_code} log ${response.json()} Should Be Equal As Numbers 200 ${response.status_code} @@ -98,7 +99,7 @@ operate_get_virtual_supplier_search Should Be Equal As Numbers 200 ${response.status_code} Should Be Equal As Strings successful ${response.json()["message"]} ${supplier_enterprise_id} Get From Dictionary ${response.json()["data"]["records"][0]} enterpriseId - Set Suite Variable ${supplier_enterprise_id} + Set Global Variable ${supplier_enterprise_id} operate_get_supplier_paper_detail Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} diff --git a/006_get_credit/customer_credit_password.robot b/006_get_credit/customer_credit_password.robot new file mode 100644 index 0000000..b8a0cc1 --- /dev/null +++ b/006_get_credit/customer_credit_password.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"]} diff --git a/007_paper_variety_management/paper_brand.robot b/007_paper_variety_management/paper_brand.robot index a086f8f..c14401f 100644 --- a/007_paper_variety_management/paper_brand.robot +++ b/007_paper_variety_management/paper_brand.robot @@ -18,10 +18,10 @@ supplierfocus_save_paper_brand ${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 Global Variable ${paper_categoryid} + Set Global Variable ${paper_Manufacturerid} + Set Global Variable ${paper_brand_name} + Set Global Variable ${paper_name} Set Suite Variable ${paper_characteristic} Set Suite Variable ${paper_description} Set Suite Variable ${paper_brand_img} @@ -45,7 +45,7 @@ supplierfocus_get_paper_brand_list 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} + Set Global Variable ${paper_brand_id} supplierfocus_search_paper_brand Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} diff --git a/007_paper_variety_management/paper_category.robot b/007_paper_variety_management/paper_category.robot index 46b7203..53d4179 100644 --- a/007_paper_variety_management/paper_category.robot +++ b/007_paper_variety_management/paper_category.robot @@ -15,6 +15,7 @@ supplierfocus_save_paper_category ${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} diff --git a/007_paper_variety_management/paper_manufacturer.robot b/007_paper_variety_management/paper_manufacturer.robot index 73e307c..2c2619d 100644 --- a/007_paper_variety_management/paper_manufacturer.robot +++ b/007_paper_variety_management/paper_manufacturer.robot @@ -15,8 +15,8 @@ supplierfocus_save_paper_manufacturer ${paper_manufacturer_description} Set Variable This autotest_paper_manufacturer ${paper_manufacturer_logoImg} Set Variable https://qncloudprintfiletest.oss-cn-shenzhen.aliyuncs.com/cloudprint/1632378545847.jpg ${body} Set Variable {"name":"${paper_manufacturer_name}","shortName":"${paper_manufacturer_shortName}","description":"${paper_manufacturer_description}","logoImg":"${paper_manufacturer_logoImg}"} - Set Suite Variable ${paper_manufacturer_name} - Set Suite Variable ${paper_manufacturer_shortName} + Set Global Variable ${paper_manufacturer_name} + Set Global Variable ${paper_manufacturer_shortName} Set Suite Variable ${paper_manufacturer_description} Set Suite Variable ${paper_manufacturer_logoImg} ${response} POST On Session yytclient /trading-center/save/paper-manufacturer ${body.encode("utf8")} @@ -35,7 +35,7 @@ supplierfocus_get_paper_manufacturer_list Should Be Equal As Strings successful ${response.json()["message"]} Should Be Equal As Strings ${paper_manufacturer_name} ${response.json()["data"]["records"][0]["name"]} ${paper_manufacturer_id} Get From Dictionary ${response.json()["data"]["records"][0]} id - Set Suite Variable ${paper_manufacturer_id} + Set Global Variable ${paper_manufacturer_id} supplierfocus_search_paper_manufacturer Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} diff --git a/009_product_manage/product_add_and_list.robot b/009_product_manage/product_add_and_list.robot new file mode 100644 index 0000000..dcdb1a7 --- /dev/null +++ b/009_product_manage/product_add_and_list.robot @@ -0,0 +1,97 @@ +*** 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_enterprise_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 Suite 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_enterprise_id}&status=${product_status}&categoryId=${paper_category_id}&name=${paper_name}&brandName=${paper_brand_name} + ${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"]} + Should Be Equal As Strings ${supplier_enterprise_id} ${response.json()["data"]["records"][0]["salesEnterpriseId"]} + Should Be Equal As Strings ${paper_categoryid} ${response.json()["data"]["records"][0]["categoryId"]} + Should Be Equal As Strings ${paper_manufacturer_shortName} ${response.json()["data"]["records"][0]["paperMill"]} + Should Be Equal As Strings ${paper_brand_name} ${response.json()["data"]["records"][0]["brandName"]} + 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"]} + +supplierfocus_batch_product_status_down + Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} + ${product_status} Set Variable 30112 #批量上下架状态 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"]} diff --git a/010_limited_specialoffer/limited_specialoffer_product.robot b/010_limited_specialoffer/limited_specialoffer_product.robot new file mode 100644 index 0000000..5870549 --- /dev/null +++ b/010_limited_specialoffer/limited_specialoffer_product.robot @@ -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=0categoryId=${paper_category_id}&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=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"]} + 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 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"]} + +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"]} diff --git a/011_paper_list_and_details/customer_get_paper_list_and_detail.robot b/011_paper_list_and_details/customer_get_paper_list_and_detail.robot new file mode 100644 index 0000000..daf1861 --- /dev/null +++ b/011_paper_list_and_details/customer_get_paper_list_and_detail.robot @@ -0,0 +1,54 @@ +*** 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_search + 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"]} + ${paper_id} Get From Dictionary ${response.json()["data"]["records"][0]} id + Set Suite Variable ${paper_id} + +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"]} diff --git a/test_data_clear.robot b/test_data_clear.robot index be54579..d3ea28a 100644 --- a/test_data_clear.robot +++ b/test_data_clear.robot @@ -79,3 +79,23 @@ supplierfocus_delete_paper_brand 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_delete + Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} + ${product_status} Set Variable 30112 #批量上下架状态 30110未上架 30111上架中 30112已下架 + ${body} Set Variable {"ids":["${product_id}"]} + ${response} POST On Session yytclient /trading-center/delete/product-list ${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_remove_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"]} From 16e6ff8120e26012268af4367c6a77ca62bc87b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=81=E9=87=91=E6=BB=A1?= Date: Thu, 21 Oct 2021 16:28:15 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=85=B3=E8=81=94?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=8F=82=E6=95=B0=E8=84=9A=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 001_login_get_info/login_supplier_focus.robot | 2 +- .../supplier_user_register.robot | 3 +- .../supplier_paper_open_account.robot | 31 +++++++---- .../apply_credit_qniao_customer.robot | 2 +- .../paper_brand.robot | 16 ++---- .../paper_category.robot | 2 +- 009_product_manage/product_add_and_list.robot | 22 ++------ .../limited_specialoffer_product.robot | 28 +++++----- .../customer_get_paper_list_and_detail.robot | 4 +- test_data_clear.robot | 51 +++++++++++-------- 10 files changed, 79 insertions(+), 82 deletions(-) diff --git a/001_login_get_info/login_supplier_focus.robot b/001_login_get_info/login_supplier_focus.robot index 050ca69..e2adcea 100644 --- a/001_login_get_info/login_supplier_focus.robot +++ b/001_login_get_info/login_supplier_focus.robot @@ -16,7 +16,7 @@ supplier_focus_phone Create Session uecclient ${uecclient} headers=${cloud_factory_supplier_focus_header} #变量名称 设置用例变量 变量值 ${accounttype} Set Variable 2 #账号类型 1微信 2手机号 3邮箱 4苹果 5自定义账号 - ${account} Set Variable 18219557422 + ${account} Set Variable 15736764290 ${body} Set Variable {"accountType":${accounttype},"account":"${account}","captcha":"888888"} #变量接收响应结果 post请求 会话别名 uri 传参 ${response} POST On Session uecclient /uec/authorize/by-captcha ${body} diff --git a/002_user_register/supplier_user_register.robot b/002_user_register/supplier_user_register.robot index ddd9538..6295a00 100644 --- a/002_user_register/supplier_user_register.robot +++ b/002_user_register/supplier_user_register.robot @@ -110,11 +110,10 @@ operate_get_user_register_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 ${supplier_account} ${response.json()["data"]["records"][0]["mobile"]} operate_get_user_register_search Create Session yytops ${yytops} headers=${operationbackend_header} - ${param} Set Variable createTimeBegin=${current_date}&createTimeEnd=${current_date}&mobile=${account} + ${param} Set Variable createTimeBegin=${current_date}&createTimeEnd=${current_date}&mobile=${supplier_account} ${response} Get On Session yytops /cloud-print-user-center/admin/user/get/user-list params=${param} Log ${response.status_code} log ${response.json()} diff --git a/004_enterprise_open_account_supplier/supplier_paper_open_account.robot b/004_enterprise_open_account_supplier/supplier_paper_open_account.robot index 83020c7..2947b2b 100644 --- a/004_enterprise_open_account_supplier/supplier_paper_open_account.robot +++ b/004_enterprise_open_account_supplier/supplier_paper_open_account.robot @@ -33,11 +33,19 @@ operate_save_virtual_supplier Should Be Equal As Numbers 200 ${response.status_code} Should Be Equal As Strings successful ${response.json()["message"]} Should Be Equal As Strings ${virtual_supplier_name} ${response.json()["data"]["name"]} - ${supplier_paper_id} Get From Dictionary ${response.json()["data"]} id - Set Suite Variable ${supplier_paper_id} sleep 1 -operate_update_virtual_supplier_status +operate_get_virtual_supplier_list + Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} + ${response} Get On Session yytclient /cloud-print-user-center/supplier/directsalestore/virtual-supplier/page + 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"]} + ${supplier_paper_id} Get From Dictionary ${response.json()["data"]["records"][0]} id + Set Global Variable ${supplier_paper_id} + +operate_update_virtual_supplier_status_deactivate Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} ${body} Set Variable {"id":"${supplier_paper_id}","status":0} #虚拟供应商状态 0禁用 1启用 ${response} POST On Session yytclient /cloud-print-user-center/supplier/directsalestore/virtual-supplier/updatestatus ${body.encode("utf8")} @@ -46,6 +54,15 @@ operate_update_virtual_supplier_status Should Be Equal As Numbers 200 ${response.status_code} Should Be Equal As Strings successful ${response.json()["message"]} +operate_update_virtual_supplier_status_enable + Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} + ${body} Set Variable {"id":"${supplier_paper_id}","status":1} #虚拟供应商状态 0禁用 1启用 + ${response} POST On Session yytclient /cloud-print-user-center/supplier/directsalestore/virtual-supplier/updatestatus ${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_create_enterprise_with_supplier_paper Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} ${supplier_paper_name} Set Variable autotest_supplier_paper_name @@ -82,14 +99,6 @@ operate_create_enterprise_with_supplier_paper Should Be Equal As Strings successful ${response.json()["message"]} sleep 1 -operate_get_virtual_supplier_list - Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} - ${response} Get On Session yytclient /cloud-print-user-center/supplier/directsalestore/virtual-supplier/page - 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_virtual_supplier_search Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} ${param} Set Variable name=${virtual_supplier_name} diff --git a/005_enterprise_apply_credit/apply_credit_qniao_customer.robot b/005_enterprise_apply_credit/apply_credit_qniao_customer.robot index 0c2de2c..e7dd247 100644 --- a/005_enterprise_apply_credit/apply_credit_qniao_customer.robot +++ b/005_enterprise_apply_credit/apply_credit_qniao_customer.robot @@ -112,4 +112,4 @@ operate_get_credit_list_details_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 Numbers ${printing_packaging_factory_creditLine} ${response.json()["data"]["records"][0]["currentCreditLine"]} + Should Be Equal As Integers ${printing_packaging_factory_creditLine} ${response.json()["data"]["records"][0]["currentCreditLine"]} diff --git a/007_paper_variety_management/paper_brand.robot b/007_paper_variety_management/paper_brand.robot index c14401f..c32c06e 100644 --- a/007_paper_variety_management/paper_brand.robot +++ b/007_paper_variety_management/paper_brand.robot @@ -18,10 +18,10 @@ supplierfocus_save_paper_brand ${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_categoryid} - Set Global Variable ${paper_Manufacturerid} 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} @@ -39,27 +39,21 @@ supplierfocus_get_paper_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_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 Global 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} + ${param} Set Variable 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"]} + ${paper_brand_id} Get From Dictionary ${response.json()["data"]["records"][0]} id + Set Global Variable ${paper_brand_id} supplierfocus_edit_paper_brand Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} diff --git a/007_paper_variety_management/paper_category.robot b/007_paper_variety_management/paper_category.robot index 53d4179..6799862 100644 --- a/007_paper_variety_management/paper_category.robot +++ b/007_paper_variety_management/paper_category.robot @@ -30,7 +30,7 @@ supplierfocus_get_paper_category_list 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 Suite Variable ${paper_category_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} diff --git a/009_product_manage/product_add_and_list.robot b/009_product_manage/product_add_and_list.robot index dcdb1a7..3a320ea 100644 --- a/009_product_manage/product_add_and_list.robot +++ b/009_product_manage/product_add_and_list.robot @@ -20,7 +20,7 @@ supplierfocus_product_check_exist 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_enterprise_id}","supplierName":"${supplier_paper_name}" + ${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()} @@ -38,21 +38,17 @@ supplierfocus_get_product_list 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 Suite Variable ${product_id1} + 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_enterprise_id}&status=${product_status}&categoryId=${paper_category_id}&name=${paper_name}&brandName=${paper_brand_name} - ${response} Get On Session yytclient /trading-center/get/seller/query-product-list + ${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 ${supplier_enterprise_id} ${response.json()["data"]["records"][0]["salesEnterpriseId"]} - Should Be Equal As Strings ${paper_categoryid} ${response.json()["data"]["records"][0]["categoryId"]} - Should Be Equal As Strings ${paper_manufacturer_shortName} ${response.json()["data"]["records"][0]["paperMill"]} - Should Be Equal As Strings ${paper_brand_name} ${response.json()["data"]["records"][0]["brandName"]} 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"]} @@ -85,13 +81,3 @@ supplierfocus_batch_product_status_up 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_down - Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} - ${product_status} Set Variable 30112 #批量上下架状态 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"]} diff --git a/010_limited_specialoffer/limited_specialoffer_product.robot b/010_limited_specialoffer/limited_specialoffer_product.robot index 5870549..45729dd 100644 --- a/010_limited_specialoffer/limited_specialoffer_product.robot +++ b/010_limited_specialoffer/limited_specialoffer_product.robot @@ -22,13 +22,13 @@ operate_get_noton_sale_product_list operate_on_sale_product_list_earch Create Session yytops ${yytops} headers=${operation_backend_header} - ${param} Set Variable isOnSale=0categoryId=${paper_category_id}&name=${paper_brand_name}&paperName=${paper_name} + ${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 + ${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 @@ -43,30 +43,30 @@ operate_add_on_sale_product operate_get_on_sale_product_list Create Session yytops ${yytops} headers=${operation_backend_header} - ${param} Set Variable isOnSale=0 #是否特价 0否 1是 + ${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"]} + 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 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")} +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"]} -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} +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"]} - Should Be Equal As Strings ${on_sale_product_paper_id} ${response.json()["data"]{"records"][0]["id"]} diff --git a/011_paper_list_and_details/customer_get_paper_list_and_detail.robot b/011_paper_list_and_details/customer_get_paper_list_and_detail.robot index daf1861..dd416ff 100644 --- a/011_paper_list_and_details/customer_get_paper_list_and_detail.robot +++ b/011_paper_list_and_details/customer_get_paper_list_and_detail.robot @@ -34,7 +34,7 @@ customer_get_paper_detail ${paper_weight_id} Get From Dictionary ${response.json()["data"]["weightList"][0]} id Set Global Variable ${paper_weight_id} -customer_add_paper_list_search +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}} @@ -42,8 +42,6 @@ customer_add_paper_list_search 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_list_focus Create Session yytclient ${yytclient} headers=${cloudfactory_customer_header} diff --git a/test_data_clear.robot b/test_data_clear.robot index d3ea28a..d6ebc8c 100644 --- a/test_data_clear.robot +++ b/test_data_clear.robot @@ -4,10 +4,21 @@ Library RequestsLibrary Library Collections Library urllib3 +*** Variables *** +&{operationbackend_header} Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847952999 Authorization=${gettoken_operate} +&{cloudfactory_customer_header} Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847965388 Authorization=${getlogintoken_customer} +&{cloudfactory_supplierfocus_header} Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847956666 Authorization=${getlogintoken_supplier_focus} +&{operationpsc_header} Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847965324 Authorization=${gettoken_operate_psc} +${uecops} https://api-ops-uec-test.qniao.cn +${pscops} https://api-ops-psc-test.qniao.cn +${yytops} https://api-ops-yyt-test.qniao.cn +${yytclient} https://api-client-yyt-test.qniao.cn + *** Test Cases *** database_delete_user_customerclue_customer Connect To Database Using Custom Params pymysql database='uec', user='root', password='password', host='8.135.8.221', port=3306, charset='utf8' Execute Sql String update qn_account set is_delete = 1 where tid = "${customer_account}" + Execute Sql String update qn_enterprise_member set is_delete = 1 where user_id = ${customer_account} ${query} Query select user_id from qn_account where tid = "${customer_account}" ${query_list} Get From List ${query} 0 ${userid} Get From List ${query_list} 0 @@ -20,6 +31,7 @@ database_delete_user_customerclue_customer database_delete_user_customerclue_supplier Connect To Database Using Custom Params pymysql database='uec', user='root', password='password', host='8.135.8.221', port=3306, charset='utf8' Execute Sql String update qn_account set is_delete = 1 where tid = "${supplier_account}" + Execute Sql String update qn_enterprise_member set is_delete = 1 where user_id = ${supplier_account} ${query} Query select user_id from qn_account where tid = "${supplier_account}" ${query_list} Get From List ${query} 0 ${userid} Get From List ${query_list} 0 @@ -56,6 +68,25 @@ database_delete_printing_packaging_factory_credit Execute Sql String update qn_enterprise_credit_order set is_delete = 1 where enterprise_id = ${printing_packaging_factory_id} Disconnect From Database +supplierfocus_batch_product_status_down + Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} + ${product_status} Set Variable 30112 #批量上下架状态 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"]} + +supplierfocus_batch_product_delete + Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} + ${body} Set Variable {"ids":["${product_id}"]} + ${response} POST On Session yytclient /trading-center/delete/product-list ${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"]} + database_delete_paper_category Connect To Database Using Custom Params pymysql database='trading_center', user='root', password='password', host='8.135.8.221', port=3306, charset='utf8' Execute Sql String update qn_category set is_delete = 1 where id = ${paper_category_id} and name = "${paper_category_name}" @@ -79,23 +110,3 @@ supplierfocus_delete_paper_brand 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_delete - Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} - ${product_status} Set Variable 30112 #批量上下架状态 30110未上架 30111上架中 30112已下架 - ${body} Set Variable {"ids":["${product_id}"]} - ${response} POST On Session yytclient /trading-center/delete/product-list ${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_remove_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"]}