diff --git a/001_login_get_info/__init__.robot b/001_login_get_info/__init__.robot new file mode 100644 index 0000000..930440d --- /dev/null +++ b/001_login_get_info/__init__.robot @@ -0,0 +1 @@ +*** Settings *** diff --git a/001_login_get_info/login_customer.robot b/001_login_get_info/login_customer.robot new file mode 100644 index 0000000..0cec788 --- /dev/null +++ b/001_login_get_info/login_customer.robot @@ -0,0 +1,90 @@ +*** Settings *** +Library RequestsLibrary +Library Collections +Library urllib3 + +*** Variables *** +&{cloud_factory_customer_header} Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847965388 +${uecclient} https://api-client-uec-test.qniao.cn +${yytclient} https://api-client-yyt-test.qniao.cn + +*** Test Cases *** +customer_phone + #去除警告 + Disable Warnings + #创建会话 会话别名 baseurl headers + Create Session uecclient ${uecclient} headers=${cloud_factory_customer_header} + #变量名称 设置用例变量 变量值 + ${body} Set Variable {"accountType":2,"account":"13800138003","captcha":"888888"} + #变量接收响应结果 post请求 会话别名 uri 传参 + ${response} POST On Session uecclient /uec/authorize/by-captcha ${body} + #日志 + Log ${response.status_code} + #日志 + Log ${response.text} + #日志 + Log ${response.json()} + #断言数字 预期结果 实际结果 + Should Be Equal As Numbers 200 ${response.status_code} + #断言字符串 预期结果 实际结果 + Should Be Equal As Strings successful ${response.json()["message"]} + #变量接收token 获取字典内容 响应结果 token-key + ${gettoken_customer} Get From Dictionary ${response.json()["data"]} token + #日志 + log ${gettoken_customer} + #设置token变量 未转业务线 + Set Suite Variable ${gettoken_customer} + #变量接收客户userid 获取字典内容 响应结果 serid-key + ${userid_customer} Get From Dictionary ${response.json()["data"]} userId + #日志 + log ${userid_customer} + #设置token变量 + Set Suite Variable ${userid_customer} + #设置带token的请求头 + &{cloudfactorycustomerheader} Create Dictionary Content-Type=application/json;charset=UTF-8 Content-Type=application/json;charset=UTF-8 + #设置token变量 + Set Suite Variable ${cloudfactorycustomerheader} + +customer_login_token + Disable Warnings + Create Session yytclient ${yytclient} headers=${cloudfactorycustomerheader} + ${body} Set Variable {"loginToken":"${gettoken_customer}"} + ${response} POST On Session yytclient /cloud-print-user-center/authorize/get/product-line-token/by/login-token ${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"]} + ${getlogintoken_customer} Get From Dictionary ${response.json()} data + log ${getlogintoken_customer} + #全局token + Set Global Variable ${getlogintoken_customer} + &{cloudfactory_customer_header} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847965388 Authorization=${getlogintoken_customer} + Set Suite Variable ${cloudfactory_customer_header} + +get_customer_userinfo + Create Session uecclient ${uecclient} headers=${cloudfactory_customer_header} + ${response} Get On Session uecclient /uec/get/user-info + 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 Integers ${userid_customer} ${response.json()["data"]["userId"]} + Should Be Equal As Integers 0 ${response.json()["data"]["employeeStatus"]} #员工状态 0 启用 1停用 + +get_customer_baseinfo + Create Session yytclient ${yytclient} headers=${cloudfactory_customer_header} + ${response} Get On Session yytclient cloud-print-user-center/get/base-info + 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 Integers 0 ${response.json()["data"]["employeeStatus"]} #员工状态 0 启用 1停用 + +get_customer_useridentity + Create Session yytclient ${yytclient} headers=${cloudfactory_customer_header} + ${response} Get On Session yytclient cloud-print-user-center/get/user/identity + 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 Integers 3 ${response.json()["data"]["type"]} #身份 0无企业用户 1印包未开户 2印包已开户 3印包已授信 4原纸未开户 5原纸已开户 6原纸集采商 diff --git a/001_login_get_info/login_operate.robot b/001_login_get_info/login_operate.robot new file mode 100644 index 0000000..3975148 --- /dev/null +++ b/001_login_get_info/login_operate.robot @@ -0,0 +1,34 @@ +*** Settings *** +Library RequestsLibrary +Library Collections +Library urllib3 + +*** Variables *** +&{operation_backend_header} Content-Type=application/x-www-form-urlencoded X-APP-ID=503258978847952999 +${yytops} https://api-ops-yyt-test.qniao.cn + +*** Test Cases *** +operate_mail + Disable Warnings + Create Session yytops ${yytops} headers=${operation_backend_header} + &{body} Create Dictionary username=liangjinman@qniao.cn password=qn123456 + ${response} POST On Session yytops /cloud-factory-operation-backend/admin/login ${body} + Log ${response.status_code} + Log ${response.json()} + Should Be Equal As Numbers 200 ${response.status_code} + Should Be Equal As Strings 登陆成功 ${response.json()["message"]} + ${gettoken_operate} get from Dictionary ${response.headers} Authorization + log ${gettoken_operate} + Set Global Variable ${gettoken_operate} + &{operationbackend_header} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847952999 Authorization=${gettoken_operate} + Set Suite Variable ${operationbackend_header} + +get_operate_userinfo + Create Session yytops ${yytops} headers=${operationbackend_header} + ${response} Get On Session yytops /cloud-factory-operation-backend/admin/employee/get/login-info + 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 498985714734731264 ${response.json()["data"]["adminId"]} + Should Be Equal As Strings 管理员 ${response.json()["data"]["positionList"][0]["name"]} diff --git a/001_login_get_info/login_operate_psc.robot b/001_login_get_info/login_operate_psc.robot new file mode 100644 index 0000000..5b87ef0 --- /dev/null +++ b/001_login_get_info/login_operate_psc.robot @@ -0,0 +1,34 @@ +*** Settings *** +Library RequestsLibrary +Library Collections +Library urllib3 + +*** Variables *** +&{operation_psc_header} Content-Type=application/x-www-form-urlencoded X-APP-ID=503258978847965324 +${pscops} https://api-ops-psc-test.qniao.cn + +*** Test Cases *** +operate_mail + Disable Warnings + Create Session pscops ${pscops} headers=${operation_psc_header} + &{body} Create Dictionary username=liangjinman@qniao.cn password=qn123456 + ${response} POST On Session pscops /payment-settlement-center/admin/login ${body} + Log ${response.status_code} + Log ${response.json()} + Should Be Equal As Numbers 200 ${response.status_code} + Should Be Equal As Strings 登陆成功 ${response.json()["message"]} + ${gettoken_operate_psc} get from Dictionary ${response.headers} Authorization + log ${gettoken_operate_psc} + Set Global Variable ${gettoken_operate_psc} + &{operationpsc_header} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847965324 Authorization=${gettoken_operate_psc} + Set Suite Variable ${operationpsc_header} + +get_operate_userinfo + Create Session pscops ${pscops} headers=${operationpsc_header} + ${response} Get On Session pscops /payment-settlement-center/admin/employee/get/login-info + 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 498985714734731264 ${response.json()["data"]["adminId"]} + Should Be Equal As Strings 管理员 ${response.json()["data"]["positionList"][0]["name"]} diff --git a/001_login_get_info/login_supplier.robot b/001_login_get_info/login_supplier.robot new file mode 100644 index 0000000..2f8c2d7 --- /dev/null +++ b/001_login_get_info/login_supplier.robot @@ -0,0 +1,90 @@ +*** Settings *** +Library RequestsLibrary +Library Collections +Library urllib3 + +*** Variables *** +&{cloud_factory_supplier_header} Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847956666 +${uecclient} https://api-client-uec-test.qniao.cn +${yytclient} https://api-client-yyt-test.qniao.cn + +*** Test Cases *** +supplier_phone + #去除警告 + Disable Warnings + #创建会话 会话别名 baseurl headers + Create Session uecclient ${uecclient} headers=${cloud_factory_supplier_header} + #变量名称 设置用例变量 变量值 + ${body} Set Variable {"accountType":2,"account":"13849849646","captcha":"888888"} + #变量接收响应结果 post请求 会话别名 uri 传参 + ${response} POST On Session uecclient /uec/authorize/by-captcha ${body} + #日志 + Log ${response.status_code} + #日志 + Log ${response.text} + #日志 + Log ${response.json()} + #断言数字 预期结果 实际结果 + Should Be Equal As Numbers 200 ${response.status_code} + #断言字符串 预期结果 实际结果 + Should Be Equal As Strings successful ${response.json()["message"]} + #变量接收token 获取字典内容 响应结果 token-key + ${gettoken_supplier} Get From Dictionary ${response.json()["data"]} token + #日志 + log ${gettoken_supplier} + #设置token变量 未转业务线 + Set Suite Variable ${gettoken_supplier} + #变量接收供应商userid 获取字典内容 响应结果 serid-key + ${userid_supplier} Get From Dictionary ${response.json()["data"]} userId + #日志 + log ${userid_supplier} + #设置token变量 + Set Suite Variable ${userid_supplier} + #设置带token的请求头 + &{cloudfactorysupplierheader} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847956666 Authorization=${gettoken_supplier} + #设置token变量 + Set Suite Variable ${cloudfactorysupplierheader} + +supplier_login_token + Disable Warnings + Create Session yytclient ${yytclient} headers=${cloudfactorysupplierheader} + ${body} Set Variable {"loginToken":"${gettoken_supplier}"} + ${response} POST On Session yytclient /cloud-print-user-center/authorize/get/product-line-token/by/login-token ${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"]} + ${getlogintoken_supplier} Get From Dictionary ${response.json()} data + log ${getlogintoken_supplier} + #全局token + Set Global Variable ${getlogintoken_supplier} + &{cloudfactory_supplierheader} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847956666 Authorization=${getlogintoken_supplier} + Set Suite Variable ${cloudfactory_supplierheader} + +get_supplier_userinfo + Create Session uecclient ${uecclient} headers=${cloudfactory_supplierheader} + ${response} Get On Session uecclient /uec/get/user-info + 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 Integers ${userid_supplier} ${response.json()["data"]["userId"]} + Should Be Equal As Integers 0 ${response.json()["data"]["employeeStatus"]} #员工状态 0 启用 1停用 + +get_supplier_baseinfo + Create Session yytclient ${yytclient} headers=${cloudfactory_supplierheader} + ${response} Get On Session yytclient cloud-print-user-center/get/base-info + 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 Integers 0 ${response.json()["data"]["employeeStatus"]} #员工状态 0 启用 1停用 + +get_supplier_useridentity + Create Session yytclient ${yytclient} headers=${cloudfactory_supplierheader} + ${response} Get On Session yytclient cloud-print-user-center/get/user/identity + 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 Integers 5 ${response.json()["data"]["type"]} #身份 0无企业用户 1印包未开户 2印包已开户 3印包已授信 4原纸未开户 5原纸已开户 6原纸集采商 diff --git a/001_login_get_info/login_supplier_focus.robot b/001_login_get_info/login_supplier_focus.robot new file mode 100644 index 0000000..a2e56b0 --- /dev/null +++ b/001_login_get_info/login_supplier_focus.robot @@ -0,0 +1,84 @@ +*** Settings *** +Library RequestsLibrary +Library Collections +Library urllib3 + +*** Variables *** +&{cloud_factory_supplier_focus_header} Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847956666 +${uecclient} https://api-client-uec-test.qniao.cn +${yytclient} https://api-client-yyt-test.qniao.cn + +*** Test Cases *** +supplier_focus_phone + #去除警告 + Disable Warnings + #创建会话 会话别名 baseurl headers + Create Session uecclient ${uecclient} headers=${cloud_factory_supplier_focus_header} + #变量名称 设置用例变量 变量值 + ${body} Set Variable {"accountType":2,"account":"18219557422","captcha":"888888"} + #变量接收响应结果 post请求 会话别名 uri 传参 + ${response} POST On Session uecclient /uec/authorize/by-captcha ${body} + #日志 + Log ${response.status_code} + #日志 + Log ${response.text} + #日志 + Log ${response.json()} + #断言数字 预期结果 实际结果 + Should Be Equal As Numbers 200 ${response.status_code} + #断言字符串 预期结果 实际结果 + Should Be Equal As Strings successful ${response.json()["message"]} + #变量接收token 获取字典内容 响应结果 token-key + ${gettoken_supplier_focus} Get From Dictionary ${response.json()["data"]} token + #日志 + log ${gettoken_supplier_focus} + #设置token变量 未转业务线 + Set Suite Variable ${gettoken_supplier_focus} + #变量接收集采商userid 获取字典内容 响应结果 serid-key + ${userid_supplier_focus} Get From Dictionary ${response.json()["data"]} userId + #日志 + log ${userid_supplier_focus} + #设置token变量 + Set Suite Variable ${userid_supplier_focus} + #设置带token的请求头 + &{cloudfactorysupplierfocusheader} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847956666 Authorization=${gettoken_supplier_focus} + #设置token变量 + Set Suite Variable ${cloudfactorysupplierfocusheader} + +supplier_focus_login_token + Disable Warnings + Create Session yytclient ${yytclient} headers=${cloudfactorysupplierfocusheader} + ${body} Set Variable {"loginToken":"${gettoken_supplier_focus}"} + ${response} POST On Session yytclient /cloud-print-user-center/authorize/get/product-line-token/by/login-token ${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"]} + ${getlogintoken_supplier_focus} Get From Dictionary ${response.json()} data + log ${getlogintoken_supplier_focus} + #全局token + Set Global Variable ${getlogintoken_supplier_focus} + &{cloudfactory_supplierfocus_header} Create Dictionary Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847956666 Authorization=${getlogintoken_supplier_focus} + Set Suite Variable ${cloudfactory_supplierfocus_header} + +get_supplier_focus_userinfo + Create Session uecclient ${uecclient} headers=${cloudfactory_supplierfocus_header} + ${response} Get On Session uecclient /uec/get/user-info + 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 Integers ${userid_supplier_focus} ${response.json()["data"]["userId"]} + Should Be Equal As Integers 0 ${response.json()["data"]["employeeStatus"]} #员工状态 0 启用 1停用 + Should Be Equal As Strings 538701347130839040 ${response.json()["data"]["enterpriseId"]} + Should Be Equal As Strings 厦门千纸互联科技有限公司 ${response.json()["data"]["enterpriseName"]} + +get_supplier_focus_baseinfo + Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} + ${response} Get On Session yytclient cloud-print-user-center/get/base-info + 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 Integers 0 ${response.json()["data"]["employeeStatus"]} #员工状态 0 启用 1停用 + Should Be Equal As Integers 1 ${response.json()["data"]["mallSupplier"]["managementModel"]} #经营模式 0虚拟供应商 1直营 2自营 diff --git a/002_user_register/customer_user_register.robot b/002_user_register/customer_user_register.robot new file mode 100644 index 0000000..49bb4d9 --- /dev/null +++ b/002_user_register/customer_user_register.robot @@ -0,0 +1,11 @@ +*** Settings *** +Library RequestsLibrary +Library Collections +Library urllib3 + +*** Variables *** +&{cloud_factory_customer_header} Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847965388 +${uecclient} https://api-client-uec-test.qniao.cn +${yytclient} https://api-client-yyt-test.qniao.cn + +*** Test Cases *** diff --git a/002_user_register/supplier_user_register.robot b/002_user_register/supplier_user_register.robot new file mode 100644 index 0000000..c033c1a --- /dev/null +++ b/002_user_register/supplier_user_register.robot @@ -0,0 +1,11 @@ +*** Settings *** +Library RequestsLibrary +Library Collections +Library urllib3 + +*** Variables *** +&{cloud_factory_supplier_header} Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847956666 +${uecclient} https://api-client-uec-test.qniao.cn +${yytclient} https://api-client-yyt-test.qniao.cn + +*** Test Cases *** diff --git a/003_enterprise_open_account_customer/printing_packaging_factory_open_account.robot b/003_enterprise_open_account_customer/printing_packaging_factory_open_account.robot new file mode 100644 index 0000000..448b31b --- /dev/null +++ b/003_enterprise_open_account_customer/printing_packaging_factory_open_account.robot @@ -0,0 +1,10 @@ +*** Settings *** +Library RequestsLibrary +Library Collections +Library urllib3 + +*** Variables *** +&{operation_backend_header} Content-Type=application/x-www-form-urlencoded X-APP-ID=503258978847952999 +${yytops} https://api-ops-yyt-test.qniao.cn + +*** Test Cases *** diff --git a/004_enterprise_open_account_supplier/supplier_paper_open_account.robot b/004_enterprise_open_account_supplier/supplier_paper_open_account.robot new file mode 100644 index 0000000..d76672b --- /dev/null +++ b/004_enterprise_open_account_supplier/supplier_paper_open_account.robot @@ -0,0 +1,10 @@ +*** Settings *** +Library RequestsLibrary +Library Collections +Library urllib3 + +*** Variables *** +&{cloud_factory_supplier_focus_header} Content-Type=application/json;charset=UTF-8 X-APP-ID=503258978847956666 +${yytclient} https://api-client-yyt-test.qniao.cn + +*** Test Cases *** diff --git a/005_enterprise_apply_credit/apply_credit_qniao_customer.robot b/005_enterprise_apply_credit/apply_credit_qniao_customer.robot new file mode 100644 index 0000000..e042051 --- /dev/null +++ b/005_enterprise_apply_credit/apply_credit_qniao_customer.robot @@ -0,0 +1,10 @@ +*** Settings *** +Library RequestsLibrary +Library Collections +Library urllib3 + +*** Variables *** +&{operation_psc_header} Content-Type=application/x-www-form-urlencoded X-APP-ID=503258978847965324 +${pscops} https://api-ops-psc-test.qniao.cn + +*** Test Cases *** diff --git a/006_get_credit/__init__.robot b/006_get_credit/__init__.robot new file mode 100644 index 0000000..e69de29 diff --git a/006_get_credit/customer_get_credit.robot b/006_get_credit/customer_get_credit.robot new file mode 100644 index 0000000..ef02af1 --- /dev/null +++ b/006_get_credit/customer_get_credit.robot @@ -0,0 +1,23 @@ +*** 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_qniao + Create Session yytclient ${yytclient} headers=${cloudfactory_customer_header} + ${response} Get On Session yytclient /cloud-print-user-center/credit/get/self-enterprise-credit-by-enterprise-id + log ${response.json()} + Should Be Equal As Numbers 200 ${response.status_code} + Should Be Equal As Strings successful ${response.json()["message"]} + +customer_get_credit_feisuan + Create Session yytclient ${yytclient} headers=${cloudfactory_customer_header} + ${response} Get On Session yytclient /cloud-print-user-center/credit/get/enterprise-feisuan-credit + 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 new file mode 100644 index 0000000..8dbff63 --- /dev/null +++ b/007_paper_variety_management/paper_brand.robot @@ -0,0 +1,89 @@ +*** 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_categoryd} 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_categoryd}","paperManufacturerId":"${paper_Manufacturerid}","name":"${paper_brand_name}","paperName":"${paper_name}","characteristic":"${paper_characteristic}","description":"${paper_description}","img":"${paper_brand_img}"} + Set Suite Variable ${paper_categoryd} + 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_categoryd} ${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_categoryd} ${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_categoryd}","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"]} + +supplierfocus_delete_paper_brand + Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} + ${body} Set Variable {"idList":["${paper_brand_id}"]} + ${response} POST On Session yytclient /trading-center/delete/category-brands/by/ids ${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/007_paper_variety_management/paper_category.robot b/007_paper_variety_management/paper_category.robot new file mode 100644 index 0000000..40b82ed --- /dev/null +++ b/007_paper_variety_management/paper_category.robot @@ -0,0 +1,60 @@ +*** 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")} + 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 Suite 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"]} + +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}" + ${query} Query select is_delete from qn_category where id = ${paper_category_id} and name = "${paper_category_name}" + log ${query} + Should Be Equal As Strings ((1,),) ${query} + Disconnect From Database diff --git a/007_paper_variety_management/paper_manufacturer.robot b/007_paper_variety_management/paper_manufacturer.robot new file mode 100644 index 0000000..61eb5ff --- /dev/null +++ b/007_paper_variety_management/paper_manufacturer.robot @@ -0,0 +1,67 @@ +*** 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_manufacturer + Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} + ${paper_manufacturer_name} Set Variable autotest_paper_manufacturer_name + ${paper_manufacturer_shortName} Set Variable apmn + ${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 Suite Variable ${paper_manufacturer_description} + Set Suite Variable ${paper_manufacturer_logoImg} + ${response} POST On Session yytclient /trading-center/save/paper-manufacturer ${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_manufacturer_list + Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} + ${response} Get On Session yytclient /trading-center/get/paper-manufacturer/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_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} + +supplierfocus_search_paper_manufacturer + Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} + ${param} Set Variable searchValue=${paper_manufacturer_name} + ${response} Get On Session yytclient /trading-center/get/paper-manufacturer/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_manufacturer_name} ${response.json()["data"]["records"][0]["name"]} + Should Be Equal As Strings ${paper_manufacturer_id} ${response.json()["data"]["records"][0]["id"]} + +supplierfocus_edit_paper_manufacturer + Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} + ${body} Set Variable {"id":"${paper_manufacturer_id}","name":"${paper_manufacturer_name}","shortName":"${paper_manufacturer_shortName}","description":"${paper_manufacturer_description}","logoImg":"${paper_manufacturer_logoImg}"} + ${response} POST On Session yytclient /trading-center/save/paper-manufacturer ${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_delete_paper_manufacturer + Create Session yytclient ${yytclient} headers=${cloudfactory_supplierfocus_header} + ${body} Set Variable {"idList":["${paper_manufacturer_id}"]} + ${response} POST On Session yytclient /trading-center/delete/paper-manfucturers/by/ids ${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/008_market_information/market_information_link.robot b/008_market_information/market_information_link.robot new file mode 100644 index 0000000..9bbcd1b --- /dev/null +++ b/008_market_information/market_information_link.robot @@ -0,0 +1,49 @@ +*** Settings *** +Library RequestsLibrary +Library Collections +Library urllib3 + +*** Variables *** +&{operationbackend_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_save_market_information_link + Disable Warnings + Create Session yytops ${yytops} headers=${operationbackend_header} + ${market_information_link} Set Variable http://mp.weixin.qq.com/s?__biz=MzU1MDMwNzAzMA==&mid=2247483666&idx=1&sn=f63007b21094978d2f864fdd884b39dc&chksm=fba3d4abccd45dbdb535ef00b0a3cb7c24242e467f3b55e067c343da11d780d527d6fc5cb327&scene=18#wechat_redirect + ${body} Set Variable {"link":"${link}"} + Set Suite Variable ${market_information_link} + ${response} POST On Session yytops /trading-center/admin/save/market-information-link ${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_market_information_link_list + Create Session yytops ${yytops} headers=${operationbackend_header} + ${response} Get On Session yytops /trading-center/admin/get/market-information-link-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 ${market_information_link} ${response.json()["data"]["records"][0]["link"]} + +customer_get_market_information_link + Create Session yytclient ${yytclient} headers=${cloudfactory_customer_header} + ${response} Get On Session yytclient /trading-center/get/market-information-link + 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 ${market_information_link} ${response.json()["data"]["link"]} + +record_market_information_link_view + Create Session yytclient ${yytclient} headers=${cloudfactory_customer_header} + ${response} POST On Session yytclient /trading-center/record/market-information-link/view + 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/log.html b/log.html new file mode 100644 index 0000000..d06db5b --- /dev/null +++ b/log.html @@ -0,0 +1,2125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Opening Robot Framework log failed

+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/output.xml b/output.xml new file mode 100644 index 0000000..275d5c8 --- /dev/null +++ b/output.xml @@ -0,0 +1,190 @@ + + + + + +Helper for quickly disabling all urllib3 warnings. + + + +Create Session: create a HTTP session to a server + +uecclient +https://api-client-uec-test.qniao.cn +headers=${cloud_factory_header} + +Creating Session using : alias=uecclient, url=https://api-client-uec-test.qniao.cn, headers={'Content-Type': 'application/json;charset=UTF-8', 'X-APP-ID': '503258978847965388'}, cookies={}, auth=None, timeout=None, proxies=None, verify=False, debug=0 + + + +Returns the given values which can then be assigned to a variables. + +{"accountType":2,"account":"13800138003","captcha":"888888"} + + +${body} + +${body} = {"accountType":2,"account":"13800138003","captcha":"888888"} + + + +Sends a POST request on a previously created HTTP Session. + +uecclient +/uec/authorize/by-captcha +${body} + + +${response} + +POST Request : url=https://api-client-uec-test.qniao.cn/uec/authorize/by-captcha + path_url=/uec/authorize/by-captcha + headers={'User-Agent': 'python-requests/2.24.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive', 'Content-Type': 'application/json;charset=UTF-8', 'X-APP-ID': '503258978847965388', 'Content-Length': '60'} + body={"accountType":2,"account":"13800138003","captcha":"888888"} + +POST Response : url=https://api-client-uec-test.qniao.cn/uec/authorize/by-captcha + status=200, reason= + headers={'Server': 'nginx/1.16.1', 'Date': 'Sat, 18 Sep 2021 08:55:17 GMT', 'Content-Type': 'application/json', 'Transfer-Encoding': 'chunked', 'Connection': 'keep-alive', 'Vary': 'Origin, Access-Control-Request-Method, Access-Control-Request-Headers'} + body={"code":0,"message":"successful","data":{"token":"iHP4V/g6O5DXHixyNrf7tm/UsBwShEYjzGx1kBBPitW/uRQ/XF4TcsgaRNT5xfGbd8lW/8cZSuwx4bLjA9dbxg==","userId":"584061932592566272"}} + +${response} = <Response [200]> + + + +Logs the given message with the given level. + +${response.status_code} + +200 + + + +Logs the given message with the given level. + +${response.text} + +{"code":0,"message":"successful","data":{"token":"iHP4V/g6O5DXHixyNrf7tm/UsBwShEYjzGx1kBBPitW/uRQ/XF4TcsgaRNT5xfGbd8lW/8cZSuwx4bLjA9dbxg==","userId":"584061932592566272"}} + + + +Logs the given message with the given level. + +${response.json()} + +{'code': 0, 'message': 'successful', 'data': {'token': 'iHP4V/g6O5DXHixyNrf7tm/UsBwShEYjzGx1kBBPitW/uRQ/XF4TcsgaRNT5xfGbd8lW/8cZSuwx4bLjA9dbxg==', 'userId': '584061932592566272'}} + + + +Fails if objects are unequal after converting them to real numbers. + +200 +${response.status_code} + +Argument types are: +<type 'unicode'> +<class 'int'> + + + +Fails if objects are unequal after converting them to strings. + +successful +${response.json()["message"]} + + + + +Returns a value from the given ``dictionary`` based on the given ``key``. + +${response.json()["data"] } +token + + +${gettoken_customer} + +${gettoken_customer} = iHP4V/g6O5DXHixyNrf7tm/UsBwShEYjzGx1kBBPitW/uRQ/XF4TcsgaRNT5xfGbd8lW/8cZSuwx4bLjA9dbxg== + + + +Logs the given message with the given level. + +${gettoken_customer} + +iHP4V/g6O5DXHixyNrf7tm/UsBwShEYjzGx1kBBPitW/uRQ/XF4TcsgaRNT5xfGbd8lW/8cZSuwx4bLjA9dbxg== + + + +Makes a variable available everywhere within the scope of the current suite. + +${gettoken_customer} + +${gettoken_customer} = iHP4V/g6O5DXHixyNrf7tm/UsBwShEYjzGx1kBBPitW/uRQ/XF4TcsgaRNT5xfGbd8lW/8cZSuwx4bLjA9dbxg== + + + +Returns a value from the given ``dictionary`` based on the given ``key``. + +${response.json()["data"] } +userId + + +${userid_customer} + +${userid_customer} = 584061932592566272 + + + +Logs the given message with the given level. + +${userid_customer} + +584061932592566272 + + + +Makes a variable available everywhere within the scope of the current suite. + +${userid_customer} + +${userid_customer} = 584061932592566272 + + + +Creates and returns a dictionary based on the given ``items``. + +Content-Type=application/json;charset=UTF-8 +X-APP-ID=503258978847965388 +Authorization=${gettoken_customer} + + +&{cloudfactorycustomerheader} + +&{cloudfactorycustomerheader} = { Content-Type=application/json;charset=UTF-8 | X-APP-ID=503258978847965388 | Authorization=iHP4V/g6O5DXHixyNrf7tm/UsBwShEYjzGx1kBBPitW/uRQ/XF4TcsgaRNT5xfGbd8lW/8cZSuwx4bLjA9dbxg== } + + + +Makes a variable available everywhere within the scope of the current suite. + +${cloudfactorycustomerheader} + +${cloudfactorycustomerheader} = {'Content-Type': 'application/json;charset=UTF-8', 'X-APP-ID': '503258978847965388', 'Authorization': 'iHP4V/g6O5DXHixyNrf7tm/UsBwShEYjzGx1kBBPitW/uRQ/XF4TcsgaRNT5xfGbd8lW/8cZSuwx4bLjA9dbxg=='} + + + + + + + + +Critical Tests +All Tests + + + + +Login Customer + + + + + diff --git a/report.html b/report.html new file mode 100644 index 0000000..7b2cdd6 --- /dev/null +++ b/report.html @@ -0,0 +1,2431 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

Opening Robot Framework report failed

+ +
+ + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +